          self.assertIsNone(caches['v2'].get('answer2'))
          self.assertEqual(caches['v2'].get('answer2', version=1), 42)
          self.assertIsNone(caches['v2'].get('answer2', version=2))
  
          self.assertRaises(ValueError, cache.decr_version, 'does_not_exist', version=2)
  
      def test_custom_key_func(self):
          # Two caches with different key functions aren't visible to each other
          cache.set('answer1', 42)
          self.assertEqual(cache.get('answer1'), 42)
 
</s> remove         self.assertRaises(ValueError, cache.incr_version, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.incr_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.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, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.incr('does_not_exist') </s> remove         self.assertRaises(ValueError, cache.decr, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.decr('does_not_exist')
        with self.assertRaises(ValueError):
            cache.decr_version('does_not_exist', version=2)
          self.assertIsNone(caches['v2'].get('answer2'))
          self.assertEqual(caches['v2'].get('answer2', version=1), 42)
          self.assertIsNone(caches['v2'].get('answer2', version=2))
  
        with self.assertRaises(ValueError):
            cache.decr_version('does_not_exist', version=2)
  
      def test_custom_key_func(self):
          # Two caches with different key functions aren't visible to each other
          cache.set('answer1', 42)
          self.assertEqual(cache.get('answer1'), 42)
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/cache/tests.py