MCPcopy Index your code
hub / github.com/python/cpython / test_large_sql

Method test_large_sql

Lib/test/test_sqlite3/test_regression.py:334–345  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

332 self.assertRaises(UnicodeEncodeError, cur.execute, "select '\udcff'")
333
334 def test_large_sql(self):
335 msg = "query string is too large"
336 with memory_database() as cx, cx_limit(cx) as lim:
337 cu = cx.cursor()
338
339 cx("select 1".ljust(lim))
340 # use a different SQL statement; don't reuse from the LRU cache
341 cu.execute("select 2".ljust(lim))
342
343 sql = "select 3".ljust(lim+1)
344 self.assertRaisesRegex(sqlite.DataError, msg, cx, sql)
345 self.assertRaisesRegex(sqlite.DataError, msg, cu.execute, sql)
346
347 def test_commit_cursor_reset(self):
348 """

Callers

nothing calls this directly

Calls 5

memory_databaseFunction · 0.85
cx_limitFunction · 0.85
assertRaisesRegexMethod · 0.80
ljustMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected