Skip to content

Commit ebcd7d1

Browse files
committed
Use pytest-asyncio in auto mode
Remove overly genereric `pytestmark=pytest.mark.asyncio` causing lots of warning noise
1 parent e6cd4fd commit ebcd7d1

15 files changed

+1
-30
lines changed

tests/test_asyncio/test_bloom.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from redis.exceptions import ModuleError, RedisError
55
from redis.utils import HIREDIS_AVAILABLE
66

7-
pytestmark = pytest.mark.asyncio
8-
97

108
def intlist(obj):
119
return [int(v) for v in obj]

tests/test_asyncio/test_cluster.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@
3939
skip_unless_arch_bits,
4040
)
4141

42-
pytestmark = pytest.mark.asyncio
43-
4442
default_host = "127.0.0.1"
4543
default_port = 7000
4644
default_cluster_slots = [

tests/test_asyncio/test_commands.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727
REDIS_6_VERSION = "5.9.0"
2828

2929

30-
pytestmark = pytest.mark.asyncio
31-
32-
3330
@pytest_asyncio.fixture()
3431
async def slowlog(r: redis.Redis, event_loop):
3532
current_config = await r.config_get()

tests/test_asyncio/test_connection.py

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

1111
from .compat import mock
1212

13-
pytestmark = pytest.mark.asyncio
14-
1513

1614
@pytest.mark.onlynoncluster
1715
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")

tests/test_asyncio/test_connection_pool.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
from .compat import mock
1818
from .test_pubsub import wait_for_message
1919

20-
pytestmark = pytest.mark.asyncio
21-
2220

2321
@pytest.mark.onlynoncluster
2422
class TestRedisAutoReleaseConnectionPool:

tests/test_asyncio/test_encoding.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
import redis.asyncio as redis
1111
from redis.exceptions import DataError
1212

13-
pytestmark = pytest.mark.asyncio
14-
1513

1614
@pytest.mark.onlynoncluster
1715
class TestEncoding:

tests/test_asyncio/test_json.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
from redis.commands.json.path import Path
66
from tests.conftest import skip_ifmodversion_lt
77

8-
pytestmark = pytest.mark.asyncio
9-
108

119
@pytest.mark.redismod
1210
async def test_json_setbinarykey(modclient: redis.Redis):

tests/test_asyncio/test_lock.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from redis.asyncio.lock import Lock
1212
from redis.exceptions import LockError, LockNotOwnedError
1313

14-
pytestmark = pytest.mark.asyncio
15-
1614

1715
@pytest.mark.onlynoncluster
1816
class TestLock:

tests/test_asyncio/test_monitor.py

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

55
from .conftest import wait_for_command
66

7-
pytestmark = pytest.mark.asyncio
8-
97

108
@pytest.mark.onlynoncluster
119
class TestMonitor:

tests/test_asyncio/test_pipeline.py

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

66
from .conftest import wait_for_command
77

8-
pytestmark = pytest.mark.asyncio
9-
108

119
class TestPipeline:
1210
@pytest.mark.onlynoncluster

tests/test_asyncio/test_pubsub.py

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

1919
from .compat import mock
2020

21-
pytestmark = pytest.mark.asyncio(forbid_global_loop=True)
22-
2321

2422
def with_timeout(t):
2523
def wrapper(corofunc):

tests/test_asyncio/test_search.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@
1818
from redis.commands.search.suggestion import Suggestion
1919
from tests.conftest import skip_ifmodversion_lt
2020

21-
pytestmark = pytest.mark.asyncio
22-
23-
2421
WILL_PLAY_TEXT = os.path.abspath(
2522
os.path.join(os.path.dirname(__file__), "testdata", "will_play_text.csv.bz2")
2623
)

tests/test_asyncio/test_sentinel.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
SlaveNotFoundError,
1818
)
1919

20-
pytestmark = pytest.mark.asyncio
21-
2220

2321
@pytest_asyncio.fixture(scope="module")
2422
def master_ip(master_host):

tests/test_asyncio/test_timeseries.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import redis.asyncio as redis
77
from tests.conftest import skip_ifmodversion_lt
88

9-
pytestmark = pytest.mark.asyncio
10-
119

1210
@pytest.mark.redismod
1311
async def test_create(modclient: redis.Redis):

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ markers =
99
asyncio: marker for async tests
1010
replica: replica tests
1111
experimental: run only experimental tests
12+
asyncio_mode = auto
1213

1314
[tox]
1415
minversion = 3.2.0

0 commit comments

Comments
 (0)