diff --git a/miio/integrations/airpurifier/zhimi/tests/test_airfresh.py b/miio/integrations/airpurifier/zhimi/tests/test_airfresh.py index ca5de6b43..33065a4ba 100644 --- a/miio/integrations/airpurifier/zhimi/tests/test_airfresh.py +++ b/miio/integrations/airpurifier/zhimi/tests/test_airfresh.py @@ -58,6 +58,11 @@ def __init__(self, *args, **kwargs): @pytest.fixture(scope="class") def airfresh(request): + # pytest 7.2.0 changed the handling of marks, see https://github.com/pytest-dev/pytest/issues/7792 + # the result is subclass device attribute to be overridden for TestAirFreshVA4, + # this hack checks if we already have a device to avoid doing that + if getattr(request.cls, "device", None) is not None: + return request.cls.device = DummyAirFresh() # TODO add ability to test on a real device