Skip to content

Commit f5b8195

Browse files
committed
🧪 Suppress PyOpenSSL deprecations @ Python 3.8
1 parent cd7ec3a commit f5b8195

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

cheroot/test/test_ssl.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,24 @@
5555
OpenSSL.SSL.SSLEAY_VERSION,
5656
).startswith(b'OpenSSL 1.0.')
5757
PY310_PLUS = sys.version_info[:2] >= (3, 10)
58+
PY38_OR_LOWER = sys.version_info[:2] <= (3, 8)
59+
60+
if PY38_OR_LOWER:
61+
# FIXME: This can be dropped together with Python 3.8.
62+
# FIXME: It's coming from `trustme < 1.2.0` as newer versions
63+
# FIXME: fixed the compatibility but dropped Python 3.8 support.
64+
pytestmark = [
65+
pytest.mark.filterwarnings(
66+
r'ignore:Passing pyOpenSSL PKey objects is deprecated\. '
67+
r'You should use a cryptography private key instead\.:'
68+
'DeprecationWarning:OpenSSL.SSL',
69+
),
70+
pytest.mark.filterwarnings(
71+
r'ignore:Passing pyOpenSSL X509 objects is deprecated\. '
72+
r'You should use a cryptography\.x509\.Certificate instead\.:'
73+
'DeprecationWarning:OpenSSL.SSL',
74+
),
75+
]
5876

5977

6078
_stdlib_to_openssl_verify = {

0 commit comments

Comments
 (0)