From ad1686ef5880b41ca8e715807fe1c3e8422e4c80 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 07:19:09 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- jwt/api_jwt.py | 8 ++++---- tests/test_api_jwt.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jwt/api_jwt.py b/jwt/api_jwt.py index cbb810ece..da9d481bf 100644 --- a/jwt/api_jwt.py +++ b/jwt/api_jwt.py @@ -79,11 +79,11 @@ def decode_complete( # If the user has set the legacy `verify` argument, and it doesn't match # what the relevant `options` entry for the argument is, inform the user # that they're likely making a mistake. - if 'verify' in kwargs and kwargs['verify'] != options['verify_signature']: + if "verify" in kwargs and kwargs["verify"] != options["verify_signature"]: warnings.warn( - 'The `verify` argument to `decode` does nothing in PyJWT 2.0 and newer. ' - 'The equivalent is setting `verify_signature` to False in the `options` dictionary. ' - 'This invocation has a mismatch between the kwarg and the option entry.', + "The `verify` argument to `decode` does nothing in PyJWT 2.0 and newer. " + "The equivalent is setting `verify_signature` to False in the `options` dictionary. " + "This invocation has a mismatch between the kwarg and the option entry.", category=DeprecationWarning, ) diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py index 4434545ce..57cc4ae1d 100644 --- a/tests/test_api_jwt.py +++ b/tests/test_api_jwt.py @@ -671,4 +671,6 @@ def test_decode_legacy_verify_warning(self, jwt, payload): with pytest.deprecated_call(): # The user explicitly sets verify=True, # but contradicts it in verify_signature. - jwt.decode(jwt_message, secret, verify=True, options={"verify_signature": False}) + jwt.decode( + jwt_message, secret, verify=True, options={"verify_signature": False} + )