__init__.py 525 B

1234567891011121314151617
  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. TEST_DIR = path.dirname(path.realpath(__file__))
  7. TEST_DATA_DIR = path.join(TEST_DIR, "data")
  8. TEST_CONFIG_DIR = path.join(TEST_DIR, "tables", "data")
  9. # Reload main SS modules after changing environment variables.
  10. environ["TXL_DB_PATH"] = path.join(gettempdir(), "scriptshifter_unittest.db")
  11. reload(scriptshifter)
  12. environ["TXL_CONFIG_TABLE_DIR"] = TEST_CONFIG_DIR
  13. reload(tables)