From aa244d570c2566e63066861a34067c2a5073b229 Mon Sep 17 00:00:00 2001 From: Alvaro Valdebenito Date: Wed, 11 Jan 2023 11:37:48 +0100 Subject: [PATCH] fix GodData test Enum for Python3.11 --- .vscode/settings.json | 1 + tests/sensors/test_sensor.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b371503..b305f77 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -63,6 +63,7 @@ "aqmd", "avaldebe", "baudrate", + "caplog", "executemany", "executescript", "fontawesome", diff --git a/tests/sensors/test_sensor.py b/tests/sensors/test_sensor.py index 0963182..0d64069 100644 --- a/tests/sensors/test_sensor.py +++ b/tests/sensors/test_sensor.py @@ -68,7 +68,7 @@ def long_buffer(self) -> "RawData": return self._replace(hex=buffer[6:], id="data at the end of the buffer") -class GoodData(Enum): +class GoodData(RawData, Enum): PMSx003 = RawData( "424d001c0005000d00160005000d001602fd00fc001d000f00060006970003c5", @@ -132,7 +132,7 @@ def test_param(cls) -> Iterator[pytest.ParameterSet]: @classmethod def test_obs(cls, secs: int = 1567201793) -> Iterator[pytest.ParameterSet]: for sensor in cls: - obs = Sensor[sensor.name].decode(sensor.value.msg, time=secs) + obs = Sensor[sensor.name].decode(sensor.msg, time=secs) yield pytest.param(obs, id=sensor.name)