Commits

James O'Beirne committed 7b2aacf Draft

Set `check_same_thread` to False for sqlite.

This is to prevent ProgrammingErrors in ddbmock related to callbacks
that invoke objects created by the main thread.

  • Participants
  • Parent commits bbe526e

Comments (0)

Files changed (1)

File ddbmock/database/storage/sqlite.py

 # I know, using global "variable" for this kind of state *is* bad. But it helps
 # keeping execution times to a sane value. In particular, this allows to use
 # in-memory version of sqlite
-conn = sqlite3.connect(config.STORAGE_SQLITE_FILE)
+conn = sqlite3.connect(config.STORAGE_SQLITE_FILE, check_same_thread=False)
 
 class Store(object):
     def __init__(self, name):