Use unittest.mock instead of mock (#1673)

This module has been included in Python itself since 3.3.

Fixes: https://github.com/rq/rq/issues/1646
main
Hugo 2 years ago committed by GitHub
parent 87bacb650e
commit 61a4a1720b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,4 @@
codecov
mock
psutil
pytest
pytest-cov

@ -2,7 +2,7 @@
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import mock
from unittest import mock
from redis import Redis
from rq.decorators import job

@ -5,7 +5,7 @@ from __future__ import (absolute_import, division, print_function,
import json
from datetime import datetime, timedelta, timezone
from rq.serializers import DefaultSerializer, JSONSerializer
from mock.mock import patch
from unittest.mock import patch
from rq import Retry, Queue
from rq.job import Job, JobStatus

@ -2,7 +2,7 @@ import os
from datetime import datetime, timedelta, timezone
from multiprocessing import Process
import mock
from unittest import mock
from rq import Queue
from rq.compat import PY2
from rq.exceptions import NoSuchJobError

@ -11,7 +11,7 @@ from rq.worker import SimpleWorker
from tests import RQTestCase
from tests.fixtures import div_by_zero
import mock
from unittest import mock
from click.testing import CliRunner

@ -3,7 +3,7 @@ from __future__ import (absolute_import, division, print_function,
unicode_literals)
import re
import datetime
import mock
from unittest import mock
from redis import Redis

@ -20,8 +20,8 @@ from unittest import skipIf
import redis.exceptions
import pytest
import mock
from mock import Mock
from unittest import mock
from unittest.mock import Mock
from tests import RQTestCase, slow
from tests.fixtures import (

@ -1,6 +1,6 @@
from rq.utils import ceildiv
from tests import RQTestCase
from mock.mock import patch
from unittest.mock import patch
from rq import Queue, Worker
from rq.worker_registration import (clean_worker_registry, get_keys, register,

@ -6,7 +6,6 @@ commands=pytest --cov rq --durations=5 {posargs}
deps=
pytest
pytest-cov
mock
[testenv:flake8]
basepython = python3.6

Loading…
Cancel
Save