Merged revisions 73934 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r73934 | amaury.forgeotdarc | 2009-07-11 11:35:13 +0200 (sam., 11 juil. 2009) | 3 lines

  #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:
Amaury Forgeot d'Arc 2009-07-11 09:37:09 +00:00
parent 1caf206ac9
commit 041b3baf53
3 changed files with 17 additions and 1 deletions

View file

@ -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)