From ef6d9695ffa3a4b70a484ccb5d9f00f4370c71a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 24 Jul 2025 12:18:30 +0200 Subject: [PATCH] Replace `@flaky.flaky` decorate with pytest marker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the `@pytest.mark.flaky` marker in place of the `@flaky.flaky` decorator, to modernize the code and improve compatibility with other plugins providing the feature such as `pytest-rerunfailures`. Signed-off-by: Michał Górny --- tests/test_client.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_client.py b/tests/test_client.py index 3bf06d8..00f115f 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -19,7 +19,6 @@ import nbformat import pytest import xmltodict -from flaky import flaky # type:ignore[import-untyped] from jupyter_client._version import version_info from jupyter_client.client import KernelClient from jupyter_client.kernelspec import KernelSpecManager @@ -354,7 +353,7 @@ def test_run_all_notebooks(input_name, opts): assert_notebooks_equal(input_nb, output_nb) -@flaky +@pytest.mark.flaky def test_parallel_notebooks(capfd, tmpdir): """Two notebooks should be able to be run simultaneously without problems. @@ -380,7 +379,7 @@ def test_parallel_notebooks(capfd, tmpdir): assert filter_messages_on_error_output(captured.err) == "" -@flaky +@pytest.mark.flaky @pytest.mark.skipif(os.name == "nt", reason="warns about event loop on Windows") def test_many_parallel_notebooks(capfd): """Ensure that when many IPython kernels are run in parallel, nothing awful happens. @@ -408,7 +407,7 @@ def test_many_parallel_notebooks(capfd): assert filter_messages_on_error_output(captured.err) == "" -@flaky +@pytest.mark.flaky def test_async_parallel_notebooks(capfd, tmpdir): """Two notebooks should be able to be run simultaneously without problems. @@ -435,7 +434,7 @@ async def run_tasks(): assert filter_messages_on_error_output(captured.err) == "" -@flaky +@pytest.mark.flaky def test_many_async_parallel_notebooks(capfd): """Ensure that when many IPython kernels are run in parallel, nothing awful happens. @@ -673,7 +672,7 @@ def test_sync_kernel_manager(self): assert info_msg is not None assert "name" in info_msg["content"]["language_info"] - @flaky + @pytest.mark.flaky def test_kernel_death_after_timeout(self): """Check that an error is raised when the kernel is_alive is false after a cell timed out""" filename = os.path.join(current_dir, "files", "Interrupt.ipynb")