Commit 01fd6005 authored by Manuel Franceschini's avatar Manuel Franceschini
Browse files

Make testSignal unittest not depend on default shell

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.

Reviewed-by: iustinp
parent 8d528b7c
......@@ -155,8 +155,8 @@ class TestRunCmd(unittest.TestCase):
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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment