@@ -82,7 +82,7 @@ def integration_env(integration_dir, write_file, run_coverage):
82
82
83
83
84
84
def test_action__pull_request__store_comment (
85
- pull_request_config , session , in_integration_env , capsys
85
+ pull_request_config , session , in_integration_env , output_file
86
86
):
87
87
# No existing badge in this test
88
88
session .register (
@@ -110,7 +110,7 @@ def checker(payload):
110
110
)
111
111
112
112
result = main .action (
113
- config = pull_request_config (),
113
+ config = pull_request_config (GITHUB_OUTPUT = output_file ),
114
114
github_session = session ,
115
115
http_session = session ,
116
116
git = None ,
@@ -130,12 +130,13 @@ def checker(payload):
130
130
in comment
131
131
)
132
132
133
- expected_stdout = "::set-output name=COMMENT_FILE_WRITTEN::true"
134
- assert capsys .readouterr ().out .strip () == expected_stdout
133
+ expected_output = "COMMENT_FILE_WRITTEN=true\n "
134
+
135
+ assert output_file .read_text () == expected_output
135
136
136
137
137
138
def test_action__pull_request__post_comment (
138
- pull_request_config , session , in_integration_env , capsys
139
+ pull_request_config , session , in_integration_env , output_file
139
140
):
140
141
# There is an existing badge in this test, allowing to test the coverage evolution
141
142
session .register (
@@ -167,7 +168,7 @@ def checker(payload):
167
168
)
168
169
169
170
result = main .action (
170
- config = pull_request_config (),
171
+ config = pull_request_config (GITHUB_OUTPUT = output_file ),
171
172
github_session = session ,
172
173
http_session = session ,
173
174
git = None ,
@@ -177,8 +178,9 @@ def checker(payload):
177
178
assert not pathlib .Path ("python-coverage-comment-action.txt" ).exists ()
178
179
assert "The coverage rate went from `30%` to `86%` :arrow_up:" in comment
179
180
180
- expected_stdout = "::set-output name=COMMENT_FILE_WRITTEN::false"
181
- assert capsys .readouterr ().out .strip () == expected_stdout
181
+ expected_output = "COMMENT_FILE_WRITTEN=false\n "
182
+
183
+ assert output_file .read_text () == expected_output
182
184
183
185
184
186
def test_action__pull_request__post_comment__no_marker (
0 commit comments