__init__.py 478 B

12345678910111213141516
  1. from importlib import reload
  2. from os import path, environ
  3. from tempfile import gettempdir
  4. import scriptshifter
  5. from scriptshifter import tables
  6. UNITTEST_CONFIG_DIR = path.join(
  7. path.dirname(path.realpath(__file__)), "tables", "data")
  8. # Reload main SS modules after changing environment variables.
  9. environ["TXL_DB_PATH"] = path.join(gettempdir(), "scriptshifter_unittest.db")
  10. reload(scriptshifter)
  11. environ["TXL_CONFIG_TABLE_DIR"] = UNITTEST_CONFIG_DIR
  12. reload(tables)