diff --git a/ipykernel/tests/test_kernel.py b/ipykernel/tests/test_kernel.py index 5b9b26682..e6af1e2d2 100644 --- a/ipykernel/tests/test_kernel.py +++ b/ipykernel/tests/test_kernel.py @@ -6,6 +6,7 @@ import ast import io import os.path +import subprocess import sys import time from tempfile import TemporaryDirectory @@ -14,7 +15,6 @@ import pytest from packaging import version -from IPython.testing import tools as tt import IPython from IPython.paths import locate_profile @@ -242,7 +242,12 @@ def test_smoke_faulthandler(): def test_help_output(): """ipython kernel --help-all works""" - tt.help_all_output_test('kernel') + cmd = [sys.executable, "-m", "IPython", "kernel", "--help-all"] + proc = subprocess.run(cmd, timeout=30, capture_output=True) + assert proc.returncode == 0, proc.stderr + assert b"Traceback" not in proc.stderr + assert b"Options" in proc.stdout + assert b"Class" in proc.stdout def test_is_complete(): diff --git a/ipykernel/tests/utils.py b/ipykernel/tests/utils.py index 6319c2144..daeccf64d 100644 --- a/ipykernel/tests/utils.py +++ b/ipykernel/tests/utils.py @@ -13,8 +13,6 @@ from queue import Empty from subprocess import STDOUT -import nose - from jupyter_client import manager @@ -32,8 +30,9 @@ def start_new_kernel(**kwargs): """ kwargs['stderr'] = STDOUT try: + import nose kwargs['stdout'] = nose.iptest_stdstreams_fileno() - except AttributeError: + except (ImportError, AttributeError): pass return manager.start_new_kernel(startup_timeout=STARTUP_TIMEOUT, **kwargs) @@ -145,8 +144,9 @@ def new_kernel(argv=None): """ kwargs = {'stderr': STDOUT} try: + import nose kwargs['stdout'] = nose.iptest_stdstreams_fileno() - except AttributeError: + except (ImportError, AttributeError): pass if argv is not None: kwargs['extra_arguments'] = argv diff --git a/setup.py b/setup.py index db5830a96..fc2828660 100644 --- a/setup.py +++ b/setup.py @@ -76,7 +76,6 @@ def run(self): "pytest !=5.3.4", "pytest-cov", "flaky", - "nose", # nose because we are still using nose streams from ipython "ipyparallel", ], },