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

Method test_whichdb_sqlite3_existing_db

Lib/test/test_dbm.py:293–303  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

291
292 @unittest.skipUnless(dbm_sqlite3, reason='Test requires dbm.sqlite3')
293 def test_whichdb_sqlite3_existing_db(self):
294 # Existing sqlite3 databases are detected correctly.
295 sqlite3 = import_helper.import_module("sqlite3")
296 try:
297 # Create an empty database.
298 with sqlite3.connect(_fname) as cx:
299 cx.execute("CREATE TABLE dummy(database)")
300 cx.commit()
301 finally:
302 cx.close()
303 self.assertEqual(self.dbm.whichdb(_fname), "dbm.sqlite3")
304
305
306 def setUp(self):

Callers

nothing calls this directly

Calls 5

import_moduleMethod · 0.45
connectMethod · 0.45
executeMethod · 0.45
closeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected