Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ classifiers = [

dependencies = [
"taskiq>=0.11.0,<0.12.0",
"faststream>=0.3.14,<0.6.0",
"faststream>=0.6.0rc0",
]

[project.optional-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion taskiq_faststream/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from fast_depends.utils import is_async_gen_callable, is_gen_callable
from faststream.types import SendableMessage
from faststream.utils.functions import to_async
from faststream._internal.utils.functions import to_async


async def resolve_msg(
Expand Down
14 changes: 12 additions & 2 deletions tests/testcase.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import asyncio
import typing
import anyio
from datetime import datetime, timedelta, timezone
from typing import Any
from typing import Any, Optional, ContextManager, Callable
from unittest.mock import MagicMock

import pytest
from faststream.types import SendableMessage
from faststream.utils.functions import timeout_scope
from freezegun import freeze_time
from taskiq import AsyncBroker
from taskiq.cli.scheduler.args import SchedulerArgs
Expand All @@ -17,6 +17,16 @@
from tests import messages


def timeout_scope(
timeout: Optional[float] = 30,
raise_timeout: bool = False,
) -> ContextManager[anyio.CancelScope]:
scope: Callable[[Optional[float]], ContextManager[anyio.CancelScope]]
scope = anyio.fail_after if raise_timeout else anyio.move_on_after

return scope(timeout)


@pytest.mark.anyio
class SchedulerTestcase:
test_class: Any
Expand Down