Skip to content

Commit 28affc4

Browse files
committed
re-introduce pytestmark=pytest.mark.asyncio for python 3.6
1 parent d0bb0b2 commit 28affc4

15 files changed

+51
-5
lines changed

tests/test_asyncio/conftest.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
from typing import Union
44
from urllib.parse import urlparse
55

6-
if sys.version_info[0:2] == (3, 6):
7-
import pytest as pytest_asyncio
8-
else:
9-
import pytest_asyncio
10-
116
import pytest
127
from packaging.version import Version
138

@@ -25,6 +20,13 @@
2520

2621
from .compat import mock
2722

23+
if sys.version_info[0:2] == (3, 6):
24+
import pytest as pytest_asyncio
25+
26+
pytestmark = pytest.mark.asyncio
27+
else:
28+
import pytest_asyncio
29+
2830

2931
async def _get_info(redis_url):
3032
client = redis.Redis.from_url(redis_url)

tests/test_asyncio/test_bloom.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
import sys
2+
13
import pytest
24

35
import redis.asyncio as redis
46
from redis.exceptions import ModuleError, RedisError
57
from redis.utils import HIREDIS_AVAILABLE
68

9+
if sys.version_info[0:2] == (3, 6):
10+
pytestmark = pytest.mark.asyncio
11+
712

813
def intlist(obj):
914
return [int(v) for v in obj]

tests/test_asyncio/test_cluster.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
if sys.version_info[0:2] == (3, 6):
1313
import pytest as pytest_asyncio
14+
15+
pytestmark = pytest.mark.asyncio
1416
else:
1517
import pytest_asyncio
1618

tests/test_asyncio/test_commands.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
if sys.version_info[0:2] == (3, 6):
1414
import pytest as pytest_asyncio
15+
16+
pytestmark = pytest.mark.asyncio
1517
else:
1618
import pytest_asyncio
1719

tests/test_asyncio/test_connection.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import sys
23
import types
34

45
import pytest
@@ -10,6 +11,9 @@
1011

1112
from .compat import mock
1213

14+
if sys.version_info[0:2] == (3, 6):
15+
pytestmark = pytest.mark.asyncio
16+
1317

1418
@pytest.mark.onlynoncluster
1519
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")

tests/test_asyncio/test_connection_pool.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
if sys.version_info[0:2] == (3, 6):
99
import pytest as pytest_asyncio
10+
11+
pytestmark = pytest.mark.asyncio
1012
else:
1113
import pytest_asyncio
1214

tests/test_asyncio/test_encoding.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
if sys.version_info[0:2] == (3, 6):
66
import pytest as pytest_asyncio
7+
8+
pytestmark = pytest.mark.asyncio
79
else:
810
import pytest_asyncio
911

tests/test_asyncio/test_lock.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
if sys.version_info[0:2] == (3, 6):
77
import pytest as pytest_asyncio
8+
9+
pytestmark = pytest.mark.asyncio
810
else:
911
import pytest_asyncio
1012

tests/test_asyncio/test_monitor.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
import sys
2+
13
import pytest
24

35
from tests.conftest import skip_if_redis_enterprise, skip_ifnot_redis_enterprise
46

57
from .conftest import wait_for_command
68

9+
if sys.version_info[0:2] == (3, 6):
10+
pytestmark = pytest.mark.asyncio
11+
712

813
@pytest.mark.onlynoncluster
914
class TestMonitor:

tests/test_asyncio/test_pipeline.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import sys
2+
13
import pytest
24

35
import redis
46
from tests.conftest import skip_if_server_version_lt
57

68
from .conftest import wait_for_command
79

10+
if sys.version_info[0:2] == (3, 6):
11+
pytestmark = pytest.mark.asyncio
12+
813

914
class TestPipeline:
1015
@pytest.mark.onlynoncluster

tests/test_asyncio/test_pubsub.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
if sys.version_info[0:2] == (3, 6):
1010
import pytest as pytest_asyncio
11+
12+
pytestmark = pytest.mark.asyncio(forbid_global_loop=True)
1113
else:
1214
import pytest_asyncio
1315

tests/test_asyncio/test_scripting.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
if sys.version_info[0:2] == (3, 6):
66
import pytest as pytest_asyncio
7+
8+
pytestmark = pytest.mark.asyncio
79
else:
810
import pytest_asyncio
911

tests/test_asyncio/test_search.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import bz2
22
import csv
33
import os
4+
import sys
45
import time
56
from io import TextIOWrapper
67

@@ -18,6 +19,10 @@
1819
from redis.commands.search.suggestion import Suggestion
1920
from tests.conftest import skip_ifmodversion_lt
2021

22+
if sys.version_info[0:2] == (3, 6):
23+
pytestmark = pytest.mark.asyncio
24+
25+
2126
WILL_PLAY_TEXT = os.path.abspath(
2227
os.path.join(os.path.dirname(__file__), "testdata", "will_play_text.csv.bz2")
2328
)

tests/test_asyncio/test_sentinel.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
if sys.version_info[0:2] == (3, 6):
77
import pytest as pytest_asyncio
8+
9+
pytestmark = pytest.mark.asyncio
810
else:
911
import pytest_asyncio
1012

tests/test_asyncio/test_timeseries.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import time
23
from time import sleep
34

@@ -6,6 +7,9 @@
67
import redis.asyncio as redis
78
from tests.conftest import skip_ifmodversion_lt
89

10+
if sys.version_info[0:2] == (3, 6):
11+
pytestmark = pytest.mark.asyncio
12+
913

1014
@pytest.mark.redismod
1115
async def test_create(modclient: redis.Redis):

0 commit comments

Comments
 (0)