mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Change pytest fixture scope from core fixtures (#104831)
This commit is contained in:
parent
1273bc8ec4
commit
7ec2980e52
@ -16,7 +16,7 @@ def patch_zeroconf_multiple_catcher() -> Generator[None, None, None]:
|
|||||||
yield
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
def prevent_io() -> Generator[None, None, None]:
|
def prevent_io() -> Generator[None, None, None]:
|
||||||
"""Fixture to prevent certain I/O from happening."""
|
"""Fixture to prevent certain I/O from happening."""
|
||||||
with patch(
|
with patch(
|
||||||
|
@ -383,7 +383,7 @@ def reset_hass_threading_local_object() -> Generator[None, None, None]:
|
|||||||
ha._hass.__dict__.clear()
|
ha._hass.__dict__.clear()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True)
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
def bcrypt_cost() -> Generator[None, None, None]:
|
def bcrypt_cost() -> Generator[None, None, None]:
|
||||||
"""Run with reduced rounds during tests, to speed up uses."""
|
"""Run with reduced rounds during tests, to speed up uses."""
|
||||||
import bcrypt
|
import bcrypt
|
||||||
@ -1544,7 +1544,7 @@ async def mock_enable_bluetooth(
|
|||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture(scope="session")
|
||||||
def mock_bluetooth_adapters() -> Generator[None, None, None]:
|
def mock_bluetooth_adapters() -> Generator[None, None, None]:
|
||||||
"""Fixture to mock bluetooth adapters."""
|
"""Fixture to mock bluetooth adapters."""
|
||||||
with patch(
|
with patch(
|
||||||
|
@ -40,7 +40,7 @@ async def apply_stop_hass(stop_hass: None) -> None:
|
|||||||
"""Make sure all hass are stopped."""
|
"""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]:
|
def mock_http_start_stop() -> Generator[None, None, None]:
|
||||||
"""Mock HTTP start and stop."""
|
"""Mock HTTP start and stop."""
|
||||||
with patch(
|
with patch(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user