mirror of
https://github.com/esphome/esphome.git
synced 2026-10-22 13:56:10 +00:00
[tests] Clear testing_mode after every test (#21292)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user