summaryrefslogtreecommitdiff
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-07-30 08:11:33 -0400
committerJason R. Coombs <jaraco@jaraco.com>2016-07-30 08:11:33 -0400
commit849b034ac5440def5327172fa799fbbb3d40db98 (patch)
treed01df07c0c45353da0c58b8e15b5f99893c3811c /setuptools/tests
parent15e0f14c1a7275a944c8c0c3f0f0e4badefa646a (diff)
downloadpython-setuptools-git-849b034ac5440def5327172fa799fbbb3d40db98.tar.gz
Don't rely on mock in the plugin
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/fixtures.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py
index c70c38cb..1e81ee26 100644
--- a/setuptools/tests/fixtures.py
+++ b/setuptools/tests/fixtures.py
@@ -1,22 +1,18 @@
-try:
- from unittest import mock
-except ImportError:
- import mock
import pytest
from . import contexts
@pytest.yield_fixture
-def user_override():
+def user_override(monkeypatch):
"""
Override site.USER_BASE and site.USER_SITE with temporary directories in
a context.
"""
with contexts.tempdir() as user_base:
- with mock.patch('site.USER_BASE', user_base):
+ monkeypatch.setattr('site.USER_BASE', user_base)
with contexts.tempdir() as user_site:
- with mock.patch('site.USER_SITE', user_site):
+ monkeypatch.setattr('site.USER_SITE', user_site)
with contexts.save_user_site_setting():
yield