Change pytest fixture scope from core fixtures (#104831)

This commit is contained in:
Franck Nijhof 2023-12-01 07:14:13 +01:00 committed by GitHub
parent 1273bc8ec4
commit 7ec2980e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ def patch_zeroconf_multiple_catcher() -> Generator[None, None, None]:
yield
@pytest.fixture(autouse=True)
@pytest.fixture(scope="session", autouse=True)
def prevent_io() -> Generator[None, None, None]:
"""Fixture to prevent certain I/O from happening."""
with patch(

View File

@ -383,7 +383,7 @@ def reset_hass_threading_local_object() -> Generator[None, None, None]:
ha._hass.__dict__.clear()
@pytest.fixture(autouse=True)
@pytest.fixture(scope="session", autouse=True)
def bcrypt_cost() -> Generator[None, None, None]:
"""Run with reduced rounds during tests, to speed up uses."""
import bcrypt
@ -1544,7 +1544,7 @@ async def mock_enable_bluetooth(
await hass.async_block_till_done()
@pytest.fixture
@pytest.fixture(scope="session")
def mock_bluetooth_adapters() -> Generator[None, None, None]:
"""Fixture to mock bluetooth adapters."""
with patch(

View File

@ -40,7 +40,7 @@ async def apply_stop_hass(stop_hass: None) -> None:
"""Make sure all hass are stopped."""
@pytest.fixture(autouse=True)
@pytest.fixture(scope="session", autouse=True)
def mock_http_start_stop() -> Generator[None, None, None]:
"""Mock HTTP start and stop."""
with patch(