Skip to content

Commit e5083f8

Browse files
committed
Rerun flaky test on PyPy only.
1 parent 39527d5 commit e5083f8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

tests/list_tests.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818
import pytest
1919

2020
# this package
21+
from domdf_python_tools.doctools import PYPY
2122
from domdf_python_tools.testing import not_pypy
2223
from tests import seq_tests
2324
from tests.seq_tests import ALWAYS_EQ, NEVER_EQ
2425

2526

27+
def flaky_pypy(func):
28+
if PYPY:
29+
return pytest.mark.flaky(reruns=2)(func)
30+
else:
31+
return func
32+
33+
2634
class CommonTest(seq_tests.CommonTest):
2735

2836
def test_init(self):
@@ -73,6 +81,7 @@ def test_repr(self):
7381
assert str(a2) == "[0, 1, 2, [...], 3]"
7482
assert repr(a2) == "[0, 1, 2, [...], 3]"
7583

84+
@flaky_pypy
7685
def test_repr_deep(self):
7786
a = self.type2test([])
7887
for i in range(sys.getrecursionlimit() + 100):

tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ pytest>=6.0.0
77
pytest-cov>=2.8.1
88
pytest-randomly>=3.3.1
99
pytest-regressions>=2.0.1
10-
pytest-rerunfailures>=9.0
10+
pytest-rerunfailures>=9.1.1
1111
pytest-timeout>=1.4.2
1212
pytz>=2019.1

0 commit comments

Comments
 (0)