From 7f5a79f529fccd379e71ef61be9c891850f95d74 Mon Sep 17 00:00:00 2001 From: Sanjays2402 <51058514+Sanjays2402@users.noreply.github.com> Date: Thu, 2 Jul 2026 00:59:50 -0700 Subject: [PATCH] Replace deprecated datetime.utcnow() in test_nbf_token_in_future test_nbf_token_in_future built a future 'nbf' claim with datetime.utcnow(), deprecated since Python 3.12. The test module already imports timezone and uses timezone-aware datetimes elsewhere, so switch to datetime.now(timezone.utc) for consistency and to silence the deprecation warning. Test still passes (41 passed in test_decode_tokens.py). --- tests/test_decode_tokens.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_decode_tokens.py b/tests/test_decode_tokens.py index bfa9a8a..9fb6d80 100644 --- a/tests/test_decode_tokens.py +++ b/tests/test_decode_tokens.py @@ -155,7 +155,7 @@ def test_never_expire_token(app): def test_nbf_token_in_future(app): - date_in_future = datetime.utcnow() + timedelta(seconds=30) + date_in_future = datetime.now(timezone.utc) + timedelta(seconds=30) with pytest.raises(ImmatureSignatureError): with app.test_request_context():