From 8f9e83f27f8ebb25d51bd2774ff6a673dd8929f1 Mon Sep 17 00:00:00 2001 From: TheJulianJES Date: Fri, 27 Feb 2026 17:37:00 +0100 Subject: [PATCH] Suppress expected warnings in tests --- tests/conftest.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 990d3e1ba..32bcd2947 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -41,6 +41,11 @@ INSTANCES: list[Gateway] = [] _LOGGER = logging.getLogger(__name__) +EXPECTED_WARNING_FILTERS = ( + r"ignore:Attribute '.*' has `is_manufacturer_specific` without an explicit `manufacturer_code`\. Please set `manufacturer_code=0x[0-9A-Fa-f]+`\.:DeprecationWarning", + r"ignore:Unique IDs are unique only with platform prefix.*:UserWarning", +) + class _FakeApp(ControllerApplication): async def add_endpoint(self, descriptor: zdo_t.SimpleDescriptor): @@ -388,7 +393,9 @@ def cluster_handler_factory( def pytest_collection_modifyitems(config, items): - """Add the looptime marker to all tests except the test_async.py file.""" + """Add shared markers to tests.""" for item in items: if "test_async_.py" not in item.nodeid: item.add_marker(pytest.mark.looptime) + for warning_filter in EXPECTED_WARNING_FILTERS: + item.add_marker(pytest.mark.filterwarnings(warning_filter))