Skip to content

Commit 336adff

Browse files
committed
Replace @flaky.flaky decorate with pytest marker
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 <[email protected]>
1 parent 56e2478 commit 336adff

File tree

4 files changed

+5
-9
lines changed

4 files changed

+5
-9
lines changed

tests/services/kernels/test_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import jupyter_client
88
import pytest
99
import tornado
10-
from flaky import flaky
1110
from jupyter_client.kernelspec import NATIVE_KERNEL_NAME
1211
from tornado.httpclient import HTTPClientError
1312

@@ -257,7 +256,7 @@ async def test_kernel_handler_startup_error_pending(
257256
await jp_ws_fetch("api", "kernels", kid, "channels")
258257

259258

260-
@flaky
259+
@pytest.mark.flaky
261260
@pytest.mark.timeout(TEST_TIMEOUT)
262261
async def test_connection(jp_fetch, jp_ws_fetch, jp_http_port, jp_auth_header):
263262
# Create kernel

tests/services/kernels/test_execution_state.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import jupyter_client
1111
import pytest
12-
from flaky import flaky
1312
from tornado.httpclient import HTTPClientError
1413
from traitlets.config import Config
1514

@@ -18,7 +17,7 @@
1817
MINIMUM_CONSISTENT_COUNT = 4
1918

2019

21-
@flaky
20+
@pytest.mark.flaky
2221
async def test_execution_state(jp_fetch, jp_ws_fetch):
2322
r = await jp_fetch("api", "kernels", method="POST", allow_nonstandard_methods=True)
2423
kernel = json.loads(r.body.decode())

tests/services/sessions/test_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import jupyter_client
1010
import pytest
1111
import tornado
12-
from flaky import flaky
1312
from jupyter_client.ioloop import AsyncIOLoopKernelManager
1413
from nbformat import writes
1514
from nbformat.v4 import new_notebook
@@ -505,7 +504,7 @@ async def test_modify_kernel_id(session_client, jp_fetch, jp_serverapp, session_
505504
assert kernel_list == [kernel]
506505

507506

508-
@flaky
507+
@pytest.mark.flaky
509508
@pytest.mark.timeout(TEST_TIMEOUT)
510509
async def test_restart_kernel(session_client, jp_base_url, jp_fetch, jp_ws_fetch, session_is_ready):
511510
# Create a session.

tests/test_terminal.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import warnings
88

99
import pytest
10-
from flaky import flaky # type:ignore[import-untyped]
1110
from tornado.httpclient import HTTPClientError
1211
from traitlets.config import Config
1312

@@ -230,7 +229,7 @@ async def test_terminal_create_with_bad_cwd(jp_fetch, jp_ws_fetch):
230229
assert non_existing_path not in message_stdout
231230

232231

233-
@flaky
232+
@pytest.mark.flaky
234233
def test_culling_config(jp_server_config, jp_configurable_serverapp):
235234
app = jp_configurable_serverapp()
236235
terminal_mgr_config = app.config.ServerApp.TerminalManager
@@ -242,7 +241,7 @@ def test_culling_config(jp_server_config, jp_configurable_serverapp):
242241
assert terminal_mgr_settings.cull_interval == CULL_INTERVAL
243242

244243

245-
@flaky
244+
@pytest.mark.flaky
246245
async def test_culling(jp_server_config, jp_fetch):
247246
# POST request
248247
resp = await jp_fetch(

0 commit comments

Comments
 (0)