##// END OF EJS Templates
[utils][tests][path] Remove the use of nt...
Samuel Gaist -
Show More
@@ -15,7 +15,7 from os.path import join, abspath
15 15 from imp import reload
16 16
17 17 from nose import SkipTest, with_setup
18 import nose.tools as nt
18 import pytest
19 19
20 20 import IPython
21 21 from IPython import paths
@@ -155,7 +155,7 def test_get_home_dir_5():
155 155 env['HOME'] = abspath(HOME_TEST_DIR+'garbage')
156 156 # set os.name = posix, to prevent My Documents fallback on Windows
157 157 os.name = 'posix'
158 nt.assert_raises(path.HomeDirError, path.get_home_dir, True)
158 pytest.raises(path.HomeDirError, path.get_home_dir, True)
159 159
160 160 # Should we stub wreg fully so we can run the test on all platforms?
161 161 @skip_if_not_win32
@@ -237,8 +237,7 def test_get_xdg_dir_3():
237 237 env.pop('IPYTHONDIR', None)
238 238 env.pop('XDG_CONFIG_HOME', None)
239 239 cfgdir=os.path.join(path.get_home_dir(), '.config')
240 if not os.path.exists(cfgdir):
241 os.makedirs(cfgdir)
240 os.makedirs(cfgdir, exist_ok=True)
242 241
243 242 assert path.get_xdg_dir() is None
244 243
@@ -305,15 +304,15 def test_get_py_filename():
305 304 assert path.get_py_filename("foo") == "foo.py"
306 305 with make_tempfile("foo"):
307 306 assert path.get_py_filename("foo") == "foo"
308 nt.assert_raises(IOError, path.get_py_filename, "foo.py")
309 nt.assert_raises(IOError, path.get_py_filename, "foo")
310 nt.assert_raises(IOError, path.get_py_filename, "foo.py")
307 pytest.raises(IOError, path.get_py_filename, "foo.py")
308 pytest.raises(IOError, path.get_py_filename, "foo")
309 pytest.raises(IOError, path.get_py_filename, "foo.py")
311 310 true_fn = "foo with spaces.py"
312 311 with make_tempfile(true_fn):
313 312 assert path.get_py_filename("foo with spaces") == true_fn
314 313 assert path.get_py_filename("foo with spaces.py") == true_fn
315 nt.assert_raises(IOError, path.get_py_filename, '"foo with spaces.py"')
316 nt.assert_raises(IOError, path.get_py_filename, "'foo with spaces.py'")
314 pytest.raises(IOError, path.get_py_filename, '"foo with spaces.py"')
315 pytest.raises(IOError, path.get_py_filename, "'foo with spaces.py'")
317 316
318 317 @onlyif_unicode_paths
319 318 def test_unicode_in_filename():
@@ -414,7 +413,7 def test_ensure_dir_exists():
414 413 path.ensure_dir_exists(d) # no-op
415 414 f = os.path.join(td, 'ƒile')
416 415 open(f, 'w').close() # touch
417 with nt.assert_raises(IOError):
416 with pytest.raises(IOError):
418 417 path.ensure_dir_exists(f)
419 418
420 419 class TestLinkOrCopy(unittest.TestCase):
General Comments 0
You need to be logged in to leave comments. Login now