aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDennis Fink2026-11-12 22:07:12 +0100
committerDennis Fink2026-11-12 22:07:12 +0100
commitc7993952c585b66acad5275e39dbf91cf662b975 (patch)
tree976b3746444b3bd0bbb269bef9197c8b6a2e1696 /tests
parentb930b4425b91aa42abcec6c3443685065a5ca242 (diff)
downloadwebmentions-ssg-c7993952c585b66acad5275e39dbf91cf662b975.tar.gz
webmentions-ssg-c7993952c585b66acad5275e39dbf91cf662b975.zip
chore(core): enable stricter Ruff lint rules
Expand Ruff checks for bugbear, complexity, pathlib, return statements, simplifications, upgrades, and docstring style. Apply the resulting behavior-neutral cleanup across application and test code.
Diffstat (limited to 'tests')
-rw-r--r--tests/tasks/test_scanner.py8
-rw-r--r--tests/test_config.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/tests/tasks/test_scanner.py b/tests/tasks/test_scanner.py
index 57782f1..c46a274 100644
--- a/tests/tasks/test_scanner.py
+++ b/tests/tasks/test_scanner.py
@@ -48,9 +48,11 @@ def test_manual_scan_retries_when_periodic_scan_holds_lock(
scanner_module.huey.init_app(app)
assert scanner_module.huey.huey is not previous_backend
- with scanner_module.huey.lock_task("scan-webmention-sources"):
- with pytest.raises(RetryTask) as exc_info:
- scanner_module.manual_scan_sources.call_local()
+ with (
+ scanner_module.huey.lock_task("scan-webmention-sources"),
+ pytest.raises(RetryTask) as exc_info,
+ ):
+ scanner_module.manual_scan_sources.call_local()
assert exc_info.value.delay == 30
diff --git a/tests/test_config.py b/tests/test_config.py
index 7bec8b6..599c930 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -56,7 +56,7 @@ def test_missing_production_configuration_is_fatal(tmp_path: Path) -> None:
class MissingProductionConfig(ProductionConfig):
CONFIG_FILE = str(tmp_path / "missing.cfg")
- with pytest.raises(FileNotFoundError, match="missing.cfg"):
+ with pytest.raises(FileNotFoundError, match=r"missing.cfg"):
create_app(MissingProductionConfig)
@@ -103,7 +103,7 @@ def test_endpoint_limits_are_inherited_from_defaults() -> None:
assert config.REQUEST_TIMEOUT == 5.0
assert config.REQUEST_TOTAL_TIMEOUT == 30.0
- assert DefaultConfig.ALLOWED_HOSTNAMES == set()
+ assert set() == DefaultConfig.ALLOWED_HOSTNAMES
assert DefaultConfig.IGNORED_HOSTNAMES == ()