Register the custom pytest marks instead of ignoring the warning (#179840)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Paulus Schoutsen
2026-08-22 15:14:27 -04:00
committed by GitHub
co-authored by Claude
parent 2e1b5de6fe
commit bd7685f7a4
3 changed files with 12 additions and 5 deletions
-5
View File
@@ -458,11 +458,6 @@ filterwarnings = [
# Modify app state for testing
"ignore:Changing state of started or joined application is deprecated:DeprecationWarning:tests.components.http.test_ban",
# -- Tests
# Ignore custom pytest marks
"ignore:Unknown pytest.mark.disable_autouse_fixture:pytest.PytestUnknownMarkWarning:tests.components.met",
"ignore:Unknown pytest.mark.dataset:pytest.PytestUnknownMarkWarning:tests.components.screenlogic",
# -- DeprecationWarning already fixed in our codebase
# https://github.com/kurtmckee/feedparser/ - 6.0.12
"ignore:.*a temporary mapping .* from `updated_parsed` to `published_parsed` if `updated_parsed` doesn't exist:DeprecationWarning:feedparser.util",
+7
View File
@@ -5,6 +5,13 @@ from unittest.mock import AsyncMock, patch
import pytest
def pytest_configure(config: pytest.Config) -> None:
"""Register the mark used to opt out of the autouse fixtures."""
config.addinivalue_line(
"markers", "disable_autouse_fixture: mark test to skip an autouse fixture"
)
@pytest.fixture
def mock_weather():
"""Mock weather data."""
+5
View File
@@ -19,6 +19,11 @@ from . import (
from tests.common import MockConfigEntry
def pytest_configure(config: pytest.Config) -> None:
"""Register the mark used to select the dataset."""
config.addinivalue_line("markers", "dataset: mark test with the dataset to load")
@pytest.fixture
def mock_config_entry() -> MockConfigEntry:
"""Return a mocked config entry."""