mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Register the custom pytest marks instead of ignoring the warning (#179840)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude
parent
2e1b5de6fe
commit
bd7685f7a4
@@ -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",
|
||||
|
||||
@@ -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."""
|
||||
|
||||
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user