Skip to content

Commit 37d71f5

Browse files
authored
Merge pull request #556 from mgorny/flaky-mark
PR: Replace `@flaky` decorator with pytest marker
2 parents e6fbd7f + ca8a039 commit 37d71f5

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

spyder_kernels/console/tests/test_console_kernel.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import uuid
2626

2727
# Test imports
28-
from flaky import flaky
2928
from IPython.core import release as ipython_release
3029
from jupyter_core import paths
3130
from jupyter_client import BlockingKernelClient
@@ -512,7 +511,7 @@ def test_output_from_c_libraries(kernel, capsys):
512511
assert captured.out == "Hello from C\n"
513512

514513

515-
@flaky(max_runs=3)
514+
@pytest.mark.flaky(max_runs=3)
516515
def test_cwd_in_sys_path():
517516
"""
518517
Test that cwd stays as the first element in sys.path after the
@@ -550,7 +549,7 @@ def test_prioritize(kernel):
550549
assert new_syspath == prepend_path + syspath
551550

552551

553-
@flaky(max_runs=3)
552+
@pytest.mark.flaky(max_runs=3)
554553
def test_multiprocessing(tmpdir):
555554
"""
556555
Test that multiprocessing works.
@@ -589,7 +588,7 @@ def f(x):
589588
assert content['found']
590589

591590

592-
@flaky(max_runs=3)
591+
@pytest.mark.flaky(max_runs=3)
593592
def test_multiprocessing_2(tmpdir):
594593
"""
595594
Test that multiprocessing works.
@@ -634,7 +633,7 @@ def myFunc(i):
634633
assert "[11, 12, 13]" in content['data']['text/plain']
635634

636635

637-
@flaky(max_runs=3)
636+
@pytest.mark.flaky(max_runs=3)
638637
@pytest.mark.skipif(
639638
sys.platform == 'darwin' and sys.version_info[:2] == (3, 8),
640639
reason="Fails on Mac with Python 3.8")
@@ -681,7 +680,7 @@ def test_dask_multiprocessing(tmpdir):
681680
assert content['found']
682681

683682

684-
@flaky(max_runs=3)
683+
@pytest.mark.flaky(max_runs=3)
685684
def test_runfile(tmpdir):
686685
"""
687686
Test that runfile uses the proper name space for execution.
@@ -756,7 +755,7 @@ def test_runfile(tmpdir):
756755
assert not content['found']
757756

758757

759-
@flaky(max_runs=3)
758+
@pytest.mark.flaky(max_runs=3)
760759
@pytest.mark.skipif(
761760
sys.platform == 'darwin' and sys.version_info[:2] == (3, 8),
762761
reason="Fails on Mac with Python 3.8")
@@ -827,7 +826,7 @@ def test_np_threshold(kernel):
827826
)
828827

829828

830-
@flaky(max_runs=3)
829+
@pytest.mark.flaky(max_runs=3)
831830
@pytest.mark.skipif(
832831
not TURTLE_ACTIVE,
833832
reason="Doesn't work on non-interactive settings or Python without Tk")
@@ -892,7 +891,7 @@ def test_turtle_launch(tmpdir):
892891
assert content['found']
893892

894893

895-
@flaky(max_runs=3)
894+
@pytest.mark.flaky(max_runs=3)
896895
def test_matplotlib_inline(kernel):
897896
"""Test that the default backend for our kernels is 'inline'."""
898897
# Command to start the kernel
@@ -1181,7 +1180,7 @@ def test_locals_globals_in_pdb(kernel):
11811180
pdb_obj.curframe_locals = None
11821181

11831182

1184-
@flaky(max_runs=3)
1183+
@pytest.mark.flaky(max_runs=3)
11851184
@pytest.mark.parametrize("backend", [None, 'inline', 'tk', 'qt'])
11861185
@pytest.mark.skipif(
11871186
os.environ.get('USE_CONDA') != 'true',
@@ -1271,7 +1270,7 @@ def check_found(msg):
12711270
assert found
12721271

12731272

1274-
@flaky(max_runs=3)
1273+
@pytest.mark.flaky(max_runs=3)
12751274
def test_debug_namespace(tmpdir):
12761275
"""
12771276
Test that the kernel uses the proper namespace while debugging.

0 commit comments

Comments
 (0)