mirror of https://github.com/pypa/pip
work around to always remove temp files/dirs the test function creates
This commit is contained in:
parent
11cc0b658b
commit
ec76495f2c
|
@ -69,7 +69,14 @@ def test_config_file_override_stack():
|
||||||
local, overriding all with a command line flag).
|
local, overriding all with a command line flag).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
f, config_file = tempfile.mkstemp('-pip.cfg', 'test-')
|
try:
|
||||||
|
_, config_file = tempfile.mkstemp('-pip.cfg', 'test-')
|
||||||
|
_test_config_file_override_stack(config_file)
|
||||||
|
finally:
|
||||||
|
os.remove(config_file)
|
||||||
|
|
||||||
|
|
||||||
|
def _test_config_file_override_stack(config_file):
|
||||||
environ = clear_environ(os.environ.copy())
|
environ = clear_environ(os.environ.copy())
|
||||||
environ['PIP_CONFIG_FILE'] = config_file # set this to make pip load it
|
environ['PIP_CONFIG_FILE'] = config_file # set this to make pip load it
|
||||||
reset_env(environ)
|
reset_env(environ)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import textwrap
|
import textwrap
|
||||||
import sys
|
import sys
|
||||||
|
import shutil
|
||||||
from os.path import join
|
from os.path import join
|
||||||
from tempfile import mkdtemp
|
from tempfile import mkdtemp
|
||||||
from test_pip import reset_env, run_pip, assert_all_changes, write_file
|
from test_pip import reset_env, run_pip, assert_all_changes, write_file
|
||||||
|
@ -89,7 +90,15 @@ def test_uninstall_editable_with_source_outside_venv():
|
||||||
Test uninstalling editable install from existing source outside the venv.
|
Test uninstalling editable install from existing source outside the venv.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
tmpdir = join(mkdtemp(), 'virtualenv')
|
try:
|
||||||
|
temp = mkdtemp()
|
||||||
|
tmpdir = join(temp, 'virtualenv')
|
||||||
|
_test_uninstall_editable_with_source_outside_venv(tmpdir)
|
||||||
|
finally:
|
||||||
|
shutil.rmtree(temp)
|
||||||
|
|
||||||
|
|
||||||
|
def _test_uninstall_editable_with_source_outside_venv(tmpdir):
|
||||||
env = reset_env()
|
env = reset_env()
|
||||||
result = env.run('hg', 'clone', local_repo('hg+http://bitbucket.org/ianb/virtualenv'), tmpdir)
|
result = env.run('hg', 'clone', local_repo('hg+http://bitbucket.org/ianb/virtualenv'), tmpdir)
|
||||||
result2 = run_pip('install', '-e', tmpdir)
|
result2 = run_pip('install', '-e', tmpdir)
|
||||||
|
|
Loading…
Reference in New Issue