[tests] Clear testing_mode after every test (#21292)

This commit is contained in:
J. Nick Koston
2026-10-21 08:35:22 -10:00
committed by GitHub
parent 16759c848f
commit 32bbf55f2a
3 changed files with 2 additions and 2 deletions
+1
View File
@@ -55,6 +55,7 @@ def reset_core() -> Generator[None]:
"""Reset CORE after each test."""
yield
CORE.reset()
CORE.testing_mode = False # reset() leaves it, so a test enabling it would leak
@pytest.fixture(autouse=True)
@@ -62,8 +62,6 @@ def _setup_core(tmp_path: Path) -> Generator[None]:
"build_src_flags": "-include esphome/components/esp8266/throw_stubs.h",
}
yield
# CORE.reset() (the suite-wide autouse fixture) does not clear this flag
CORE.testing_mode = False
def _set_flags(*flags: str) -> None:
+1
View File
@@ -48,6 +48,7 @@ def reset_core():
"""Reset CORE after each test."""
yield
CORE.reset()
CORE.testing_mode = False # reset() leaves it, so a test enabling it would leak
@pytest.fixture(autouse=True)