Skip to content

Commit

Permalink
Use pytest-asyncio in auto mode
Browse files Browse the repository at this point in the history
Remove overly genereric `pytestmark=pytest.mark.asyncio` causing lots of warning noise
  • Loading branch information
kristjanvalur committed Jun 28, 2022
1 parent e6cd4fd commit ebcd7d1
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 30 deletions.
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_bloom.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from redis.exceptions import ModuleError, RedisError
from redis.utils import HIREDIS_AVAILABLE

pytestmark = pytest.mark.asyncio


def intlist(obj):
return [int(v) for v in obj]
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
skip_unless_arch_bits,
)

pytestmark = pytest.mark.asyncio

default_host = "127.0.0.1"
default_port = 7000
default_cluster_slots = [
Expand Down
3 changes: 0 additions & 3 deletions tests/test_asyncio/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
REDIS_6_VERSION = "5.9.0"


pytestmark = pytest.mark.asyncio


@pytest_asyncio.fixture()
async def slowlog(r: redis.Redis, event_loop):
current_config = await r.config_get()
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

from .compat import mock

pytestmark = pytest.mark.asyncio


@pytest.mark.onlynoncluster
@pytest.mark.skipif(HIREDIS_AVAILABLE, reason="PythonParser only")
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
from .compat import mock
from .test_pubsub import wait_for_message

pytestmark = pytest.mark.asyncio


@pytest.mark.onlynoncluster
class TestRedisAutoReleaseConnectionPool:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import redis.asyncio as redis
from redis.exceptions import DataError

pytestmark = pytest.mark.asyncio


@pytest.mark.onlynoncluster
class TestEncoding:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from redis.commands.json.path import Path
from tests.conftest import skip_ifmodversion_lt

pytestmark = pytest.mark.asyncio


@pytest.mark.redismod
async def test_json_setbinarykey(modclient: redis.Redis):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
from redis.asyncio.lock import Lock
from redis.exceptions import LockError, LockNotOwnedError

pytestmark = pytest.mark.asyncio


@pytest.mark.onlynoncluster
class TestLock:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from .conftest import wait_for_command

pytestmark = pytest.mark.asyncio


@pytest.mark.onlynoncluster
class TestMonitor:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

from .conftest import wait_for_command

pytestmark = pytest.mark.asyncio


class TestPipeline:
@pytest.mark.onlynoncluster
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

from .compat import mock

pytestmark = pytest.mark.asyncio(forbid_global_loop=True)


def with_timeout(t):
def wrapper(corofunc):
Expand Down
3 changes: 0 additions & 3 deletions tests/test_asyncio/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
from redis.commands.search.suggestion import Suggestion
from tests.conftest import skip_ifmodversion_lt

pytestmark = pytest.mark.asyncio


WILL_PLAY_TEXT = os.path.abspath(
os.path.join(os.path.dirname(__file__), "testdata", "will_play_text.csv.bz2")
)
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_sentinel.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
SlaveNotFoundError,
)

pytestmark = pytest.mark.asyncio


@pytest_asyncio.fixture(scope="module")
def master_ip(master_host):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_asyncio/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import redis.asyncio as redis
from tests.conftest import skip_ifmodversion_lt

pytestmark = pytest.mark.asyncio


@pytest.mark.redismod
async def test_create(modclient: redis.Redis):
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ markers =
asyncio: marker for async tests
replica: replica tests
experimental: run only experimental tests
asyncio_mode = auto

[tox]
minversion = 3.2.0
Expand Down

0 comments on commit ebcd7d1

Please sign in to comment.