summaryrefslogtreecommitdiff
path: root/tests/test_api_jwt.py
diff options
context:
space:
mode:
authorViicos <65306057+Viicos@users.noreply.github.com>2023-04-16 09:51:09 +0200
committerGitHub <noreply@github.com>2023-04-16 13:51:09 +0600
commit56b3d5633160e79e1f4c5c09023d68759cbf84a6 (patch)
tree8daa4bef8877eb6dcbb742bb0f63842ca70a51e6 /tests/test_api_jwt.py
parentba726444a6cee75af59feb8ea08294d0ac89bedb (diff)
downloadpyjwt-56b3d5633160e79e1f4c5c09023d68759cbf84a6.tar.gz
Add complete types to take all allowed keys into account (#873)
* Use new style typing * Fix type annotations to allow all keys * Use string type annotations where required * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove outdated comment * Ignore `if TYPE_CHECKING:` lines in coverage * Remove duplicate test * Fix mypy errors * Update algorithms.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fully switch to modern annotations * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update `pre-commit` mypy config * Use Python 3.11 for mypy * Update mypy Python version in `pyproject.toml` * Few tests mypy fixes * fix mypy errors on tests * Fix key imports * Remove unused import * Fix randomly failing test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Asif Saif Uddin <auvipy@gmail.com>
Diffstat (limited to 'tests/test_api_jwt.py')
-rw-r--r--tests/test_api_jwt.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test_api_jwt.py b/tests/test_api_jwt.py
index 3c08ea5..0d53444 100644
--- a/tests/test_api_jwt.py
+++ b/tests/test_api_jwt.py
@@ -365,8 +365,8 @@ class TestJWT:
secret = "secret"
jwt_message = jwt.encode(payload, secret)
- # With 3 seconds leeway, should be ok
- for leeway in (3, timedelta(seconds=3)):
+ # With 5 seconds leeway, should be ok
+ for leeway in (5, timedelta(seconds=5)):
decoded = jwt.decode(
jwt_message, secret, leeway=leeway, algorithms=["HS256"]
)