          In order to be memcached-API-library agnostic, we only assert
          that a generic exception of some kind is raised.
          """
          # memcached does not allow whitespace or control characters in keys
          self.assertRaises(Exception, cache.set, 'key with spaces', 'value')
          # memcached limits key length to 250
          self.assertRaises(Exception, cache.set, 'a' * 251, 'value')
  
      # Explicitly display a skipped test if no configured cache uses MemcachedCache
      @unittest.skipUnless(
 
</s> remove         self.assertRaises(Exception, cache.set, 'a' * 251, 'value')
 </s> add         with self.assertRaises(Exception):
            cache.set('a' * 251, 'value') </s> remove         self.assertRaises(Exception, cursor.executemany, query, [(1, 2, 3)])
        self.assertRaises(Exception, cursor.executemany, query, [(1,)])
 </s> add         with self.assertRaises(Exception):
            cursor.executemany(query, [(1, 2, 3)])
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1,)]) </s> remove             self.assertRaises(GEOSException, fg._get_ptr)
 </s> add             with self.assertRaises(GEOSException):
                fg._get_ptr() </s> remove         self.assertRaises(ValueError, str, qs.query)
 </s> add         with self.assertRaises(ValueError):
            str(qs.query) </s> remove         self.assertRaises(ObjectDoesNotExist, get_current_site, request)
 </s> add         with self.assertRaises(ObjectDoesNotExist):
            get_current_site(request)
        with self.assertRaises(Exception):
            cache.set('key with spaces', 'value')
          In order to be memcached-API-library agnostic, we only assert
          that a generic exception of some kind is raised.
          """
          # memcached does not allow whitespace or control characters in keys
        with self.assertRaises(Exception):
            cache.set('key with spaces', 'value')
          # memcached limits key length to 250
          self.assertRaises(Exception, cache.set, 'a' * 251, 'value')
  
      # Explicitly display a skipped test if no configured cache uses MemcachedCache
      @unittest.skipUnless(
keep keep keep keep replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/cache/tests.py