Coverage for tests / marks.py: 66%
29 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-08 01:48 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-05-08 01:48 +0000
1import pytest
3from faststream._internal._compat import (
4 IS_MACOS,
5 IS_WINDOWS,
6 PYDANTIC_V2,
7)
9skip_windows = pytest.mark.skipif(
10 IS_WINDOWS,
11 reason="does not run on windows",
12)
14skip_macos = pytest.mark.skipif(
15 IS_MACOS,
16 reason="does not run on macOS",
17)
19pydantic_v1 = pytest.mark.skipif(
20 PYDANTIC_V2,
21 reason="requires PydanticV2",
22)
24pydantic_v2 = pytest.mark.skipif(
25 not PYDANTIC_V2,
26 reason="requires PydanticV1",
27)
30try:
31 from faststream.confluent import KafkaBroker
32except ImportError:
33 HAS_CONFLUENT = False
34else:
35 HAS_CONFLUENT = True
37require_confluent = pytest.mark.skipif(
38 not HAS_CONFLUENT,
39 reason="requires confluent-kafka",
40)
43try:
44 from faststream.kafka import KafkaBroker # noqa: F401
45except ImportError:
46 HAS_AIOKAFKA = False
47else:
48 HAS_AIOKAFKA = True
50require_aiokafka = pytest.mark.skipif(
51 not HAS_AIOKAFKA,
52 reason="requires aiokafka",
53)
56try:
57 from faststream.rabbit import RabbitBroker # noqa: F401
58except ImportError:
59 HAS_AIOPIKA = False
60else:
61 HAS_AIOPIKA = True
63require_aiopika = pytest.mark.skipif(
64 not HAS_AIOPIKA,
65 reason="requires aio-pika",
66)
69try:
70 from faststream.redis import RedisBroker # noqa: F401
71except ImportError:
72 HAS_REDIS = False
73else:
74 HAS_REDIS = True
76require_redis = pytest.mark.skipif(
77 not HAS_REDIS,
78 reason="requires redis",
79)
82try:
83 from faststream.nats import NatsBroker # noqa: F401
84except ImportError:
85 HAS_NATS = False
86else:
87 HAS_NATS = True
89require_nats = pytest.mark.skipif(
90 not HAS_NATS,
91 reason="requires nats-py",
92)