diff --git a/tests/conftest.py b/tests/conftest.py index 33e9431..616581f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -140,6 +140,17 @@ def test_db(tmp_path): conn.close() +@pytest.fixture(autouse=True) +def _isolate_tle_store(tmp_path, monkeypatch): + """Every test gets a throwaway TLE store; nothing touches instance/tle.db.""" + from utils import tle_store + + monkeypatch.setattr(tle_store, "_DB_PATH", tmp_path / "tle.db") + tle_store._reset_for_tests() + yield + tle_store._reset_for_tests() + + @pytest.fixture def fake_process(): """Factory for complete subprocess.Popen replacements. diff --git a/tests/test_satellite.py b/tests/test_satellite.py index 0670a6e..e451496 100644 --- a/tests/test_satellite.py +++ b/tests/test_satellite.py @@ -8,17 +8,6 @@ from flask import Flask from routes.satellite import satellite_bp -@pytest.fixture(autouse=True) -def _isolate_tle_state(tmp_path, monkeypatch): - """Point the TLE store at a throwaway DB so tests never touch real data.""" - from utils import tle_store - - monkeypatch.setattr(tle_store, "_DB_PATH", tmp_path / "tle.db") - tle_store._reset_for_tests() - yield - tle_store._reset_for_tests() - - @pytest.fixture def app(): app = Flask(__name__)