1
0
mirror of https://github.com/home-assistant/core synced 2024-07-08 20:17:01 +00:00

Reduce scope of test fixtures for the pylint plugin tests (#116207)

This commit is contained in:
Erik Montnemery 2024-04-29 08:21:31 +02:00 committed by GitHub
parent 381ffe6eed
commit 0425b7aa6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ def _load_plugin_from_file(module_name: str, file: str) -> ModuleType:
return module
@pytest.fixture(name="hass_enforce_type_hints", scope="session")
@pytest.fixture(name="hass_enforce_type_hints", scope="package")
def hass_enforce_type_hints_fixture() -> ModuleType:
"""Fixture to provide a requests mocker."""
return _load_plugin_from_file(
@ -49,7 +49,7 @@ def type_hint_checker_fixture(hass_enforce_type_hints, linter) -> BaseChecker:
return type_hint_checker
@pytest.fixture(name="hass_imports", scope="session")
@pytest.fixture(name="hass_imports", scope="package")
def hass_imports_fixture() -> ModuleType:
"""Fixture to provide a requests mocker."""
return _load_plugin_from_file(
@ -66,7 +66,7 @@ def imports_checker_fixture(hass_imports, linter) -> BaseChecker:
return type_hint_checker
@pytest.fixture(name="hass_enforce_super_call", scope="session")
@pytest.fixture(name="hass_enforce_super_call", scope="package")
def hass_enforce_super_call_fixture() -> ModuleType:
"""Fixture to provide a requests mocker."""
return _load_plugin_from_file(
@ -83,7 +83,7 @@ def super_call_checker_fixture(hass_enforce_super_call, linter) -> BaseChecker:
return super_call_checker
@pytest.fixture(name="hass_enforce_sorted_platforms", scope="session")
@pytest.fixture(name="hass_enforce_sorted_platforms", scope="package")
def hass_enforce_sorted_platforms_fixture() -> ModuleType:
"""Fixture to the content for the hass_enforce_sorted_platforms check."""
return _load_plugin_from_file(
@ -104,7 +104,7 @@ def enforce_sorted_platforms_checker_fixture(
return enforce_sorted_platforms_checker
@pytest.fixture(name="hass_enforce_coordinator_module", scope="session")
@pytest.fixture(name="hass_enforce_coordinator_module", scope="package")
def hass_enforce_coordinator_module_fixture() -> ModuleType:
"""Fixture to the content for the hass_enforce_coordinator_module check."""
return _load_plugin_from_file(