Skip to content

Commit 510b0e5

Browse files
authored
Stop using flaky lib, use pytest-rerunfailures instead (#1296)
* Stop using flaky lib, use pytest-rerunfailures instead flaky is not compatible with the latest pytest release and appears unmaintained, while pytest-rerunfailures is maintained by the pytest team * ruff
1 parent a972ea4 commit 510b0e5

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def find_meta(meta):
9696
"cryptography>=41.0.5,<43",
9797
],
9898
extras_require={
99-
"test": ["flaky", "pretend", "pytest>=3.0.1"],
99+
"test": ["pytest-rerunfailures", "pretend", "pytest>=3.0.1"],
100100
"docs": [
101101
"sphinx!=5.2.0,!=5.2.0.post0,!=7.2.5",
102102
"sphinx_rtd_theme",

tests/test_crypto.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"""
55
Unit tests for :py:mod:`OpenSSL.crypto`.
66
"""
7+
78
import base64
89
import sys
910
import warnings
1011
from datetime import datetime, timedelta, timezone
1112
from subprocess import PIPE, Popen
1213

13-
import flaky
1414
import pytest
1515
from cryptography import x509
1616
from cryptography.hazmat.primitives import hashes, serialization
@@ -1864,7 +1864,7 @@ def test_gmtime_adj_notBefore_wrong_args(self):
18641864
with pytest.raises(TypeError):
18651865
cert.gmtime_adj_notBefore(None)
18661866

1867-
@flaky.flaky
1867+
@pytest.mark.flaky(reruns=2)
18681868
def test_gmtime_adj_notBefore(self):
18691869
"""
18701870
`X509.gmtime_adj_notBefore` changes the not-before timestamp to be the
@@ -1890,7 +1890,7 @@ def test_gmtime_adj_notAfter_wrong_args(self):
18901890
with pytest.raises(TypeError):
18911891
cert.gmtime_adj_notAfter(None)
18921892

1893-
@flaky.flaky
1893+
@pytest.mark.flaky(reruns=2)
18941894
def test_gmtime_adj_notAfter(self):
18951895
"""
18961896
`X509.gmtime_adj_notAfter` changes the not-after timestamp

tests/test_ssl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
from typing import Union
3535
from weakref import ref
3636

37-
import flaky
3837
import pytest
3938
from cryptography import x509
4039
from cryptography.hazmat.primitives import hashes, serialization
@@ -510,7 +509,7 @@ def test_set_cipher_list_wrong_type(self, context):
510509
with pytest.raises(TypeError):
511510
context.set_cipher_list(object())
512511

513-
@flaky.flaky
512+
@pytest.mark.flaky(reruns=2)
514513
def test_set_cipher_list_no_cipher_match(self, context):
515514
"""
516515
`Context.set_cipher_list` raises `OpenSSL.SSL.Error` with a

tests/util.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
U{Twisted<http://twistedmatrix.com/>}.
77
"""
88

9-
109
# This is the UTF-8 encoding of the SNOWMAN unicode code point.
1110
NON_ASCII = b"\xe2\x98\x83".decode("utf-8")
1211

0 commit comments

Comments
 (0)