Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, unique IDs only being unique within a platform is expected and this is logged quite a bit.
I can remove this, of corse, but I think it might make sense to keep until we've migrated away from intentionally using that?

)


class _FakeApp(ControllerApplication):
async def add_endpoint(self, descriptor: zdo_t.SimpleDescriptor):
Expand Down Expand Up @@ -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))