33
44import pytest
55from tap .formatter import format_as_diagnostics
6- from tap .tracker import Tracker , ENABLE_VERSION_13
7-
6+ from tap .tracker import ENABLE_VERSION_13 , Tracker
87
98SHOW_CAPTURE_LOG = ("log" , "all" )
109SHOW_CAPTURE_OUT = ("stdout" , "all" )
@@ -84,7 +83,9 @@ def pytest_runtest_logreport(self, report: pytest.TestReport):
8483 self ._tracker .add_ok (testcase , description , diagnostics = diagnostics )
8584 elif report .failed :
8685 diagnostics = _make_as_diagnostics (report , self .show_capture )
87- raw_yaml_block = _make_as_raw_yaml_block (report ) if ENABLE_VERSION_13 else None
86+ raw_yaml_block = (
87+ _make_as_raw_yaml_block (report ) if ENABLE_VERSION_13 else None
88+ )
8889
8990 # pytest treats an unexpected success from unitest.expectedFailure
9091 # as a failure.
@@ -110,7 +111,12 @@ def pytest_runtest_logreport(self, report: pytest.TestReport):
110111 )
111112 return
112113
113- self ._tracker .add_not_ok (testcase , description , diagnostics = diagnostics , raw_yaml_block = raw_yaml_block )
114+ self ._tracker .add_not_ok (
115+ testcase ,
116+ description ,
117+ diagnostics = diagnostics ,
118+ raw_yaml_block = raw_yaml_block ,
119+ )
114120 elif report .skipped :
115121 reason = report .longrepr [2 ].split (":" , 1 )[1 ].strip () # type: ignore
116122 self ._tracker .add_skip (testcase , description , reason )
@@ -212,7 +218,7 @@ def _make_as_raw_yaml_block(report):
212218 lines = report .longreprtext .splitlines (keepends = True )
213219 return f"""\
214220 message: |
215- { '' .join (f' { line } ' for line in lines )}
221+ { "" .join (f" { line } " for line in lines )}
216222severity: { report .outcome }
217223duration_ms: { report .duration * 1000 }
218224"""
0 commit comments