From 0fd91d5b730c246acf564dafcbcd0a49672b3e0d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sat, 20 Jun 2026 08:22:00 +0000 Subject: [PATCH] fix(tests/e2e): gate spend-log truncate on e2e marker, not test directory --- tests/e2e/conftest.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/e2e/conftest.py b/tests/e2e/conftest.py index d9930170add..25052bf1df2 100644 --- a/tests/e2e/conftest.py +++ b/tests/e2e/conftest.py @@ -35,7 +35,11 @@ def pytest_configure(config: pytest.Config) -> None: def pytest_runtest_call(item: pytest.Item) -> None: """Mark that an e2e test body actually ran (not skipped at setup). Skipped sessions never reach this hook, so the session-finish cleanup can use it as a - guard before truncating the spend-log DB.""" + guard before truncating the spend-log DB. Tests under `tests/e2e/` without the + `e2e` marker (pure unit coverage for the harness itself) never hit the proxy, + so they must not arm the destructive DB truncate.""" + if item.get_closest_marker("e2e") is None: + return item.session.stash[_E2E_TEST_RAN] = True