mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix conftest for pylint plugin (#72777)
This commit is contained in:
parent
577be70da9
commit
4902af2f4e
@ -1,17 +1,21 @@
|
|||||||
"""Configuration for pylint tests."""
|
"""Configuration for pylint tests."""
|
||||||
from importlib.machinery import SourceFileLoader
|
from importlib.machinery import SourceFileLoader
|
||||||
|
from pathlib import Path
|
||||||
from types import ModuleType
|
from types import ModuleType
|
||||||
|
|
||||||
from pylint.checkers import BaseChecker
|
from pylint.checkers import BaseChecker
|
||||||
from pylint.testutils.unittest_linter import UnittestLinter
|
from pylint.testutils.unittest_linter import UnittestLinter
|
||||||
import pytest
|
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:
|
def hass_enforce_type_hints_fixture() -> ModuleType:
|
||||||
"""Fixture to provide a requests mocker."""
|
"""Fixture to provide a requests mocker."""
|
||||||
loader = SourceFileLoader(
|
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)
|
return loader.load_module(None)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user