Skip to content

Commit 04ba026

Browse files
committed
fix (CI): Use psutil.AccessDenied rather than the base class psutil.Error when mocking
1 parent f89028c commit 04ba026

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DIRAC/FrameworkSystem/Agent/test/Test_ComponentSupervisionAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ def test_restartInstance(self):
446446
psMock = self.getPSMock()
447447
psMock.Process = MagicMock("RaisingProc")
448448
psMock.Error = psutil.Error
449-
psMock.Process.side_effect = psutil.Error()
449+
psMock.Process.side_effect = psutil.AccessDenied()
450450
with patch("DIRAC.FrameworkSystem.Agent.ComponentSupervisionAgent.psutil", new=psMock):
451451
res = self.restartAgent.restartInstance(12345, "agentX", True)
452452
self.assertFalse(res["OK"])

0 commit comments

Comments
 (0)