Skip to content

Commit c870fc2

Browse files
committed
minor
1 parent 04cf064 commit c870fc2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/e2e-playwright/tests/conftest.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import os
1212
import random
1313
import re
14+
import textwrap
1415
import urllib.parse
1516
from collections.abc import Callable, Iterator
1617
from contextlib import ExitStack
@@ -123,7 +124,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
123124

124125

125126
# Dictionary to store start times of tests
126-
_test_start_times = {}
127+
_test_start_times: dict[str, datetime.datetime] = {}
127128

128129

129130
def pytest_runtest_setup(item):
@@ -151,7 +152,7 @@ def _construct_graylog_url(
151152
return f"{monitoring_url}/graylog/search?{query}"
152153

153154

154-
def pytest_runtest_makereport(item: Item, call):
155+
def pytest_runtest_makereport(item: pytest.Item, call):
155156
"""
156157
Hook to add extra information when a test fails.
157158
"""
@@ -178,12 +179,9 @@ def pytest_runtest_makereport(item: Item, call):
178179
)
179180
diagnostics["duration"] = str(end_time - start_time)
180181

181-
# Print the diagnostics report
182-
with log_context(
183-
logging.WARNING,
184-
f"ℹ️ Diagnostics report for {test_name} ---", # noqa: RUF001
185-
) as ctx:
186-
ctx.logger.warning(json.dumps(diagnostics, indent=2))
182+
print(f"\nDiagnostics report for {test_name} ---") # noqa: RUF001
183+
print(textwrap.indent(json.dumps(diagnostics, indent=2), " "))
184+
print("---")
187185

188186

189187
@pytest.hookimpl(tryfirst=True)

0 commit comments

Comments
 (0)