diff options
| -rw-r--r-- | setuptools/tests/fixtures.py | 10 |
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 |
