From 8215bf8fd64db41fd7f4972fba905c4274a3e81c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Thu, 26 May 2022 11:23:23 +0200 Subject: [PATCH] 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 --- .github/workflows/main.yml | 3 ++- tests/test_api_jws.py | 4 ++-- tox.ini | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5e4843fd..148933f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,8 @@ jobs: strategy: matrix: platform: ["ubuntu-latest", "windows-latest"] - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", + "3.11.0-beta - 3.11", "pypy-3.8", "pypy-3.9"] steps: - uses: "actions/checkout@v3" diff --git a/tests/test_api_jws.py b/tests/test_api_jws.py index 0a0e2954..23975fa4 100644 --- a/tests/test_api_jws.py +++ b/tests/test_api_jws.py @@ -83,7 +83,7 @@ def test_non_object_options_dont_persist(self, jws, payload): def test_options_must_be_dict(self, jws): pytest.raises(TypeError, PyJWS, options=object()) - pytest.raises(TypeError, PyJWS, options=("something")) + pytest.raises((TypeError, ValueError), PyJWS, options=("something")) def test_encode_decode(self, jws, payload): secret = "secret" @@ -607,7 +607,7 @@ def test_decode_options_must_be_dict(self, jws, payload): with pytest.raises(TypeError): jws.decode(token, "secret", options=object()) - with pytest.raises(TypeError): + with pytest.raises((TypeError, ValueError)): jws.decode(token, "secret", options="something") def test_custom_json_encoder(self, jws, payload): diff --git a/tox.ini b/tox.ini index d3664617..74fff6a2 100644 --- a/tox.ini +++ b/tox.ini @@ -13,13 +13,16 @@ python = 3.8: py38, typing 3.9: py39 3.10: py310 + 3.11: py311 + pypy-3.8: pypy3 + pypy-3.9: pypy3 [tox] envlist = lint typing - py{36,37,38,39}-{crypto,nocrypto} + py{36,37,38,39,310,311,py3}-{crypto,nocrypto} docs pypi-description coverage-report