Skip to content

Commit c9501b2

Browse files
authored
Merge pull request #141 from zejn/pytest-raises-match
Fix incorrect use of pytest.raises(message=...)
2 parents 1c3c1a6 + a120278 commit c9501b2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ Housekeeping
3636
* Add flake8 checks in CI.
3737
* Add CPython 3.7 and PyPy 3.5 testing in CI.
3838
* Remove package future as a dependency, not needed anymore.
39+
* Fix warnings from py.test.

tests/test_jwt.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def return_invalid_json(token, key, algorithms, verify=True):
6262

6363
jws.verify = return_invalid_json
6464

65-
with pytest.raises(JWTError, message='Invalid payload string: ["a", "b"}'):
65+
with pytest.raises(JWTError, match='Invalid payload string: '):
6666
jwt.decode(token, 'secret', ['HS256'])
6767
finally:
6868
jws.verify = old_jws_verify
@@ -77,7 +77,7 @@ def return_encoded_array(token, key, algorithms, verify=True):
7777

7878
jws.verify = return_encoded_array
7979

80-
with pytest.raises(JWTError, message='Invalid payload string: must be a json object'):
80+
with pytest.raises(JWTError, match='Invalid payload string: must be a json object'):
8181
jwt.decode(token, 'secret', ['HS256'])
8282
finally:
8383
jws.verify = old_jws_verify

0 commit comments

Comments
 (0)