pytest: a session config home, so no test can write or migrate the user's real Strata settings (#198 data-folder migration)
This commit is contained in:
1 parent
3de6363749
commit
b1f7b4ac3a
1 file changed
+9
@@ -0,0 +1,9 @@
|
||||
"""pytest: setup.py's data-folder migration (#198) saves the data folder it settled on in the user's settings file
|
||||
(%APPDATA%\Strata\settings.json, ~/.config/strata/settings.json) and can MOVE model files from a folder it finds there.
|
||||
A test that reaches it must never touch the real file, so the whole session gets its own config home."""
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
_home = tempfile.mkdtemp(prefix="strata-pytest-config-")
|
||||
os.environ["APPDATA"] = _home
|
||||
os.environ["XDG_CONFIG_HOME"] = _home
|
||||
Reference in new issue
Block a user