diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2016-02-19 09:36:13 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-02-19 09:36:13 -0500 |
commit | 24cc60e8ded40d5cdfedc79c85dc778d80f688a8 (patch) | |
tree | c9a3f698db3073dc51a029caece79416cd4fad65 /setuptools/tests/test_easy_install.py | |
parent | e5f397829451be329a91838275977cebac45375d (diff) | |
download | external_python_setuptools-24cc60e8ded40d5cdfedc79c85dc778d80f688a8.tar.gz external_python_setuptools-24cc60e8ded40d5cdfedc79c85dc778d80f688a8.tar.bz2 external_python_setuptools-24cc60e8ded40d5cdfedc79c85dc778d80f688a8.zip |
Use pytest tmpdir fixture for simplicity and clarity.
Diffstat (limited to 'setuptools/tests/test_easy_install.py')
-rw-r--r-- | setuptools/tests/test_easy_install.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 07d8a3c5..9dacd8e0 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -59,17 +59,13 @@ SETUP_PY = DALS(""" class TestEasyInstallTest: - def test_install_site_py(self): + def test_install_site_py(self, tmpdir): dist = Distribution() cmd = ei.easy_install(dist) cmd.sitepy_installed = False - cmd.install_dir = tempfile.mkdtemp() - try: - cmd.install_site_py() - sitepy = os.path.join(cmd.install_dir, 'site.py') - assert os.path.exists(sitepy) - finally: - shutil.rmtree(cmd.install_dir) + cmd.install_dir = str(tmpdir) + cmd.install_site_py() + assert (tmpdir / 'site.py').exists() def test_get_script_args(self): header = ei.CommandSpec.best().from_environment().as_header() |