Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing unnecessary check #3432

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
@@ -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)
3 changes: 2 additions & 1 deletion tests/test_asyncio/test_cluster.py
Original file line number Diff line number Diff line change
@@ -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
@@ -38,7 +39,7 @@
)

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

pytestmark = pytest.mark.onlycluster

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
@@ -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


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

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


4 changes: 3 additions & 1 deletion tests/test_asyncio/test_pubsub.py
Original file line number Diff line number Diff line change
@@ -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
@@ -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):
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


Loading
Oops, something went wrong.