Skip to content

Commit

Permalink
Skip certain TLS tests on py3.7 + openssl 3
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Nov 20, 2022
1 parent 62ab84e commit 891c0d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: pip-test-${{ matrix.python-version }}-${{ matrix.os }}
cache: pip
cache-dependency-path: pyproject.toml
- name: Install dependencies
run: pip install .[test] coveralls
- name: Test with pytest
Expand Down
7 changes: 7 additions & 0 deletions tests/streams/test_tls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
from anyio.streams.tls import TLSAttribute, TLSListener, TLSStream

pytestmark = pytest.mark.anyio
skip_on_broken_openssl = pytest.mark.skipif(
ssl.OPENSSL_VERSION_INFO[0] > 1,
reason="Python 3.7 does not work with OpenSSL versions higher than 1.X",
)


class TestTLSStream:
Expand Down Expand Up @@ -184,6 +188,7 @@ def serve_sync() -> None:
pytest.param(False, False, id="neither_standard"),
],
)
@skip_on_broken_openssl
async def test_ragged_eofs(
self,
server_context: ssl.SSLContext,
Expand Down Expand Up @@ -240,6 +245,7 @@ def serve_sync() -> None:
else:
assert server_exc is None

@skip_on_broken_openssl
async def test_ragged_eof_on_receive(
self, server_context: ssl.SSLContext, client_context: ssl.SSLContext
) -> None:
Expand Down Expand Up @@ -372,6 +378,7 @@ def serve_sync() -> None:


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

0 comments on commit 891c0d6

Please sign in to comment.