MCPcopy Create free account
hub / github.com/crate/crate / tearDown

Function tearDown

blackbox/test_docs.py:391–406  ·  view source on GitHub ↗
(test)

Source from the content-addressed store, hash-verified

389
390
391def tearDown(test):
392 # drop leftover tables after each test
393 with connect(crate.http_url) as conn:
394 c = conn.cursor()
395 c.execute("""
396 SELECT table_schema, table_name
397 FROM information_schema.tables
398 WHERE table_schema NOT IN ('blob', 'sys', 'information_schema', 'pg_catalog')
399 """)
400 for schema, table in c.fetchall():
401 try:
402 c.execute("""
403 DROP TABLE IF EXISTS "{}"."{}"
404 """.format(schema, table))
405 except Exception as e:
406 print('Failed to drop table {}.{}: {}'.format(schema, table, e))
407
408
409docsuite = partial(doctest.DocFileSuite,

Callers

nothing calls this directly

Calls 3

cursorMethod · 0.80
executeMethod · 0.65
formatMethod · 0.65

Tested by

no test coverage detected