Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Jun 20, 2024
1 parent ddd90f9 commit a00d023
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 26 deletions.
20 changes: 7 additions & 13 deletions tests/test_task_celery_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Generator, Optional
from typing import Generator

import celery
import pytest
Expand All @@ -16,32 +16,26 @@
class MyResultTask(ParallelCeleryTask):
"""Task for the test."""

def get_chord_tasks( # type: ignore
def get_group_tasks( # type: ignore
self, *args, **kwargs
) -> tuple[list[celery.Signature], Optional[celery.Signature]]:
) -> list[celery.Signature]:
"""Define the list of tasks for celery chord."""
x = kwargs.get("x")
y = kwargs.get("y")
task_id = kwargs.get("task_id")
return (
[task_sum.s(x, y, task_id)],
None,
)
return [task_sum.s(x, y, task_id)]


class MyTimestampTask(ParallelCeleryTask):
"""Task for the test."""

def get_chord_tasks( # type: ignore
def get_group_tasks( # type: ignore
self, *args, **kwargs
) -> tuple[list[celery.Signature], Optional[celery.Signature]]:
) -> list[celery.Signature]:
"""Define the list of tasks for celery chord."""
seconds = kwargs.get("seconds")
task_id = kwargs.get("task_id")
return (
[task_sleep.s(seconds, task_id)],
None,
)
return [task_sleep.s(seconds, task_id)]


@pytest.fixture
Expand Down
20 changes: 7 additions & 13 deletions tests/test_task_celery_serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Generator, Optional
from typing import Generator

import celery
import pytest
Expand All @@ -16,32 +16,26 @@
class MyResultTask(SerialCeleryTask):
"""Task for the test."""

def get_chord_tasks( # type: ignore
def get_group_tasks( # type: ignore
self, *args, **kwargs
) -> tuple[list[celery.Signature], Optional[celery.Signature]]:
) -> list[celery.Signature]:
"""Define the list of tasks for celery chord."""
x = kwargs.get("x")
y = kwargs.get("y")
task_id = kwargs.get("task_id")
return (
[task_sum.s(x, y, task_id)],
None,
)
return [task_sum.s(x, y, task_id)]


class MyTimestampTask(SerialCeleryTask):
"""Task for the test."""

def get_chord_tasks( # type: ignore
def get_group_tasks( # type: ignore
self, *args, **kwargs
) -> tuple[list[celery.Signature], Optional[celery.Signature]]:
) -> list[celery.Signature]:
"""Define the list of tasks for celery chord."""
seconds = kwargs.get("seconds")
task_id = kwargs.get("task_id")
return (
[task_sleep.s(seconds, task_id)],
None,
)
return [task_sleep.s(seconds, task_id)]


@pytest.fixture
Expand Down

0 comments on commit a00d023

Please sign in to comment.