From 175bfb4bc9e59371a8101af96c6ff853ad18dab6 Mon Sep 17 00:00:00 2001 From: Pieter De Gendt Date: Wed, 13 Nov 2024 08:39:54 +0100 Subject: [PATCH] tests: net: lib: lwm2m: interop: Fix strip-with-multi-characters (B005) All strip functions remove any of the provided characters instead of a prefix/suffix. This is likely a bug. See https://docs.astral.sh/ruff/rules/strip-with-multi-characters/ Signed-off-by: Pieter De Gendt --- tests/net/lib/lwm2m/interop/pytest/leshan.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/net/lib/lwm2m/interop/pytest/leshan.py b/tests/net/lib/lwm2m/interop/pytest/leshan.py index 024bc6775c0..916661a8a4e 100644 --- a/tests/net/lib/lwm2m/interop/pytest/leshan.py +++ b/tests/net/lib/lwm2m/interop/pytest/leshan.py @@ -455,7 +455,7 @@ class LeshanEventsIterator: for line in self._it: if not line.startswith('data: '): continue - data = json.loads(line.lstrip('data: ')) + data = json.loads(line.removeprefix('data: ')) if event == 'SEND' or (event == 'NOTIFICATION' and data['kind'] == 'composite'): return Leshan.parse_composite(data['val']) if event == 'NOTIFICATION':