##// END OF EJS Templates
Various fixes for IPython.core tests to pass under win32.
Fernando Perez -
Show More
@@ -141,7 +141,12 b' class TestMagicRunSimple(tt.TempFileMixin):'
141 141 _ip.magic('run "%s"' % self.fname)
142 142 _ip.runlines('t = isinstance(f(), foo)')
143 143 nt.assert_true(_ip.user_ns['t'])
144
144
145 # We have to skip these in win32 because genutils.getoutputerr() crashes,
146 # due to the fact that subprocess does not support close_fds when
147 # redirecting stdout/err. So unless someone who knows more tells us how to
148 # implement genutils.getoutputerr() in win32, we're stuck avoiding these.
149 @dec.skip_win32
145 150 def test_obj_del(self):
146 151 """Test that object's __del__ methods are called on exit."""
147 152
@@ -154,6 +159,7 b' class TestMagicRunSimple(tt.TempFileMixin):'
154 159 self.mktmp(src)
155 160 tt.ipexec_validate(self.fname, 'object A deleted')
156 161
162 @dec.skip_win32
157 163 def test_tclass(self):
158 164 mydir = os.path.dirname(__file__)
159 165 tc = os.path.join(mydir, 'tclass')
@@ -174,7 +174,7 b' def default_argv():'
174 174 ipcdir = os.path.dirname(default.__file__)
175 175 ipconf = os.path.join(ipcdir,'ipython_config.py')
176 176 return ['--colors=NoColor', '--no-term-title','--no-banner',
177 '--config-file=%s' % ipconf, '--autocall=0',
177 '--config-file="%s"' % ipconf, '--autocall=0',
178 178 '--prompt-out=""']
179 179
180 180
@@ -203,9 +203,14 b' def ipexec(fname, options=None):'
203 203
204 204 _ip = get_ipython()
205 205 test_dir = os.path.dirname(__file__)
206 # Find the ipython script from the package we're using, so that the test
207 # suite can be run from the source tree without an installed IPython
208 ipython_package_dir = genutils.get_ipython_package_dir()
209 ipython_script = os.path.join(ipython_package_dir,'scripts','ipython')
210 ipython_cmd = 'python "%s"' % ipython_script
211 # Absolute path for filename
206 212 full_fname = os.path.join(test_dir, fname)
207 ipython_cmd = platutils.find_cmd('ipython')
208 full_cmd = '%s %s %s' % (ipython_cmd, cmdargs, full_fname)
213 full_cmd = '%s %s "%s"' % (ipython_cmd, cmdargs, full_fname)
209 214 return genutils.getoutputerror(full_cmd)
210 215
211 216
@@ -256,11 +261,14 b' class TempFileMixin(object):'
256 261 self.fname = fname
257 262
258 263 def teardown(self):
259 self.tmpfile.close()
260 try:
261 os.unlink(self.fname)
262 except:
263 # On Windows, even though we close the file, we still can't delete
264 # it. I have no clue why
265 pass
264 if hasattr(self, 'tmpfile'):
265 # If the tmpfile wasn't made because of skipped tests, like in
266 # win32, there's nothing to cleanup.
267 self.tmpfile.close()
268 try:
269 os.unlink(self.fname)
270 except:
271 # On Windows, even though we close the file, we still can't
272 # delete it. I have no clue why
273 pass
266 274
General Comments 0
You need to be logged in to leave comments. Login now