From 06ed10dc8a35ffd2a61ba266841b0eeddb7b6aec Mon Sep 17 00:00:00 2001 From: Alexandr Artemyev Date: Wed, 26 Jun 2024 00:04:22 +0500 Subject: [PATCH 1/2] Fix Deprecation Warning for datetime.utcfromtimestamp --- src/pytest_selenium/pytest_selenium.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_selenium/pytest_selenium.py b/src/pytest_selenium/pytest_selenium.py index c8eb13f..6daa578 100644 --- a/src/pytest_selenium/pytest_selenium.py +++ b/src/pytest_selenium/pytest_selenium.py @@ -355,7 +355,7 @@ def format_log(log): timestamp_format = "%Y-%m-%d %H:%M:%S.%f" entries = [ "{0} {1[level]} - {1[message]}".format( - datetime.utcfromtimestamp(entry["timestamp"] / 1000.0).strftime( + datetime.fromtimestamp(entry["timestamp"] / 1000.0, timezone.utc).strftime( timestamp_format ), entry, From 7bc41c6d680eba6b569b792447d183e294407428 Mon Sep 17 00:00:00 2001 From: Alexandr Artemyev Date: Wed, 26 Jun 2024 00:06:24 +0500 Subject: [PATCH 2/2] Fix import --- src/pytest_selenium/pytest_selenium.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pytest_selenium/pytest_selenium.py b/src/pytest_selenium/pytest_selenium.py index 6daa578..2dd5eba 100644 --- a/src/pytest_selenium/pytest_selenium.py +++ b/src/pytest_selenium/pytest_selenium.py @@ -4,7 +4,7 @@ import argparse import copy -from datetime import datetime +from datetime import datetime, timezone import os import io import logging