              connection.introspection.table_name_converter('backends_square'),
              connection.ops.quote_name('root'),
              connection.ops.quote_name('square')
          ))
          self.assertRaises(Exception, cursor.executemany, query, [(1, 2, 3)])
          self.assertRaises(Exception, cursor.executemany, query, [(1,)])
  
  
  # Unfortunately, the following tests would be a good test to run on all
  # backends, but it breaks MySQL hard. Until #13711 is fixed, it can't be run
  # everywhere (although it would be an effective test of #13711).
 
</s> remove         self.assertRaises(ValueError, str, qs.query)
 </s> add         with self.assertRaises(ValueError):
            str(qs.query) </s> remove         self.assertRaises(Exception, cache.set, 'key with spaces', 'value')
 </s> add         with self.assertRaises(Exception):
            cache.set('key with spaces', 'value') </s> remove         self.assertRaises(ValueError, Author.objects.annotate, friends=Count('friends'))
 </s> add         with self.assertRaises(ValueError):
            Author.objects.annotate(friends=Count('friends')) </s> remove             self.assertRaises(GEOSException, fg._get_ptr)
 </s> add             with self.assertRaises(GEOSException):
                fg._get_ptr() </s> remove         self.assertRaises(Exception, cache.set, 'a' * 251, 'value')
 </s> add         with self.assertRaises(Exception):
            cache.set('a' * 251, 'value')
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1, 2, 3)])
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1,)])
              connection.introspection.table_name_converter('backends_square'),
              connection.ops.quote_name('root'),
              connection.ops.quote_name('square')
          ))
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1, 2, 3)])
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1,)])
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1, 2, 3)])
        with self.assertRaises(Exception):
            cursor.executemany(query, [(1,)])
  
  
  # Unfortunately, the following tests would be a good test to run on all
  # backends, but it breaks MySQL hard. Until #13711 is fixed, it can't be run
  # everywhere (although it would be an effective test of #13711).
keep keep keep keep replace replace keep keep keep keep keep
 Refs #26022 -- Used context manager version of assertRaises in tests. 
tests/backends/tests.py