Skip to content

Commit d066c44

Browse files
committed
tests(aiokafka): align tests to support python 3.9
1 parent 65276c3 commit d066c44

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
aiokafka==0.13.0
1+
aiokafka==0.13.0; python_version >= "3.10"
2+
aiokafka==0.12.0; python_version < "3.10"
23
pytest==7.4.4
34
-e opentelemetry-instrumentation
45
-e instrumentation/opentelemetry-instrumentation-aiokafka

instrumentation/opentelemetry-instrumentation-aiokafka/tests/test_instrumentation.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414

1515
from __future__ import annotations
1616

17+
import sys
1718
import uuid
1819
from typing import Any, Sequence, cast
19-
from unittest import IsolatedAsyncioTestCase, TestCase, mock
20+
from unittest import IsolatedAsyncioTestCase, TestCase, mock, skipIf
2021

2122
import aiokafka
2223
from aiokafka import (
@@ -63,6 +64,10 @@ def test_instrument_api(self) -> None:
6364
)
6465

6566

67+
@skipIf(
68+
sys.version_info < (3, 10),
69+
"aiokafka >= 0.13 requires Python 3.10+",
70+
)
6671
class TestAIOKafkaInstrumentation(TestBase, IsolatedAsyncioTestCase):
6772
@staticmethod
6873
def consumer_record_factory(

0 commit comments

Comments
 (0)