From 0425b7aa6d61dfdae0435ea6829a9cce12a3a121 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 29 Apr 2024 08:21:31 +0200 Subject: [PATCH] Reduce scope of test fixtures for the pylint plugin tests (#116207) --- tests/pylint/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/pylint/conftest.py b/tests/pylint/conftest.py index 2b0fdcf7df5..90e535a7b0e 100644 --- a/tests/pylint/conftest.py +++ b/tests/pylint/conftest.py @@ -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(