test: isolate the TLE store suite-wide

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-06-11 17:29:03 +01:00
parent 0af3028151
commit 07887b7c99
2 changed files with 11 additions and 11 deletions
+11
View File
@@ -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.
-11
View File
@@ -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__)