From 059fb272bb7735ac1a68748cf40474a2b32ad738 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Wed, 15 Jul 2026 21:19:20 +0800 Subject: [PATCH] test(device-host-agent): add conftest.py to disable humanize in tests The root tests/conftest.py fixture disables APEX_HUMANIZE_ENABLED by default for deterministic assertions, but apps/device-host-agent/tests/ was outside its scope. test_e2e.py::test_public_sdk_reports_fake_device_success_and_runtime_failure failed because tap coordinates were jittered (2.67..., 3.37...) instead of exact (2, 3). Add the same autouse fixture to apps/device-host-agent/tests/conftest.py so all tests in that directory inherit the deterministic behavior. --- apps/device-host-agent/tests/conftest.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 apps/device-host-agent/tests/conftest.py diff --git a/apps/device-host-agent/tests/conftest.py b/apps/device-host-agent/tests/conftest.py new file mode 100644 index 0000000..2b91784 --- /dev/null +++ b/apps/device-host-agent/tests/conftest.py @@ -0,0 +1,11 @@ +import pytest + + +@pytest.fixture(autouse=True) +def _humanize_disabled_by_default_in_tests(monkeypatch): + """Humanize defaults ON in production; tests default it OFF so existing + exact-coordinate assertions stay deterministic. Tests that want to + exercise humanize call ``monkeypatch.setenv("APEX_HUMANIZE_ENABLED", "true")`` + in their own body, which overrides this fixture (test body runs after + fixture setup).""" + monkeypatch.setenv("APEX_HUMANIZE_ENABLED", "false")