From bf001967488065e6e396767d77e8c82855e4eb4f Mon Sep 17 00:00:00 2001 From: twangboy Date: Thu, 6 Mar 2025 11:09:48 -0700 Subject: [PATCH] Only run powershell tests on Windows --- tests/pytests/unit/modules/test_cmdmod.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/pytests/unit/modules/test_cmdmod.py b/tests/pytests/unit/modules/test_cmdmod.py index e15528aa1c3..5501d8a0517 100644 --- a/tests/pytests/unit/modules/test_cmdmod.py +++ b/tests/pytests/unit/modules/test_cmdmod.py @@ -1057,6 +1057,7 @@ def test_runas_env_sudo_group(bundled): ) +@pytest.mark.skip_unless_on_windows def test_prep_powershell_cmd_no_powershell(): with pytest.raises(CommandExecutionError): cmdmod._prep_powershell_cmd( @@ -1072,6 +1073,7 @@ def test_prep_powershell_cmd_no_powershell(): ("try {this} catch {that}", "try {this} catch {that}"), ], ) +@pytest.mark.skip_unless_on_windows def test_prep_powershell_cmd(cmd, parsed): """ Tests _prep_powershell_cmd returns correct cmd @@ -1095,6 +1097,7 @@ def test_prep_powershell_cmd(cmd, parsed): assert ret == expected +@pytest.mark.skip_unless_on_windows def test_prep_powershell_cmd_encoded(): """ Tests _prep_powershell_cmd returns correct cmd when encoded_cmd=True @@ -1120,6 +1123,7 @@ def test_prep_powershell_cmd_encoded(): assert ret == expected +@pytest.mark.skip_unless_on_windows def test_prep_powershell_cmd_script(): """ Tests _prep_powershell_cmd returns correct cmd when called from cmd.script @@ -1153,6 +1157,7 @@ def test_prep_powershell_cmd_script(): ('{"foo": "bar"}', '{"foo": "bar"}'), # Should leave unchanged ], ) +@pytest.mark.skip_unless_on_windows def test_prep_powershell_json(text, expected): """ Make sure the output is valid json