Changeset 391 for python/trunk/Lib/test/test_popen2.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/test/test_popen2.py
r2 r391 13 13 import popen2 14 14 15 from test.test_support import TestSkipped,run_unittest, reap_children15 from test.test_support import run_unittest, reap_children 16 16 17 17 if sys.platform[:4] == 'beos' or sys.platform[:6] == 'atheos': … … 19 19 # to avoid mixing "posix" fork & exec with native threads, and 20 20 # they may be right about that after all. 21 raise TestSkipped("popen2() doesn't work on " + sys.platform)21 raise unittest.SkipTest("popen2() doesn't work on " + sys.platform) 22 22 23 23 # if we don't have os.popen, check that … … 51 51 inst.wait() 52 52 popen2._cleanup() 53 self.assertFalse(popen2._active, "_active not empty") 53 self.assertFalse(popen2._active, "popen2._active not empty") 54 # The os.popen*() API delegates to the subprocess module (on Unix) 55 import subprocess 56 for inst in subprocess._active: 57 inst.wait() 58 subprocess._cleanup() 59 self.assertFalse(subprocess._active, "subprocess._active not empty") 54 60 reap_children() 55 61 … … 58 64 w.close() 59 65 got = r.read() 60 self.assertEqual s(expected_out, got.strip(), "wrote %r read %r" %61 66 self.assertEqual(expected_out, got.strip(), "wrote %r read %r" % 67 (teststr, got)) 62 68 63 69 if e is not None: … … 85 91 w, r = os.popen2(["echo", self.teststr]) 86 92 got = r.read() 87 self.assertEqual s(got, self.teststr + "\n")93 self.assertEqual(got, self.teststr + "\n") 88 94 89 95 w, r = os.popen2(self.cmd) … … 98 104 w, r, e = os.popen3(["echo", self.teststr]) 99 105 got = r.read() 100 self.assertEqual s(got, self.teststr + "\n")106 self.assertEqual(got, self.teststr + "\n") 101 107 got = e.read() 102 108 self.assertFalse(got, "unexpected %r on stderr" % got) … … 112 118 w, r = os.popen4(["echo", self.teststr]) 113 119 got = r.read() 114 self.assertEqual s(got, self.teststr + "\n")120 self.assertEqual(got, self.teststr + "\n") 115 121 116 122 w, r = os.popen4(self.cmd)
Note:
See TracChangeset
for help on using the changeset viewer.