Files
python-redis/remove-mock.patch
Steve Kowalik e9ff760c35 - Update to 7.0.1: (bsc#1252957)
* New Features
    + Support for maintenance push notifications handling during server
      upgrade or maintenance procedures.
    + Adding WITHATTRIBS option to vector set's vsim command.
    + Adding ssl_verify_flags_config argument for ssl connection
      configuration
    + Adding new ExternalAuthProviderError that will be raised when we
      receive 'problem with LDAP service' response from server.
  * Experimental Features
    + Multi-database client implementation 
  * Breaking changes
    + Adding abstract method declaration for cache property setter in
      EvictionPolicyInterface
    + Removing synchronous context manager handling from async RedisCluster.
    + Removing the threading.Lock locks and replacing them with RLock objects
      to avoid deadlocks.
    + Adding score_cast_func argument to zrank, zrevrank and zunion - for
      consistency with the other sorted sets commands
- Refreshed patch remove-mock.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-redis?expand=0&rev=107
2025-11-03 04:00:08 +00:00

73 lines
2.9 KiB
Diff

From fa9c6df7975a7105d265c7e05cc84391060f9478 Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Mon, 3 Nov 2025 13:56:52 +1100
Subject: [PATCH] Remove last vestiges of mock.mock
With the minimum Python version now being high enough to drop the usage
of the external mock module, switch to unittest.mock everywhere.
---
dev_requirements.txt | 2 --
tests/test_asyncio/test_credentials.py | 2 +-
tests/test_asyncio/test_multidb/test_healthcheck.py | 3 ++-
tests/test_credentials.py | 2 +-
4 files changed, 4 insertions(+), 5 deletions(-)
Index: redis-7.0.1/dev_requirements.txt
===================================================================
--- redis-7.0.1.orig/dev_requirements.txt
+++ redis-7.0.1/dev_requirements.txt
@@ -2,8 +2,6 @@ build
build==1.2.2.post1 ; platform_python_implementation == "PyPy" or python_version < "3.10"
click==8.0.4
invoke==2.2.0
-mock
-mock==5.1.0 ; platform_python_implementation == "PyPy" or python_version < "3.10"
packaging>=20.4
packaging==24.2 ; platform_python_implementation == "PyPy" or python_version < "3.10"
Index: redis-7.0.1/tests/test_asyncio/test_credentials.py
===================================================================
--- redis-7.0.1.orig/tests/test_asyncio/test_credentials.py
+++ redis-7.0.1/tests/test_asyncio/test_credentials.py
@@ -4,11 +4,11 @@ import string
from asyncio import Lock as AsyncLock
from asyncio import sleep as async_sleep
from typing import Optional, Tuple, Union
+from unittest.mock import Mock, call
import pytest
import pytest_asyncio
import redis
-from mock.mock import Mock, call
from redis import AuthenticationError, DataError, RedisError, ResponseError
from redis.asyncio import Connection, ConnectionPool, Redis
from redis.asyncio.retry import Retry
Index: redis-7.0.1/tests/test_asyncio/test_multidb/test_healthcheck.py
===================================================================
--- redis-7.0.1.orig/tests/test_asyncio/test_multidb/test_healthcheck.py
+++ redis-7.0.1/tests/test_asyncio/test_multidb/test_healthcheck.py
@@ -1,5 +1,6 @@
+from unittest.mock import AsyncMock, Mock
+
import pytest
-from mock.mock import AsyncMock, Mock
from redis.asyncio.multidb.database import Database
from redis.asyncio.multidb.healthcheck import (
Index: redis-7.0.1/tests/test_credentials.py
===================================================================
--- redis-7.0.1.orig/tests/test_credentials.py
+++ redis-7.0.1/tests/test_credentials.py
@@ -4,10 +4,10 @@ import string
import threading
from time import sleep
from typing import Optional, Tuple, Union
+from unittest.mock import Mock, call
import pytest
import redis
-from mock.mock import Mock, call
from redis import AuthenticationError, DataError, Redis, ResponseError
from redis.auth.err import RequestTokenErr
from redis.backoff import NoBackoff