Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure NotifyTask is a polymorphic subclass of Celery.Task #1199

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tests/test_celery.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import inspect
import logging
import uuid

import pytest
from celery import Task
from flask import g
from freezegun import freeze_time

Expand Down Expand Up @@ -211,3 +213,10 @@ def test_send_task_injects_id_from_request(
None, # kwargs
headers={"notify_request_id": "1234"}, # other kwargs
)


@pytest.mark.parametrize("method, _value", list(inspect.getmembers(Task, predicate=inspect.isfunction)))
def test_method_signatures(celery_app, async_task, method, _value):
if method == "run":
return
assert inspect.signature(getattr(async_task.__class__, method)) == inspect.signature(getattr(Task, method))