          self.assertEqual(base7.encode(-1234), 'ghejd')
          self.assertEqual(base7.decode('ghejd'), -1234)
  
      def test_exception(self):
          self.assertRaises(ValueError, BaseConverter, 'abc', sign='a')
          self.assertIsInstance(BaseConverter('abc', sign='d'), BaseConverter)
 
</s> remove         self.assertRaises(ValueError, cache.decr_version, 'answer')
        self.assertRaises(ValueError, cache.decr_version, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.decr_version('answer')
        with self.assertRaises(ValueError):
            cache.decr_version('does_not_exist') </s> remove         self.assertRaises(ValueError, cache.incr_version, 'answer')
        self.assertRaises(ValueError, cache.incr_version, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.incr_version('answer')
        with self.assertRaises(ValueError):
            cache.incr_version('does_not_exist') </s> remove         self.assertRaises(ValueError, cache.incr, 'answer')
        self.assertRaises(ValueError, cache.incr, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.incr('answer')
        with self.assertRaises(ValueError):
            cache.incr('does_not_exist') </s> remove         self.assertRaises(ValueError, self.assertNumQueries, 2, test_func)
 </s> add         with self.assertRaises(ValueError):
            self.assertNumQueries(2, test_func) </s> remove         self.assertRaises(ValueError, indexfcn, ul, 40)
        self.assertRaises(ValueError, removefcn, ul, 40)
 </s> add         with self.assertRaises(ValueError):
            indexfcn(ul, 40)
        with self.assertRaises(ValueError):
            removefcn(ul, 40)
        with self.assertRaises(ValueError):
            BaseConverter('abc', sign='a')
          self.assertEqual(base7.encode(-1234), 'ghejd')
          self.assertEqual(base7.decode('ghejd'), -1234)
  
      def test_exception(self):
        with self.assertRaises(ValueError):
            BaseConverter('abc', sign='a')
          self.assertIsInstance(BaseConverter('abc', sign='d'), BaseConverter)
keep keep keep keep replace keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/utils_tests/test_baseconv.py