##// END OF EJS Templates
Make iptest more reliable under Win32....
Fernando Perez -
Show More
@@ -24,6 +24,7 b' import os'
24 import os.path as path
24 import os.path as path
25 import sys
25 import sys
26 import subprocess
26 import subprocess
27 import tempfile
27 import time
28 import time
28 import warnings
29 import warnings
29
30
@@ -190,9 +191,29 b' class IPTester(object):'
190 # Assemble call
191 # Assemble call
191 self.call_args = self.runner+self.params
192 self.call_args = self.runner+self.params
192
193
193 def run(self):
194 if sys.platform == 'win32':
194 """Run the stored commands"""
195 def run(self):
195 return subprocess.call(self.call_args)
196 """Run the stored commands"""
197 # On Windows, cd to temporary directory to run tests. Otherwise,
198 # Twisted's trial may not be able to execute 'trial IPython', since
199 # it will confuse the IPython module name with the ipython
200 # execution scripts, because the windows file system isn't case
201 # sensitive.
202 # We also use os.system instead of subprocess.call, because I was
203 # having problems with subprocess and I just don't know enough
204 # about win32 to debug this reliably. Os.system may be the 'old
205 # fashioned' way to do it, but it works just fine. If someone
206 # later can clean this up that's fine, as long as the tests run
207 # reliably in win32.
208 curdir = os.getcwd()
209 os.chdir(tempfile.gettempdir())
210 stat = os.system(' '.join(self.call_args))
211 os.chdir(curdir)
212 return stat
213 else:
214 def run(self):
215 """Run the stored commands"""
216 return subprocess.call(self.call_args)
196
217
197
218
198 def make_runners():
219 def make_runners():
General Comments 0
You need to be logged in to leave comments. Login now