##// END OF EJS Templates
[utils][tests][process] Remove nose
Samuel Gaist -
Show More
@@ -20,9 +20,8 import os
20 import time
20 import time
21 from _thread import interrupt_main # Py 3
21 from _thread import interrupt_main # Py 3
22 import threading
22 import threading
23 from unittest import SkipTest
24
23
25 import nose.tools as nt
24 import pytest
26
25
27 from IPython.utils.process import (find_cmd, FindCmdError, arg_split,
26 from IPython.utils.process import (find_cmd, FindCmdError, arg_split,
28 system, getoutput, getoutputerror,
27 system, getoutput, getoutputerror,
@@ -41,8 +40,8 python = os.path.basename(sys.executable)
41 @dec.skip_win32
40 @dec.skip_win32
42 def test_find_cmd_ls():
41 def test_find_cmd_ls():
43 """Make sure we can find the full path to ls."""
42 """Make sure we can find the full path to ls."""
44 path = find_cmd('ls')
43 path = find_cmd("ls")
45 nt.assert_true(path.endswith('ls'))
44 assert path.endswith("ls")
46
45
47
46
48 def has_pywin32():
47 def has_pywin32():
@@ -64,7 +63,7 def test_find_cmd_pythonw():
64 "This test runs on posix or in win32 with win32api installed")
63 "This test runs on posix or in win32 with win32api installed")
65 def test_find_cmd_fail():
64 def test_find_cmd_fail():
66 """Make sure that FindCmdError is raised if we can't find the cmd."""
65 """Make sure that FindCmdError is raised if we can't find the cmd."""
67 nt.assert_raises(FindCmdError,find_cmd,'asdfasdf')
66 pytest.raises(FindCmdError, find_cmd, "asdfasdf")
68
67
69
68
70 # TODO: move to pytest.mark.parametrize once nose gone
69 # TODO: move to pytest.mark.parametrize once nose gone
@@ -121,7 +120,7 class SubProcessTestCase(tt.TempFileMixin):
121 Interrupt a subprocess after a second.
120 Interrupt a subprocess after a second.
122 """
121 """
123 if threading.main_thread() != threading.current_thread():
122 if threading.main_thread() != threading.current_thread():
124 raise nt.SkipTest("Can't run this test if not in main thread.")
123 raise pytest.skip("Can't run this test if not in main thread.")
125
124
126 # Some tests can overwrite SIGINT handler (by using pdb for example),
125 # Some tests can overwrite SIGINT handler (by using pdb for example),
127 # which then breaks this test, so just make sure it's operating
126 # which then breaks this test, so just make sure it's operating
General Comments 0
You need to be logged in to leave comments. Login now