Show More
@@ -59,6 +59,7 b' from IPython.utils.importstring import import_item' | |||||
59 | from IPython.utils.path import get_ipython_module_path, get_ipython_package_dir |
|
59 | from IPython.utils.path import get_ipython_module_path, get_ipython_package_dir | |
60 | from IPython.utils.process import find_cmd, pycmd2argv |
|
60 | from IPython.utils.process import find_cmd, pycmd2argv | |
61 | from IPython.utils.sysinfo import sys_info |
|
61 | from IPython.utils.sysinfo import sys_info | |
|
62 | from IPython.utils.tempdir import TemporaryDirectory | |||
62 | from IPython.utils.warn import warn |
|
63 | from IPython.utils.warn import warn | |
63 |
|
64 | |||
64 | from IPython.testing import globalipapp |
|
65 | from IPython.testing import globalipapp | |
@@ -374,15 +375,18 b' class IPTester(object):' | |||||
374 | self.processes = [] |
|
375 | self.processes = [] | |
375 |
|
376 | |||
376 | def _run_cmd(self): |
|
377 | def _run_cmd(self): | |
377 | # print >> sys.stderr, '*** CMD:', ' '.join(self.call_args) # dbg |
|
378 | with TemporaryDirectory() as IPYTHONDIR: | |
378 | subp = subprocess.Popen(self.call_args) |
|
379 | env = os.environ.copy() | |
379 | self.processes.append(subp) |
|
380 | env['IPYTHONDIR'] = IPYTHONDIR | |
380 | # If this fails, the process will be left in self.processes and cleaned |
|
381 | # print >> sys.stderr, '*** CMD:', ' '.join(self.call_args) # dbg | |
381 | # up later, but if the wait call succeeds, then we can clear the |
|
382 | subp = subprocess.Popen(self.call_args, env=env) | |
382 | # stored process. |
|
383 | self.processes.append(subp) | |
383 | retcode = subp.wait() |
|
384 | # If this fails, the process will be left in self.processes and | |
384 | self.processes.pop() |
|
385 | # cleaned up later, but if the wait call succeeds, then we can | |
385 | return retcode |
|
386 | # clear the stored process. | |
|
387 | retcode = subp.wait() | |||
|
388 | self.processes.pop() | |||
|
389 | return retcode | |||
386 |
|
390 | |||
387 | def run(self): |
|
391 | def run(self): | |
388 | """Run the stored commands""" |
|
392 | """Run the stored commands""" |
General Comments 0
You need to be logged in to leave comments.
Login now