From b6f27493de360610dad57417918f5e59d55d1f35 Mon Sep 17 00:00:00 2001 From: Curry Date: Wed, 14 Oct 2026 12:42:44 +0800 Subject: [PATCH] test: isolate ambient xtdc tokens in offline tests --- CHANGELOG.md | 3 +++ tests/conftest.py | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 tests/conftest.py diff --git a/CHANGELOG.md b/CHANGELOG.md index 0115458..06b8d8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ begin. ## Unreleased +- Isolated offline tests from an inherited `QMTCLI_XTDC_TOKEN`; token-specific tests still set + their own values, without changing the CLI's environment-variable fallback. + ## 0.4.0 - 2026-07-07 - Added `qmtcli mcp`: a stdio MCP (Model Context Protocol) server exposing qmtcli commands as MCP diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..2802e16 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,7 @@ +import pytest + + +@pytest.fixture(autouse=True) +def _isolate_xtdc_token(monkeypatch): + """Do not let an operator's data-service token activate SDK initialization in offline tests.""" + monkeypatch.delenv("QMTCLI_XTDC_TOKEN", raising=False)