Kaydet (Commit) 9175742e authored tarafından Amaury Forgeot d'Arc's avatar Amaury Forgeot d'Arc

Add basic tests for the return value of os.popen().close().

According to #6358, python 3.0 has a different implementation that behaves differently.
üst ef6007c1
......@@ -40,6 +40,13 @@ class PopenTest(unittest.TestCase):
)
test_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():
test_support.run_unittest(PopenTest)
......
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