added motion trajectory simulation
This commit is contained in:
@@ -81,6 +81,32 @@ def tmp_dir():
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _isolate_preference_file(monkeypatch):
|
||||
"""Send every preference write to scratch, whatever the test does.
|
||||
|
||||
Not a convenience: a single test that built a window without this redirect
|
||||
left its own scratch bundle path in the *real* ``apps/autocal/preference.json``
|
||||
through ``closeEvent``, so the installed app then started up remembering a
|
||||
bundle that did not exist. A test-side leak that presents as a bench bug is
|
||||
worth a session-wide net rather than a note in each test.
|
||||
"""
|
||||
import shutil
|
||||
|
||||
from orisys_app_shared import paths as paths_mod
|
||||
from orisys_app_shared import prefs as prefs_pkg
|
||||
|
||||
from orisys_autocal import preferences as prefs_mod
|
||||
|
||||
scratch = _scratch_dir()
|
||||
prefs_file = scratch / "preference.json"
|
||||
monkeypatch.setattr(paths_mod, "preference_path", lambda: prefs_file)
|
||||
monkeypatch.setattr(prefs_pkg.store, "preference_path", lambda: prefs_file)
|
||||
monkeypatch.setattr(prefs_mod, "preference_path", lambda: prefs_file)
|
||||
yield
|
||||
shutil.rmtree(scratch, ignore_errors=True)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def make_window(qt_app, monkeypatch):
|
||||
"""Build a window whose preference writes stay inside a scratch directory.
|
||||
|
||||
Reference in New Issue
Block a user