Skip to content

Commit 861de1e

Browse files
authored
feat: Use Python's unittest mock (#289)
Since 3.3 Python unittest module supports mock and the seperate mock module is deprecated.
1 parent fe52df1 commit 861de1e

8 files changed

Lines changed: 6 additions & 8 deletions

dev_requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
tox
88
pytest-cov
99
pytest
10-
mock
1110
cherrypy
1211
sphinx
1312
redis

tests/test_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
import mock
5+
from unittest import mock
66
import pytest
77

88
from requests import Session

tests/test_cache_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Unit tests that verify our caching methods work correctly.
77
"""
88
import pytest
9-
from mock import ANY, Mock
9+
from unittest.mock import ANY, Mock
1010
import time
1111
from tempfile import mkdtemp
1212

tests/test_etag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import pytest
88

9-
from mock import Mock, patch
9+
from unittest.mock import Mock, patch
1010

1111
import requests
1212

tests/test_expires_heuristics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from email.utils import formatdate, parsedate
99
from datetime import datetime
1010

11-
from mock import Mock
11+
from unittest.mock import Mock
1212
from requests import Session, get
1313

1414
from cachecontrol import CacheControl

tests/test_serialization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import msgpack
66
import requests
77

8-
from mock import Mock
8+
from unittest.mock import Mock
99

1010
from cachecontrol.compat import pickle
1111
from cachecontrol.serialize import Serializer

tests/test_storage_redis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from datetime import datetime
66

7-
from mock import Mock
7+
from unittest.mock import Mock
88
from cachecontrol.caches import RedisCache
99

1010

tox.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ python =
1515

1616
[testenv]
1717
deps = pytest
18-
mock
1918
cherrypy
2019
redis
2120
filelock

0 commit comments

Comments
 (0)