Skip to content

Commit

Permalink
Removing unnecessary check
Browse files Browse the repository at this point in the history
  • Loading branch information
IlianIliev committed Nov 13, 2024
1 parent 00f5be4 commit adaa3a2
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* No longer necessary check remove from tests
* Move doctests (doc code examples) to main branch
* Update `ResponseT` type hint
* Allow to control the minimum SSL version
Expand Down
6 changes: 0 additions & 6 deletions tests/test_asyncio/compat.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import asyncio
from unittest import mock

try:
mock.AsyncMock
except AttributeError:
from unittest import mock

try:
from contextlib import aclosing
Expand Down
3 changes: 1 addition & 2 deletions tests/test_asyncio/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import random
from contextlib import asynccontextmanager as _asynccontextmanager
from typing import Union
from unittest import mock

import pytest
import pytest_asyncio
Expand All @@ -13,8 +14,6 @@
from redis.backoff import NoBackoff
from tests.conftest import REDIS_INFO

from .compat import mock


async def _get_info(redis_url):
client = redis.Redis.from_url(redis_url)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_asyncio/test_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ssl
import warnings
from typing import Any, Awaitable, Callable, Dict, List, Optional, Type, Union
from unittest import mock
from urllib.parse import urlparse

import pytest
Expand Down Expand Up @@ -39,7 +40,7 @@
)

from ..ssl_utils import get_ssl_filename
from .compat import aclosing, mock
from .compat import aclosing

pytestmark = pytest.mark.onlycluster

Expand Down
2 changes: 1 addition & 1 deletion tests/test_asyncio/test_connection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import asyncio
import socket
import types
from unittest import mock
from unittest.mock import patch

import pytest
Expand All @@ -24,7 +25,6 @@
from redis.utils import HIREDIS_AVAILABLE
from tests.conftest import skip_if_server_version_lt

from .compat import mock
from .mocks import MockStream


Expand Down
3 changes: 2 additions & 1 deletion tests/test_asyncio/test_connection_pool.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import asyncio
import re
from unittest import mock

import pytest
import pytest_asyncio
import redis.asyncio as redis
from redis.asyncio.connection import Connection, to_bool
from tests.conftest import skip_if_redis_enterprise, skip_if_server_version_lt

from .compat import aclosing, mock
from .compat import aclosing
from .conftest import asynccontextmanager
from .test_pubsub import wait_for_message

Expand Down
4 changes: 3 additions & 1 deletion tests/test_asyncio/test_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from unittest import mock

import pytest
import redis
from tests.conftest import skip_if_server_version_lt

from .compat import aclosing, mock
from .compat import aclosing
from .conftest import wait_for_command


Expand Down
4 changes: 3 additions & 1 deletion tests/test_asyncio/test_pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
else:
from async_timeout import timeout as async_timeout

from unittest import mock

import pytest
import pytest_asyncio
import redis.asyncio as redis
Expand All @@ -20,7 +22,7 @@
from redis.utils import HIREDIS_AVAILABLE
from tests.conftest import get_protocol_version, skip_if_server_version_lt

from .compat import aclosing, create_task, mock
from .compat import aclosing, create_task


def with_timeout(t):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_asyncio/test_sentinel_managed_connection.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import socket
from unittest import mock

import pytest
from redis.asyncio.retry import Retry
from redis.asyncio.sentinel import SentinelManagedConnection
from redis.backoff import NoBackoff

from .compat import mock

pytestmark = pytest.mark.asyncio


Expand Down

0 comments on commit adaa3a2

Please sign in to comment.