@@ -138,20 +138,21 @@ def pytest_addoption(parser):
138138 help = "Annotate failures in GitHub Actions." ,
139139 )
140140
141+
141142def pytest_configure (config ):
142143 if not config .option .exclude_warning_annotations :
143144 config .pluginmanager .register (_AnnotateWarnings (), "annotate_warnings" )
144145
145146
146147def _build_workflow_command (
147- command_name ,
148- file ,
149- line ,
150- end_line = None ,
151- column = None ,
152- end_column = None ,
153- title = None ,
154- message = None ,
148+ command_name : str ,
149+ file : str ,
150+ line : int ,
151+ end_line : int | None = None ,
152+ column : int | None = None ,
153+ end_column : int | None = None ,
154+ title : str | None = None ,
155+ message : str | None = None ,
155156):
156157 """Build a command to annotate a workflow."""
157158 result = f"::{ command_name } "
@@ -165,15 +166,13 @@ def _build_workflow_command(
165166 ("title" , title ),
166167 ]
167168
168- result = result + "," .join (
169- f"{ k } ={ v } " for k , v in entries if v is not None
170- )
169+ result = result + "," .join (f"{ k } ={ v } " for k , v in entries if v is not None )
171170
172171 if message is not None :
173172 result = result + "::" + _escape (message )
174173
175174 return result
176175
177176
178- def _escape (s ) :
177+ def _escape (s : str ) -> str :
179178 return s .replace ("%" , "%25" ).replace ("\r " , "%0D" ).replace ("\n " , "%0A" )
0 commit comments