diff --git a/changelog/62152.fixed b/changelog/62152.fixed new file mode 100644 index 00000000000..752188afe75 --- /dev/null +++ b/changelog/62152.fixed @@ -0,0 +1 @@ +Make sure lingering PAexec-*.exe files in the Windows directory are cleaned up diff --git a/tests/pytests/unit/utils/test_cloud.py b/tests/pytests/unit/utils/test_cloud.py index 52c53801eaf..2db288af580 100644 --- a/tests/pytests/unit/utils/test_cloud.py +++ b/tests/pytests/unit/utils/test_cloud.py @@ -210,6 +210,8 @@ def test_run_psexec_command_cleanup_lingering_paexec(): pytest.importorskip("pypsexec.client", reason="Requires PyPsExec") mock_psexec = patch("salt.utils.cloud.PsExecClient", autospec=True) mock_scmr = patch("salt.utils.cloud.ScmrService", autospec=True) + # We're mocking 'remove_service' because all we care about is the cleanup + # command mock_rm_svc = patch("salt.utils.cloud.Client.remove_service", autospec=True) with mock_psexec as mock_client, mock_scmr, mock_rm_svc: mock_client.return_value.session = MagicMock(username="Gary")