@@ -83,7 +83,7 @@ def integration_env(integration_dir, write_file, run_coverage):
8383
8484
8585def test_action__pull_request__store_comment (
86- pull_request_config , session , in_integration_env , capsys
86+ pull_request_config , session , in_integration_env , output_file
8787):
8888 # No existing badge in this test
8989 session .register (
@@ -111,7 +111,7 @@ def checker(payload):
111111 )(status_code = 403 )
112112
113113 result = main .action (
114- config = pull_request_config (),
114+ config = pull_request_config (GITHUB_OUTPUT = output_file ),
115115 github_session = session ,
116116 http_session = session ,
117117 git = None ,
@@ -131,12 +131,13 @@ def checker(payload):
131131 in comment
132132 )
133133
134- expected_stdout = "::set-output name=COMMENT_FILE_WRITTEN::true"
135- assert capsys .readouterr ().out .strip () == expected_stdout
134+ expected_output = "COMMENT_FILE_WRITTEN=true\n "
135+
136+ assert output_file .read_text () == expected_output
136137
137138
138139def test_action__pull_request__post_comment (
139- pull_request_config , session , in_integration_env , capsys
140+ pull_request_config , session , in_integration_env , output_file
140141):
141142 payload = json .dumps ({"coverage" : 30.00 })
142143 # There is an existing badge in this test, allowing to test the coverage evolution
@@ -169,7 +170,7 @@ def checker(payload):
169170 )
170171
171172 result = main .action (
172- config = pull_request_config (),
173+ config = pull_request_config (GITHUB_OUTPUT = output_file ),
173174 github_session = session ,
174175 http_session = session ,
175176 git = None ,
@@ -179,12 +180,13 @@ def checker(payload):
179180 assert not pathlib .Path ("python-coverage-comment-action.txt" ).exists ()
180181 assert "The coverage rate went from `30%` to `86%` :arrow_up:" in comment
181182
182- expected_stdout = "::set-output name=COMMENT_FILE_WRITTEN::false"
183- assert capsys .readouterr ().out .strip () == expected_stdout
183+ expected_output = "COMMENT_FILE_WRITTEN=false\n "
184+
185+ assert output_file .read_text () == expected_output
184186
185187
186188def test_action__pull_request__force_store_comment (
187- pull_request_config , session , in_integration_env , capsys
189+ pull_request_config , session , in_integration_env , output_file
188190):
189191 payload = json .dumps ({"coverage" : 30.00 })
190192 # There is an existing badge in this test, allowing to test the coverage evolution
@@ -194,7 +196,7 @@ def test_action__pull_request__force_store_comment(
194196 )(json = {"content" : base64 .b64encode (payload .encode ()).decode ()})
195197
196198 result = main .action (
197- config = pull_request_config (FORCE_WORKFLOW_RUN = True ),
199+ config = pull_request_config (FORCE_WORKFLOW_RUN = True , GITHUB_OUTPUT = output_file ),
198200 github_session = session ,
199201 http_session = session ,
200202 git = None ,
@@ -203,8 +205,9 @@ def test_action__pull_request__force_store_comment(
203205
204206 assert pathlib .Path ("python-coverage-comment-action.txt" ).exists ()
205207
206- expected_stdout = "::set-output name=COMMENT_FILE_WRITTEN::true"
207- assert capsys .readouterr ().out .strip () == expected_stdout
208+ expected_output = "COMMENT_FILE_WRITTEN=true\n "
209+
210+ assert output_file .read_text () == expected_output
208211
209212
210213def test_action__pull_request__post_comment__no_marker (
0 commit comments