From 88d2ced99afc77004a1fb765af0d1d4404470cd0 2021-10-23 14:51:03 From: Samuel Gaist Date: 2021-10-23 14:51:03 Subject: [PATCH] [utils][tests][process] Remove nose --- diff --git a/IPython/utils/tests/test_process.py b/IPython/utils/tests/test_process.py index c53999e..f4ee385 100644 --- a/IPython/utils/tests/test_process.py +++ b/IPython/utils/tests/test_process.py @@ -20,9 +20,8 @@ import os import time from _thread import interrupt_main # Py 3 import threading -from unittest import SkipTest -import nose.tools as nt +import pytest from IPython.utils.process import (find_cmd, FindCmdError, arg_split, system, getoutput, getoutputerror, @@ -41,8 +40,8 @@ python = os.path.basename(sys.executable) @dec.skip_win32 def test_find_cmd_ls(): """Make sure we can find the full path to ls.""" - path = find_cmd('ls') - nt.assert_true(path.endswith('ls')) + path = find_cmd("ls") + assert path.endswith("ls") def has_pywin32(): @@ -64,7 +63,7 @@ def test_find_cmd_pythonw(): "This test runs on posix or in win32 with win32api installed") def test_find_cmd_fail(): """Make sure that FindCmdError is raised if we can't find the cmd.""" - nt.assert_raises(FindCmdError,find_cmd,'asdfasdf') + pytest.raises(FindCmdError, find_cmd, "asdfasdf") # TODO: move to pytest.mark.parametrize once nose gone @@ -121,7 +120,7 @@ class SubProcessTestCase(tt.TempFileMixin): Interrupt a subprocess after a second. """ if threading.main_thread() != threading.current_thread(): - raise nt.SkipTest("Can't run this test if not in main thread.") + raise pytest.skip("Can't run this test if not in main thread.") # Some tests can overwrite SIGINT handler (by using pdb for example), # which then breaks this test, so just make sure it's operating