Skip to content

Commit 3bbb31f

Browse files
committed
Added tests for DeprecationWarning
1 parent fa6f385 commit 3bbb31f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_github_action_utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ def test_set_output(tmpdir: Any) -> None:
257257
)
258258

259259

260+
def test_set_output_deprecation_warning(tmpdir: Any) -> None:
261+
file = tmpdir.join("output_file")
262+
263+
with pytest.deprecated_call():
264+
with mock.patch.dict(os.environ, {"GITHUB_OUTPUT": file.strpath}):
265+
gha_utils.set_output("test", "test", use_subprocess=True)
266+
267+
260268
def test_save_state(tmpdir: Any) -> None:
261269
file = tmpdir.join("state_file")
262270

@@ -272,6 +280,14 @@ def test_save_state(tmpdir: Any) -> None:
272280
)
273281

274282

283+
def test_save_state_deprecation_warning(tmpdir: Any) -> None:
284+
file = tmpdir.join("state_file")
285+
286+
with pytest.deprecated_call():
287+
with mock.patch.dict(os.environ, {"GITHUB_STATE": file.strpath}):
288+
gha_utils.save_state("test", "test", use_subprocess=True)
289+
290+
275291
@mock.patch.dict(os.environ, {"STATE_test_state": "test", "abc": "another test"})
276292
def test_get_state() -> None:
277293
assert gha_utils.get_state("test_state") == "test"

0 commit comments

Comments
 (0)