This patch changes the code executed when testing the signal handling
of RunCmd. Since sh does not always point to bash (e.g. on Ubuntu,
where it points to /bin/dash) this test might fail due to the returned
exit code is different so the received signal is not correctly
detected.
Additionally fix the docstring of testSignal.
(This is a backport from trunk)
Reviewed-by: iustinp
From: Manuel Franceschini <manuel.franceschini@gmail.com>
self.assertEqual(result.output, "A" + self.magic + "B" + self.magic)
def testSignal(self):
- """Test standard error"""
- result = RunCmd("/bin/sh -c 'kill -15 $$'")
+ """Test signal"""
+ result = RunCmd(["python", "-c", "import os; os.kill(os.getpid(), 15)"])
self.assertEqual(result.signal, 15)
def testListRun(self):