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 8106d29d..f7b274bb 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -1,5 +1,8 @@ """Tests for authentication module.""" +# ruff: noqa: S105, S106 +# 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..ad25cd48 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: S101, ASYNC230 -# S101: Tests use assert statements +# ruff: noqa: ASYNC230, S106 +# 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..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 -# Tests use assert statements - from pyoverkiz.enums import ( EventName, ExecutionSubType, diff --git a/tests/test_models.py b/tests/test_models.py index 73568796..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 -# Tests use assert statements - from __future__ import annotations import humps diff --git a/tests/test_obfuscate.py b/tests/test_obfuscate.py index 41063946..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 -# Tests use assert statements - import pytest from pyoverkiz.obfuscate import obfuscate_email, obfuscate_sensitive_data diff --git a/tests/test_utils.py b/tests/test_utils.py index 4e739625..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 -# Tests use assert statements - import pytest from pyoverkiz.utils import create_local_server_config, is_overkiz_gateway