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.
This commit is contained in:
@@ -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")
|
||||||
Reference in New Issue
Block a user