add alternatives for deprecated utc datetime functions

This commit is contained in:
Mike Fährmann
2024-09-19 20:09:03 +02:00
parent a051e1c955
commit 2c7a0c3ca8
7 changed files with 68 additions and 19 deletions

View File

@@ -243,9 +243,12 @@ class TestExtractorWait(unittest.TestCase):
def test_wait_until_datetime(self):
extr = extractor.find("generic:https://example.org/")
until = datetime.utcnow() + timedelta(seconds=5)
until = util.datetime_utcnow() + timedelta(seconds=5)
until_local = datetime.now() + timedelta(seconds=5)
if not until.microsecond:
until = until.replace(microsecond=until_local.microsecond)
with patch("time.sleep") as sleep, patch.object(extr, "log") as log:
extr.wait(until=until)