mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
#6358: Merge r73933: Add basic tests for the return value of os.popen().close().
And fix the implementation to make these tests pass with py3k
This commit is contained in:
parent
15ccb3d3f7
commit
97e5f281a7
3 changed files with 17 additions and 1 deletions
|
|
@ -42,6 +42,13 @@ class PopenTest(unittest.TestCase):
|
|||
)
|
||||
support.reap_children()
|
||||
|
||||
def test_return_code(self):
|
||||
self.assertEqual(os.popen("exit 0").close(), None)
|
||||
if os.name == 'nt':
|
||||
self.assertEqual(os.popen("exit 42").close(), 42)
|
||||
else:
|
||||
self.assertEqual(os.popen("exit 42").close(), 42 << 8)
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(PopenTest)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue