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.
structural_dynamics_of_flow
Tyler Goodlet 2025-04-10 23:56:47 -04:00
parent 6ff3b6c757
commit b700d90e09
1 changed files with 10 additions and 2 deletions

View File

@ -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)