Skip to content

Commit 1309925

Browse files
authored
Merge pull request #808 from Kojoley/remove-nose-dependency
Remove Nose dependency
2 parents 54fea2a + 6a727a4 commit 1309925

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
@@ -6,6 +6,7 @@
66
import ast
77
import io
88
import os.path
9+
import subprocess
910
import sys
1011
import time
1112
from tempfile import TemporaryDirectory
@@ -14,7 +15,6 @@
1415
import pytest
1516
from packaging import version
1617

17-
from IPython.testing import tools as tt
1818
import IPython
1919
from IPython.paths import locate_profile
2020

@@ -242,7 +242,12 @@ def test_smoke_faulthandler():
242242

243243
def test_help_output():
244244
"""ipython kernel --help-all works"""
245-
tt.help_all_output_test('kernel')
245+
cmd = [sys.executable, "-m", "IPython", "kernel", "--help-all"]
246+
proc = subprocess.run(cmd, timeout=30, capture_output=True)
247+
assert proc.returncode == 0, proc.stderr
248+
assert b"Traceback" not in proc.stderr
249+
assert b"Options" in proc.stdout
250+
assert b"Class" in proc.stdout
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)