8000 Skip certain TLS tests on py3.7 + openssl 3 · IBMZ-Linux-OSS-Python/anyio@891c0d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 891c0d6

Browse files
committed
Skip certain TLS tests on py3.7 + openssl 3
1 parent 62ab84e commit 891c0d6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ jobs:
4545
uses: actions/setup-python@v4
4646
with:
4747
python-version: ${{ matrix.python-version }}
48-
- uses: actions/cache@v3
49-
with:
50-
path: ~/.cache/pip
51-
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
48+
cache: pip
49+
cache-dependency-path: pyproject.toml
5250
- name: Install dependencies
5351
run: pip install .[test] coveralls
5452
- name: Test with pytest

tests/streams/test_tls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
from anyio.streams.tls import TLSAttribute, TLSListener, TLSStream
2222

2323
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+
)
2428

2529

2630
class TestTLSStream:
@@ -184,6 +188,7 @@ def serve_sync() -> None:
184188
pytest.param(False, False, id="neither_standard"),
185189
],
186190
)
191+
@skip_on_broken_openssl
187192
async def test_ragged_eofs(
188193
self,
189194
server_context: ssl.SSLContext,
@@ -240,6 +245,7 @@ def serve_sync() -> None:
240245
else:
241246
assert server_exc is None
242247

248+
@skip_on_broken_openssl
243249
async def test_ragged_eof_on_receive(
244250
self, server_context: ssl.SSLContext, client_context: ssl.SSLContext
245251
) -> None:
@@ -372,6 +378,7 @@ def serve_sync() -> None:
372378

373379

374380
class TestTLSListener:
381+
@skip_on_broken_openssl
375382
async def test_handshake_fail(self, server_context: ssl.SSLContext) -> None:
376383
def handler(stream: object) -> NoReturn:
377384
pytest.fail("This function should never be called in this scenario")

0 commit comments

Comments
 (0)
0