Skip to content

Commit de8dc7d

Browse files
committed
Make the mock dependency optional
Since Python 3.3 unittest contains the mock module, deprecating the seperate mock module.
1 parent 0f9e2e2 commit de8dc7d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

requirements-dev.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
coverage
44
flake8
5-
mock
5+
mock; python_version < '3.3'
66
pytest
7-
tox
7+
tox

tests/nodeenv_test.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import sys
88
import sysconfig
99

10-
import mock
10+
try:
11+
from unittest import mock
12+
except ImportError:
13+
import mock
1114
import pytest
1215

1316
import nodeenv

tests/test_install_activate.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import sys
22
import os
33

4-
import mock
4+
try:
5+
from unittest import mock
6+
except ImportError:
7+
import mock
58
import pytest
69

710
import nodeenv

0 commit comments

Comments
 (0)