diff --git a/ipykernel/inprocess/tests/test_kernel.py b/ipykernel/inprocess/tests/test_kernel.py index c2904a006..952c66905 100644 --- a/ipykernel/inprocess/tests/test_kernel.py +++ b/ipykernel/inprocess/tests/test_kernel.py @@ -13,10 +13,10 @@ from ipykernel.inprocess.manager import InProcessKernelManager from ipykernel.inprocess.ipkernel import InProcessKernel from ipykernel.tests.utils import assemble_output -from IPython.testing.decorators import skipif_not_matplotlib from IPython.utils.io import capture_output + def _init_asyncio_patch(): """set default asyncio policy to be compatible with tornado @@ -60,9 +60,9 @@ def setUp(self): self.kc.start_channels() self.kc.wait_for_ready() - @skipif_not_matplotlib def test_pylab(self): """Does %pylab work in the in-process kernel?""" + matplotlib = pytest.importorskip('matplotlib', reason='This test requires matplotlib') kc = self.kc kc.execute('%pylab') out, err = assemble_output(kc.get_iopub_msg) diff --git a/ipykernel/tests/test_kernel.py b/ipykernel/tests/test_kernel.py index 288296680..5b9b26682 100644 --- a/ipykernel/tests/test_kernel.py +++ b/ipykernel/tests/test_kernel.py @@ -14,7 +14,7 @@ import pytest from packaging import version -from IPython.testing import decorators as dec, tools as tt +from IPython.testing import tools as tt import IPython from IPython.paths import locate_profile @@ -225,8 +225,8 @@ def test_save_history(): assert 'b="abcþ"' in content -@dec.skip_without('faulthandler') def test_smoke_faulthandler(): + faulthadler = pytest.importorskip('faulthandler', reason='this test needs faulthandler') with kernel() as kc: # Note: faulthandler.register is not available on windows. code = '\n'.join([ @@ -296,8 +296,8 @@ def test_complete(): assert completed.startswith(cell) -@dec.skip_without('matplotlib') def test_matplotlib_inline_on_import(): + pytest.importorskip('matplotlib', reason='this test requires matplotlib') with kernel() as kc: cell = '\n'.join([ 'import matplotlib, matplotlib.pyplot as plt', diff --git a/setup.py b/setup.py index 26203492d..db5830a96 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,7 @@ def run(self): 'importlib-metadata<5;python_version<"3.8.0"', 'argcomplete>=1.12.3;python_version<"3.8.0"', 'debugpy>=1.0.0,<2.0', - 'ipython>=7.23.1,<8.0', + 'ipython>=7.23.1', 'traitlets>=5.1.0,<6.0', 'jupyter_client<8.0', 'tornado>=4.2,<7.0',