From 53c853ddb83325e2c5eea94d48e0a374a781a290 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sun, 25 Jan 2026 15:06:02 +0000 Subject: [PATCH 1/3] Update test files to clarify ruff noqa comments and improve readability --- tests/test_auth.py | 4 ++++ tests/test_client.py | 3 ++- tests/test_enums.py | 2 +- tests/test_models.py | 2 +- tests/test_obfuscate.py | 2 +- tests/test_serializers.py | 3 +++ tests/test_utils.py | 2 +- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/test_auth.py b/tests/test_auth.py index 8106d29d..081d631f 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,5 +1,9 @@ """Tests for authentication module.""" +# ruff: noqa: S101, S105, S106 +# S101: Tests use assert statements. +# S105/S106: Test credentials use dummy values. + from __future__ import annotations import base64 diff --git a/tests/test_client.py b/tests/test_client.py index 45ef7508..e7b3813c 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,7 +1,8 @@ """Unit tests for the high-level OverkizClient behaviour and responses.""" -# ruff: noqa: S101, ASYNC230 +# ruff: noqa: ASYNC230, S101, S106 # S101: Tests use assert statements +# S106: Test credentials use dummy values. # ASYNC230: Blocking open() is acceptable for reading test fixtures from __future__ import annotations diff --git a/tests/test_enums.py b/tests/test_enums.py index b693231a..533b80f7 100644 --- a/tests/test_enums.py +++ b/tests/test_enums.py @@ -1,7 +1,7 @@ """Tests for enum helper behaviour and expected values.""" # ruff: noqa: S101 -# Tests use assert statements +# S101: Tests use assert statements. from pyoverkiz.enums import ( EventName, diff --git a/tests/test_models.py b/tests/test_models.py index 73568796..0cfea48c 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,7 +1,7 @@ """Unit tests for models (Device, State and States helpers).""" # ruff: noqa: S101 -# Tests use assert statements +# S101: Tests use assert statements. from __future__ import annotations diff --git a/tests/test_obfuscate.py b/tests/test_obfuscate.py index 41063946..516a426a 100644 --- a/tests/test_obfuscate.py +++ b/tests/test_obfuscate.py @@ -1,7 +1,7 @@ """Tests for the obfuscation utilities used in fixtures and logging.""" # ruff: noqa: S101 -# Tests use assert statements +# S101: Tests use assert statements. import pytest diff --git a/tests/test_serializers.py b/tests/test_serializers.py index 603132e2..db446cf7 100644 --- a/tests/test_serializers.py +++ b/tests/test_serializers.py @@ -1,5 +1,8 @@ """Tests for pyoverkiz.serializers.""" +# ruff: noqa: S101 +# S101: Tests use assert statements. + from __future__ import annotations from pyoverkiz.serializers import prepare_payload diff --git a/tests/test_utils.py b/tests/test_utils.py index 4e739625..ff84bd7a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,7 +1,7 @@ """Tests for utility helper functions like server generation and gateway checks.""" # ruff: noqa: S101 -# Tests use assert statements +# S101: Tests use assert statements. import pytest From a18a41717e03ed2bd685f09a8ebb6baee0c157f5 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sun, 25 Jan 2026 16:30:12 +0100 Subject: [PATCH 2/3] Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- tests/test_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index e7b3813c..206ef2e1 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,7 +1,7 @@ """Unit tests for the high-level OverkizClient behaviour and responses.""" # ruff: noqa: ASYNC230, S101, S106 -# S101: Tests use assert statements +# S101: Tests use assert statements. # S106: Test credentials use dummy values. # ASYNC230: Blocking open() is acceptable for reading test fixtures From 4fc151f938035c289257533a85b6e380e3f29127 Mon Sep 17 00:00:00 2001 From: Mick Vleeshouwer Date: Sun, 25 Jan 2026 20:35:07 +0000 Subject: [PATCH 3/3] Update ruff noqa comments to improve test clarity and allow assertions in tests --- pyproject.toml | 3 +++ tests/test_auth.py | 3 +-- tests/test_client.py | 3 +-- tests/test_enums.py | 3 --- tests/test_models.py | 3 --- tests/test_obfuscate.py | 3 --- tests/test_serializers.py | 3 --- tests/test_utils.py | 3 --- 8 files changed, 5 insertions(+), 19 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a4d2f856..0e1f0982 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,9 @@ select = [ ] ignore = ["E501"] # Line too long +[tool.ruff.lint.per-file-ignores] +"tests/**" = ["S101"] # Allow assert in tests + [tool.ruff.lint.pydocstyle] convention = "google" # Accepts: "google", "numpy", or "pep257". diff --git a/tests/test_auth.py b/tests/test_auth.py index 081d631f..f7b274bb 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,7 +1,6 @@ """Tests for authentication module.""" -# ruff: noqa: S101, S105, S106 -# S101: Tests use assert statements. +# ruff: noqa: S105, S106 # S105/S106: Test credentials use dummy values. from __future__ import annotations diff --git a/tests/test_client.py b/tests/test_client.py index 206ef2e1..ad25cd48 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,7 +1,6 @@ """Unit tests for the high-level OverkizClient behaviour and responses.""" -# ruff: noqa: ASYNC230, S101, S106 -# S101: Tests use assert statements. +# ruff: noqa: ASYNC230, S106 # S106: Test credentials use dummy values. # ASYNC230: Blocking open() is acceptable for reading test fixtures diff --git a/tests/test_enums.py b/tests/test_enums.py index 533b80f7..79abfd8b 100644 --- a/tests/test_enums.py +++ b/tests/test_enums.py @@ -1,8 +1,5 @@ """Tests for enum helper behaviour and expected values.""" -# ruff: noqa: S101 -# S101: Tests use assert statements. - from pyoverkiz.enums import ( EventName, ExecutionSubType, diff --git a/tests/test_models.py b/tests/test_models.py index 0cfea48c..5f76c32f 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -1,8 +1,5 @@ """Unit tests for models (Device, State and States helpers).""" -# ruff: noqa: S101 -# S101: Tests use assert statements. - from __future__ import annotations import humps diff --git a/tests/test_obfuscate.py b/tests/test_obfuscate.py index 516a426a..ec129460 100644 --- a/tests/test_obfuscate.py +++ b/tests/test_obfuscate.py @@ -1,8 +1,5 @@ """Tests for the obfuscation utilities used in fixtures and logging.""" -# ruff: noqa: S101 -# S101: Tests use assert statements. - import pytest from pyoverkiz.obfuscate import obfuscate_email, obfuscate_sensitive_data diff --git a/tests/test_serializers.py b/tests/test_serializers.py index db446cf7..603132e2 100644 --- a/tests/test_serializers.py +++ b/tests/test_serializers.py @@ -1,8 +1,5 @@ """Tests for pyoverkiz.serializers.""" -# ruff: noqa: S101 -# S101: Tests use assert statements. - from __future__ import annotations from pyoverkiz.serializers import prepare_payload diff --git a/tests/test_utils.py b/tests/test_utils.py index ff84bd7a..8b33b8f7 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,8 +1,5 @@ """Tests for utility helper functions like server generation and gateway checks.""" -# ruff: noqa: S101 -# S101: Tests use assert statements. - import pytest from pyoverkiz.utils import create_local_server_config, is_overkiz_gateway