From c9068522ed24ef7ee1991187aac2ddbe40fab31a Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 10 Apr 2025 23:56:47 -0400 Subject: [PATCH] Set `_state._def_tpt_proto` in `tpt_proto` fixture Such that the global test-session always (and only) runs against the CLI specified `--tpt-proto=` transport protocol. --- tests/conftest.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index aeb2caf5..a0b815dc 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -138,11 +138,19 @@ def tpt_protos(request) -> list[str]: yield proto_keys -@pytest.fixture(scope='session') +@pytest.fixture( + scope='session', + autouse=True, +) def tpt_proto( tpt_protos: list[str], ) -> str: - yield tpt_protos[0] + proto_key: str = tpt_protos[0] + from tractor import _state + if _state._def_tpt_proto != proto_key: + _state._def_tpt_proto = proto_key + # breakpoint() + yield proto_key _ci_env: bool = os.environ.get('CI', False)