Skip to content

Commit eb1b4b8

Browse files
committed
tests: Use built-in unittest.mock instead of external mock
A built-in unittest.mock module is available since Python 3.3 that is a drop-in replacement for the external mock package. Since Python 2 is not supported, just use that and remove the dependency.
1 parent 4c25288 commit eb1b4b8

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

mpd/tests.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import warnings
1313

1414
import unittest
15+
from unittest import mock
1516

1617
try:
1718
from twisted.python.failure import Failure
@@ -26,11 +27,6 @@
2627

2728
import asyncio
2829

29-
try:
30-
import mock
31-
except ImportError:
32-
print("Please install mock from PyPI to run tests!")
33-
sys.exit(1)
3430

3531
# show deprecation warnings
3632
warnings.simplefilter("default")

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ def read(fname):
8080
test_suite="mpd.tests",
8181
tests_require=[
8282
'tox',
83-
'mock',
8483
'Twisted'
8584
],
8685
cmdclass={

tox.ini

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
envlist = py36,py37,py38,py39,pypy3
33

44
[testenv]
5-
deps = mock
6-
coverage
5+
deps = coverage
76
Twisted
87
commands = coverage erase
98
coverage run -m unittest mpd.tests

0 commit comments

Comments
 (0)