From aed83035d10661f1157283bc5635fbcb1189aaff Mon Sep 17 00:00:00 2001 From: John Travers Date: Mon, 9 Nov 2026 10:16:37 +0000 Subject: [PATCH] SEP 46: fresh once-per-process store warnings for each calibration test The store and the profile reader warn once per message per process, so of two tests expecting the same warning in one worker, the second saw none. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01XGENPvJBFJdUL6p1LDpss5 --- tests/calibration/conftest.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/calibration/conftest.py diff --git a/tests/calibration/conftest.py b/tests/calibration/conftest.py new file mode 100644 index 000000000..5418a6599 --- /dev/null +++ b/tests/calibration/conftest.py @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2026 John C. Travers and contributors +# +# SPDX-License-Identifier: GPL-3.0-or-later + +"""Fixtures for every calibration test.""" + +from __future__ import annotations + +import pytest + +from solprop.calibration import _native + + +@pytest.fixture(autouse=True) +def _fresh_store_warnings(monkeypatch: pytest.MonkeyPatch) -> None: # pyright: ignore[reportUnusedFunction] + """Give each test its own once-per-process store warnings. + + The store and the profile reader warn once per message per process, so a test + expecting a warning would otherwise miss it after another test in its worker. + """ + for module in (_native.profile, _native.store): + monkeypatch.setattr(module, "_WARNED", set())