Skip to content

Commit afdd406

Browse files
committed
test: replace deprecated datetime.utcnow calls
1 parent a88cb4f commit afdd406

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integration/test_acctload.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# pylint: disable=redefined-outer-name,missing-docstring
88

99
import json
10-
from datetime import datetime, timedelta
10+
from datetime import datetime, timedelta, timezone
1111
from pathlib import Path
1212

1313
import pytest
@@ -254,7 +254,7 @@ def test_json_loader_with_expired_cache(
254254

255255
# Fast-forward the time to the future by a day and a few seconds beyond
256256
# when the cache is valid, which will force a fresh fetch of data.
257-
with freeze_time(datetime.utcnow() + timedelta(days=1, seconds=5)):
257+
with freeze_time(datetime.now(timezone.utc) + timedelta(days=1, seconds=5)):
258258
acctload.JSONAccountLoader("http://example.com/acct.json", max_age=86400)
259259

260260
# requests.get should be called when cache is expired to refresh it
@@ -285,7 +285,7 @@ def test_yaml_loader_with_expired_cache(
285285

286286
# Fast-forward the time to the future by a day and a few seconds beyond
287287
# when the cache is valid, which will force a fresh fetch of data.
288-
with freeze_time(datetime.utcnow() + timedelta(days=1, seconds=5)):
288+
with freeze_time(datetime.now(timezone.utc) + timedelta(days=1, seconds=5)):
289289
acctload.YAMLAccountLoader("http://example.com/acct.yaml", max_age=86400)
290290

291291
# requests.get should be called when cache is expired to refresh it

0 commit comments

Comments
 (0)