aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/test_easy_install.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-01 23:53:59 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-01 23:53:59 -0500
commit81be05c12fd45550981d1d2a8a4e452482389376 (patch)
tree4d5e8028a33b065e31e00f612a0ea5d0cc016bde /setuptools/tests/test_easy_install.py
parentbb7a25abe65fba3fa3e8ae3973321f1fedab8e37 (diff)
downloadexternal_python_setuptools-81be05c12fd45550981d1d2a8a4e452482389376.tar.gz
external_python_setuptools-81be05c12fd45550981d1d2a8a4e452482389376.tar.bz2
external_python_setuptools-81be05c12fd45550981d1d2a8a4e452482389376.zip
Replace some setup/teardown code with the fixture.
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r--setuptools/tests/test_easy_install.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py
index 61eb868f..69f42d56 100644
--- a/setuptools/tests/test_easy_install.py
+++ b/setuptools/tests/test_easy_install.py
@@ -133,6 +133,7 @@ class TestPTHFileWriter(unittest.TestCase):
self.assertTrue(not pth.dirty)
+@pytest.mark.usefixtures("user_override")
class TestUserInstallTest:
def setup_method(self, method):
@@ -143,26 +144,17 @@ class TestUserInstallTest:
self.old_cwd = os.getcwd()
os.chdir(self.dir)
- self.old_enable_site = site.ENABLE_USER_SITE
self.old_file = easy_install_pkg.__file__
- self.old_base = site.USER_BASE
- site.USER_BASE = tempfile.mkdtemp()
- self.old_site = site.USER_SITE
- site.USER_SITE = tempfile.mkdtemp()
easy_install_pkg.__file__ = site.USER_SITE
def teardown_method(self, method):
os.chdir(self.old_cwd)
shutil.rmtree(self.dir)
- shutil.rmtree(site.USER_BASE)
- shutil.rmtree(site.USER_SITE)
- site.USER_BASE = self.old_base
- site.USER_SITE = self.old_site
- site.ENABLE_USER_SITE = self.old_enable_site
easy_install_pkg.__file__ = self.old_file
def test_user_install_implied(self):
+ easy_install_pkg.__file__ = site.USER_SITE
site.ENABLE_USER_SITE = True # disabled sometimes
#XXX: replace with something meaningfull
dist = Distribution()