From 849b034ac5440def5327172fa799fbbb3d40db98 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 30 Jul 2016 08:11:33 -0400 Subject: Don't rely on mock in the plugin --- setuptools/tests/fixtures.py | 10 +++------- 1 file 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 -- cgit v1.2.3