From 50ee5fc4b71707071e7d66320f41adfefda119d3 Mon Sep 17 00:00:00 2001 From: Kyle Verhoog Date: Thu, 21 Nov 2024 18:19:16 -0500 Subject: [PATCH] chore(tests): fix tz warning Running the tests locally, I get: ``` DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC ``` The recommended upgrade is to use `datetime.now(timezone.utc)` which is what is done here. --- tests/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/utils.py b/tests/utils.py index 01d8b9aa725..99ef60edc41 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1337,7 +1337,7 @@ def _should_skip(condition=None, until: int = None): until = dt.datetime(3000, 1, 1) else: until = dt.datetime.fromtimestamp(until) - if until and dt.datetime.utcnow() < until.replace(tzinfo=None): + if until and datetime.now(timezone.utc) < until.replace(tzinfo=None): return True if condition is not None and not condition: return False