From 4902af2f4e7761ddff6706b475ac31c1fd8b5366 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Wed, 1 Jun 2022 09:22:47 +0200 Subject: [PATCH] Fix conftest for pylint plugin (#72777) --- tests/pylint/conftest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/pylint/conftest.py b/tests/pylint/conftest.py index 887f50fb628..edbcec27375 100644 --- a/tests/pylint/conftest.py +++ b/tests/pylint/conftest.py @@ -1,17 +1,21 @@ """Configuration for pylint tests.""" from importlib.machinery import SourceFileLoader +from pathlib import Path from types import ModuleType from pylint.checkers import BaseChecker from pylint.testutils.unittest_linter import UnittestLinter import pytest +BASE_PATH = Path(__file__).parents[2] -@pytest.fixture(name="hass_enforce_type_hints") + +@pytest.fixture(name="hass_enforce_type_hints", scope="session") def hass_enforce_type_hints_fixture() -> ModuleType: """Fixture to provide a requests mocker.""" loader = SourceFileLoader( - "hass_enforce_type_hints", "pylint/plugins/hass_enforce_type_hints.py" + "hass_enforce_type_hints", + str(BASE_PATH.joinpath("pylint/plugins/hass_enforce_type_hints.py")), ) return loader.load_module(None)