From a120278ad6a28abcc632673b47ef3af3c2c64d70 Mon Sep 17 00:00:00 2001 From: Gasper Zejn Date: Fri, 12 Apr 2019 10:30:37 +0200 Subject: [PATCH] Fix incorrect use of pytest.raises(message=...) --- CHANGELOG.rst | 1 + tests/test_jwt.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b58692b4..86da8766 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -36,3 +36,4 @@ Housekeeping * Add flake8 checks in CI. * Add CPython 3.7 and PyPy 3.5 testing in CI. * Remove package future as a dependency, not needed anymore. +* Fix warnings from py.test. diff --git a/tests/test_jwt.py b/tests/test_jwt.py index 9ceb2391..75ed3fc9 100644 --- a/tests/test_jwt.py +++ b/tests/test_jwt.py @@ -62,7 +62,7 @@ def return_invalid_json(token, key, algorithms, verify=True): jws.verify = return_invalid_json - with pytest.raises(JWTError, message='Invalid payload string: ["a", "b"}'): + with pytest.raises(JWTError, match='Invalid payload string: '): jwt.decode(token, 'secret', ['HS256']) finally: jws.verify = old_jws_verify @@ -77,7 +77,7 @@ def return_encoded_array(token, key, algorithms, verify=True): jws.verify = return_encoded_array - with pytest.raises(JWTError, message='Invalid payload string: must be a json object'): + with pytest.raises(JWTError, match='Invalid payload string: must be a json object'): jwt.decode(token, 'secret', ['HS256']) finally: jws.verify = old_jws_verify