Skip to content

Commit 8215bf8

Browse files
mgornyauvipy
andauthored
Adjust expected exceptions in option merging tests for PyPy3 (#763)
* Adjust expected exceptions in option merging tests for PyPy3 PyPy3 raises ValueError rather than TypeError when trying to combine a dict and a str in dict unpacking. Update the test expectations appropriately. Fixes #580 * Enable GHA testing on Python 3.11 and all PyPy3 versions Enable testing on all Python 3 versions supported by GitHub Actions at the moment. While at it, fix the tox invocation for Python 3.10. * drop pypy3.7 from tox Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
1 parent 59065fa commit 8215bf8

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
strategy:
1919
matrix:
2020
platform: ["ubuntu-latest", "windows-latest"]
21-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
21+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10",
22+
"3.11.0-beta - 3.11", "pypy-3.8", "pypy-3.9"]
2223

2324
steps:
2425
- uses: "actions/checkout@v3"

tests/test_api_jws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def test_non_object_options_dont_persist(self, jws, payload):
8383

8484
def test_options_must_be_dict(self, jws):
8585
pytest.raises(TypeError, PyJWS, options=object())
86-
pytest.raises(TypeError, PyJWS, options=("something"))
86+
pytest.raises((TypeError, ValueError), PyJWS, options=("something"))
8787

8888
def test_encode_decode(self, jws, payload):
8989
secret = "secret"
@@ -607,7 +607,7 @@ def test_decode_options_must_be_dict(self, jws, payload):
607607
with pytest.raises(TypeError):
608608
jws.decode(token, "secret", options=object())
609609

610-
with pytest.raises(TypeError):
610+
with pytest.raises((TypeError, ValueError)):
611611
jws.decode(token, "secret", options="something")
612612

613613
def test_custom_json_encoder(self, jws, payload):

tox.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,16 @@ python =
1313
3.8: py38, typing
1414
3.9: py39
1515
3.10: py310
16+
3.11: py311
17+
pypy-3.8: pypy3
18+
pypy-3.9: pypy3
1619

1720

1821
[tox]
1922
envlist =
2023
lint
2124
typing
22-
py{36,37,38,39}-{crypto,nocrypto}
25+
py{36,37,38,39,310,311,py3}-{crypto,nocrypto}
2326
docs
2427
pypi-description
2528
coverage-report

0 commit comments

Comments
 (0)