fix(tests): reset_paths fixture should not clear at teardown (breaks atexit callbacks)
This commit is contained in:
+5
-6
@@ -423,15 +423,14 @@ def isolate_workspace(monkeypatch) -> Generator[None, None, None]:
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_paths() -> Generator[None, None, None]:
|
||||
"""
|
||||
Autouse fixture that resets the paths singleton before each test.
|
||||
The isolate_workspace fixture re-initializes paths before the test runs,
|
||||
so reset_paths is a no-op here (PathsConfig is frozen at init time,
|
||||
the per-getter cache is gone). Kept as a marker for backward compatibility
|
||||
with test code that asserts the singleton is cleared at test boundaries.
|
||||
Autouse marker fixture. No-op at setup AND teardown — PathsConfig is
|
||||
frozen at init time, and clearing it would break atexit callbacks
|
||||
(e.g., session_logger.close_session) that fire after pytest finishes.
|
||||
If a test needs a fresh paths graph, it must call paths.initialize_paths()
|
||||
explicitly. See src/paths.py docstring for the explicit-init contract.
|
||||
"""
|
||||
from src import paths
|
||||
yield
|
||||
paths.reset_paths()
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def reset_ai_client() -> Generator[None, None, None]:
|
||||
|
||||
Reference in New Issue
Block a user