From f267db9148e3a390a1a2e50fe71ac4675dceaea1 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 18 Nov 2026 21:28:28 +0100 Subject: refactor(core): tighten static typing Add explicit runtime narrowing in tests and simplify Huey decorator annotations so static analysis reflects the dynamic task wrapper behavior. Clean up URL argument construction and form error updates while preserving existing application behavior. --- tests/views/test_endpoint.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/views/test_endpoint.py') diff --git a/tests/views/test_endpoint.py b/tests/views/test_endpoint.py index cb6f426..bf99ed4 100644 --- a/tests/views/test_endpoint.py +++ b/tests/views/test_endpoint.py @@ -493,7 +493,10 @@ def test_endpoint_records_initial_and_resubmission_events( views_module: ModuleType, monkeypatch: pytest.MonkeyPatch, ) -> None: - from webmentions_ssg.models.received import ReceivedWebmentionStatusEvent + from webmentions_ssg.models.received import ( + ReceivedWebmentionStatus, + ReceivedWebmentionStatusEvent, + ) mock_endpoint_form(views_module, monkeypatch, valid=True) monkeypatch.setattr(views_module, "verify_webmention", Mock()) @@ -510,7 +513,7 @@ def test_endpoint_records_initial_and_resubmission_events( ) ).all() assert [event.action for event in events] == ["Received submission"] - mention.status = "failed" + mention.status = ReceivedWebmentionStatus.FAILED mention.failure_reason = "Previous failure" mention.updated_at = datetime.now(UTC) - timedelta(minutes=11) db.session.commit() -- cgit v1.3.1