|
21 | 21 | from anyio.streams.tls import TLSAttribute, TLSListener, TLSStream
|
22 | 22 |
|
23 | 23 | pytestmark = pytest.mark.anyio
|
| 24 | +skip_on_broken_openssl = pytest.mark.skipif( |
| 25 | + ssl.OPENSSL_VERSION_INFO[0] > 1, |
| 26 | + reason="Python 3.7 does not work with OpenSSL versions higher than 1.X", |
| 27 | +) |
24 | 28 |
|
25 | 29 |
|
26 | 30 | class TestTLSStream:
|
@@ -184,6 +188,7 @@ def serve_sync() -> None:
|
184 | 188 | pytest.param(False, False, id="neither_standard"),
|
185 | 189 | ],
|
186 | 190 | )
|
| 191 | + @skip_on_broken_openssl |
187 | 192 | async def test_ragged_eofs(
|
188 | 193 | self,
|
189 | 194 | server_context: ssl.SSLContext,
|
@@ -240,6 +245,7 @@ def serve_sync() -> None:
|
240 | 245 | else:
|
241 | 246 | assert server_exc is None
|
242 | 247 |
|
| 248 | + @skip_on_broken_openssl |
243 | 249 | async def test_ragged_eof_on_receive(
|
244 | 250 | self, server_context: ssl.SSLContext, client_context: ssl.SSLContext
|
245 | 251 | ) -> None:
|
@@ -372,6 +378,7 @@ def serve_sync() -> None:
|
372 | 378 |
|
373 | 379 |
|
374 | 380 | class TestTLSListener:
|
| 381 | + @skip_on_broken_openssl |
375 | 382 | async def test_handshake_fail(self, server_context: ssl.SSLContext) -> None:
|
376 | 383 | def handler(stream: object) -> NoReturn:
|
377 | 384 | pytest.fail("This function should never be called in this scenario")
|
|
0 commit comments