          self.assertIsNone(caches['v2'].get('answer2', version=1))
          self.assertIsNone(caches['v2'].get('answer2', version=2))
          self.assertEqual(caches['v2'].get('answer2', version=3), 42)
  
          self.assertRaises(ValueError, cache.incr_version, 'does_not_exist')
  
      def test_decr_version(self):
          cache.set('answer', 42, version=2)
          self.assertIsNone(cache.get('answer'))
          self.assertIsNone(cache.get('answer', version=1))
 
</s> remove         self.assertRaises(ValueError, cache.decr_version, 'does_not_exist', version=2)
 </s> add         with self.assertRaises(ValueError):
            cache.decr_version('does_not_exist', version=2) </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, '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, cache.incr, 'does_not_exist')
 </s> add         with self.assertRaises(ValueError):
            cache.incr('does_not_exist')
        with self.assertRaises(ValueError):
            cache.incr_version('does_not_exist')
          self.assertIsNone(caches['v2'].get('answer2', version=1))
          self.assertIsNone(caches['v2'].get('answer2', version=2))
          self.assertEqual(caches['v2'].get('answer2', version=3), 42)
  
        with self.assertRaises(ValueError):
            cache.incr_version('does_not_exist')
  
      def test_decr_version(self):
          cache.set('answer', 42, version=2)
          self.assertIsNone(cache.get('answer'))
          self.assertIsNone(cache.get('answer', version=1))
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/cache/tests.py