Skip to content

Commit 9a5544e

Browse files
committed
Remove Nose dependency
1 parent 54fea2a commit 9a5544e

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

ipykernel/tests/test_kernel.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import pytest
1515
from packaging import version
1616

17-
from IPython.testing import tools as tt
1817
import IPython
1918
from IPython.paths import locate_profile
2019

@@ -242,7 +241,13 @@ def test_smoke_faulthandler():
242241

243242
def test_help_output():
244243
"""ipython kernel --help-all works"""
245-
tt.help_all_output_test('kernel')
244+
from IPython.utils.process import get_output_error_code
245+
cmd = [sys.executable, "-m", "IPython", "kernel", "--help-all"]
246+
out, err, rc = get_output_error_code(cmd)
247+
assert rc == 0, err
248+
assert "Traceback" not in err
249+
assert "Options" in out
250+
assert "Class" in out
246251

247252

248253
def test_is_complete():

ipykernel/tests/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
from queue import Empty
1414
from subprocess import STDOUT
1515

16-
import nose
17-
1816
from jupyter_client import manager
1917

2018

@@ -32,8 +30,9 @@ def start_new_kernel(**kwargs):
3230
"""
3331
kwargs['stderr'] = STDOUT
3432
try:
33+
import nose
3534
kwargs['stdout'] = nose.iptest_stdstreams_fileno()
36-
except AttributeError:
35+
except (ImportError, AttributeError):
3736
pass
3837
return manager.start_new_kernel(startup_timeout=STARTUP_TIMEOUT, **kwargs)
3938

@@ -145,8 +144,9 @@ def new_kernel(argv=None):
145144
"""
146145
kwargs = {'stderr': STDOUT}
147146
try:
147+
import nose
148148
kwargs['stdout'] = nose.iptest_stdstreams_fileno()
149-
except AttributeError:
149+
except (ImportError, AttributeError):
150150
pass
151151
if argv is not None:
152152
kwargs['extra_arguments'] = argv

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ def run(self):
7676
"pytest !=5.3.4",
7777
"pytest-cov",
7878
"flaky",
79-
"nose", # nose because we are still using nose streams from ipython
8079
"ipyparallel",
8180
],
8281
},

0 commit comments

Comments
 (0)