summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_popen.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_popen.py b/Lib/test/test_popen.py
index d728792..99ad41d 100644
--- a/Lib/test/test_popen.py
+++ b/Lib/test/test_popen.py
@@ -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)