mirror of
https://github.com/smittix/intercept.git
synced 2026-06-18 18:39:47 -07:00
test: isolate the TLE store suite-wide
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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__)
|
||||
|
||||
Reference in New Issue
Block a user