Skip to content

Commit

Permalink
Merge pull request #327 from graingert/test-on-py310
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin committed Jun 8, 2021
2 parents 51d3bdf + 6abfddd commit 8767902
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 15 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -14,8 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# Add 3.9 when cryptography ships Python 3.9 Windows wheels
python: ['2.7', '3.6', '3.7', '3.8']
python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -37,7 +36,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['2.7', '3.6', '3.7', '3.8', '3.9']
python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
old_cryptography: ['']
extra_name: ['']
include:
Expand Down Expand Up @@ -71,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['2.7', '3.6', '3.7', '3.8', '3.9']
python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
8 changes: 6 additions & 2 deletions ci.sh
Expand Up @@ -12,7 +12,11 @@ python -m pip install dist/*.zip

# Actual tests

python -m pip install -Ur test-requirements.txt
if [[ $(python -c 'import sys; print(sys.version_info < (3,))') = 'True' ]]; then
python -m pip install -Ur test-requirements.txt
else
python -m pip install -Ur test-requirements-py3.txt
fi
if [ -n "${OLD_CRYPTOGRAPHY:-}" ]; then
python -m pip install cryptography=="${OLD_CRYPTOGRAPHY}"
fi
Expand All @@ -22,4 +26,4 @@ INSTALLDIR=$(python -c "import os, trustme; print(os.path.dirname(trustme.__file
pytest -W error -ra -s ../tests --cov="$INSTALLDIR" --cov=../tests --cov-config="../.coveragerc"

python -m pip install codecov
codecov -F $(uname | tr A-Z a-z)
codecov --tries=9999 --required -F $(uname | tr A-Z a-z)
63 changes: 63 additions & 0 deletions test-requirements-py3.txt
@@ -0,0 +1,63 @@
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file=test-requirements-py3.txt test-requirements.in
#
attrs==21.2.0
# via
# pytest
# service-identity
cffi==1.14.5
# via cryptography
coverage==5.5
# via pytest-cov
cryptography==3.4.7
# via
# -r test-requirements.in
# pyopenssl
# service-identity
importlib-metadata==4.5.0
# via
# pluggy
# pytest
iniconfig==1.1.1
# via pytest
packaging==20.9
# via pytest
pluggy==0.13.1
# via pytest
py==1.10.0
# via pytest
pyasn1-modules==0.2.8
# via service-identity
pyasn1==0.4.8
# via
# pyasn1-modules
# service-identity
pycparser==2.20
# via cffi
pyopenssl==20.0.1
# via -r test-requirements.in
pyparsing==2.4.7
# via packaging
pytest-cov==2.12.1
# via -r test-requirements.in
pytest==6.2.4
# via
# -r test-requirements.in
# pytest-cov
service-identity==21.1.0
# via -r test-requirements.in
six==1.16.0
# via
# pyopenssl
# service-identity
toml==0.10.2
# via
# pytest
# pytest-cov
typing-extensions==3.10.0.0
# via importlib-metadata
zipp==3.4.1
# via importlib-metadata
8 changes: 4 additions & 4 deletions test-requirements.in
Expand Up @@ -6,10 +6,10 @@ cryptography
# Those are the last version with py2 support
# and pip-compile won't let us pin it just on py2, so we have to pin it
# everywhere
more-itertools==5.0.0
zipp<2.0
idna<3
more-itertools==5.0.0; python_version < "3"
zipp<2.0; python_version < "3"
idna<3; python_version < "3"
# Really only needed on py2, but again, pip-compile doesn't handle
# environment markers well, so we install it everywhere and on py3 it
# just doesn't get used.
futures
futures; python_version < "3.2"
35 changes: 30 additions & 5 deletions test-requirements.txt
Expand Up @@ -10,27 +10,49 @@ attrs==21.2.0
# via
# pytest
# service-identity
backports.functools-lru-cache==1.6.4
# via wcwidth
cffi==1.14.5
# via cryptography
configparser==4.0.2
# via importlib-metadata
contextlib2==0.6.0.post1
# via
# importlib-metadata
# zipp
coverage==5.5
# via pytest-cov
cryptography==2.9.2
# via
# -r test-requirements.in
# pyopenssl
# service-identity
futures==3.1.1
enum34==1.1.10
# via cryptography
funcsigs==1.0.2
# via pytest
futures==3.1.1 ; python_version < "3.2"
# via -r test-requirements.in
idna==2.10
idna==2.10 ; python_version < "3"
# via -r test-requirements.in
importlib-metadata==2.0.0
# via pytest
more-itertools==5.0.0
# via
# pluggy
# pytest
ipaddress==1.0.23
# via
# cryptography
# service-identity
more-itertools==5.0.0 ; python_version < "3"
# via
# -r test-requirements.in
# pytest
packaging==20.9
# via pytest
pathlib2==2.3.5
# via
# importlib-metadata
# pytest
pluggy==0.13.1
# via pytest
py==1.10.0
Expand All @@ -53,20 +75,23 @@ pytest==4.6.3
# via
# -r test-requirements.in
# pytest-cov
scandir==1.10.0
# via pathlib2
service-identity==21.1.0
# via -r test-requirements.in
six==1.16.0
# via
# cryptography
# more-itertools
# pathlib2
# pyopenssl
# pytest
# service-identity
toml==0.10.2
# via pytest-cov
wcwidth==0.2.5
# via pytest
zipp==1.2.0
zipp==1.2.0 ; python_version < "3"
# via
# -r test-requirements.in
# importlib-metadata
2 changes: 2 additions & 0 deletions tests/test_trustme.py
Expand Up @@ -276,6 +276,7 @@ def fake_ssl_client(ca, raw_client_sock, hostname):
# Send and receive some data to prove the connection is good
wrapped_client_sock.send(b"x")
assert wrapped_client_sock.recv(1) == b"y"
wrapped_client_sock.close()
except: # pragma: no cover
sys.excepthook(*sys.exc_info())
raise
Expand All @@ -289,6 +290,7 @@ def fake_ssl_server(server_cert, raw_server_sock):
# Prove that we're connected
assert wrapped_server_sock.recv(1) == b"x"
wrapped_server_sock.send(b"y")
wrapped_server_sock.close()
except: # pragma: no cover
sys.excepthook(*sys.exc_info())
raise
Expand Down

0 comments on commit 8767902

Please sign in to comment.