summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2015-01-15 23:25:04 +0100
committerArfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com>2015-01-15 23:25:04 +0100
commitf13e11b15882f682e578d02ba31506019163689b (patch)
tree4a56f4a6078ae1c3eec137d7eba464ab785b41e4
parentb157d51fcebb48c8b0f1904f271e5c304e08fed5 (diff)
downloadpython-setuptools-bitbucket-f13e11b15882f682e578d02ba31506019163689b.tar.gz
Use unittest.mock from standard library instead of external mock with Python >=3.3.
-rwxr-xr-xsetup.py3
-rw-r--r--setuptools/tests/fixtures.py5
-rw-r--r--setuptools/tests/test_easy_install.py5
-rw-r--r--setuptools/tests/test_msvc9compiler.py5
4 files changed, 13 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index b4b93b38..63093917 100755
--- a/setup.py
+++ b/setup.py
@@ -170,8 +170,7 @@ setup_params = dict(
tests_require=[
'setuptools[ssl]',
'pytest',
- 'mock',
- ],
+ ] + (['mock'] if sys.version_info[:2] < (3, 3) else []),
setup_requires=[
] + pytest_runner,
)
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py
index 0b1eaf5f..c70c38cb 100644
--- a/setuptools/tests/fixtures.py
+++ b/setuptools/tests/fixtures.py
@@ -1,4 +1,7 @@
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
import pytest
from . import contexts
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 72b040e1..689860c3 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -15,7 +15,10 @@ import logging
import itertools
import pytest
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
from setuptools import sandbox
from setuptools import compat
diff --git a/setuptools/tests/test_msvc9compiler.py b/setuptools/tests/test_msvc9compiler.py
index a0820fff..e54e7a6e 100644
--- a/setuptools/tests/test_msvc9compiler.py
+++ b/setuptools/tests/test_msvc9compiler.py
@@ -7,7 +7,10 @@ import contextlib
import distutils.errors
import pytest
-import mock
+try:
+ from unittest import mock
+except ImportError:
+ import mock
from . import contexts