Commit 29601122 authored by Marc Sibson's avatar Marc Sibson Committed by Denis Bilenko

test__subprocess: test for check_output()

From PR #265.
parent 67d9c06a
......@@ -138,6 +138,14 @@ class Test(greentest.TestCase):
else:
raise AssertionError('must fail with ENOENT')
def test_check_output_keyword_error(self):
try:
subprocess.check_output([sys.executable, '-c', 'import sys; sys.exit(44)'])
except subprocess.CalledProcessError, e:
self.assertEqual(e.returncode, 44)
else:
raise AssertionError('must fail with CalledProcessError')
if __name__ == '__main__':
greentest.main()
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