diff --git a/test-requirements.txt b/test-requirements.txt index 9d8c11c..603325c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,5 @@ pytest requests-mock -mock +mock;python_version < '3.3' bandit==1.7.5;python_version > '3' responses \ No newline at end of file diff --git a/tests/test_purge.py b/tests/test_purge.py index b11ef19..8d40789 100644 --- a/tests/test_purge.py +++ b/tests/test_purge.py @@ -1,6 +1,5 @@ import pytest import requests_mock -import mock import responses try: @@ -8,6 +7,11 @@ except ImportError: from monotonic import monotonic +try: + from unittest.mock import patch +except ImportError: + from mock import patch + from fastpurge import FastPurgeClient, FastPurgeError # pylint: disable=unused-argument @@ -41,7 +45,7 @@ def requests_mocker(): def no_thread_retries(): """Suppress retries for the duration of this fixture.""" - with mock.patch('more_executors.retry.ExceptionRetryPolicy') as policy_class: + with patch('more_executors.retry.ExceptionRetryPolicy') as policy_class: policy = policy_class.return_value policy.should_retry.return_value = False policy.sleep_time.return_value = 0.1