summaryrefslogtreecommitdiff
path: root/Lib/test/test_posix.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-04-10 23:32:12 +0000
committerAntoine Pitrou <solipsis@pitrou.net>2010-04-10 23:32:12 +0000
commitbba8f2d10a6d513650a05b821d1c69f86d29cdef (patch)
tree0d6ef2e5a7e942c10b17007547b687a1e20bdd45 /Lib/test/test_posix.py
parent16e026cc943460b83a08c058ba4e87c5abf36215 (diff)
downloadcpython-git-bba8f2d10a6d513650a05b821d1c69f86d29cdef.tar.gz
Revert temporary commit in r79937
Diffstat (limited to 'Lib/test/test_posix.py')
-rw-r--r--Lib/test/test_posix.py24
1 files changed, 3 insertions, 21 deletions
diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py
index 3caf82493f..afeb616ddc 100644
--- a/Lib/test/test_posix.py
+++ b/Lib/test/test_posix.py
@@ -280,29 +280,11 @@ class PosixTester(unittest.TestCase):
if hasattr(posix, 'strerror'):
self.assertTrue(posix.strerror(0))
- def check_pipe_func(self, pipe_func):
- master_fd, slave_fd = pipe_func()
- try:
- # Simulate a subprocess writing some data to the
- # slave end of the pipe, and then exiting.
- data = b'TEST DATA'
- try:
- os.write(slave_fd, data)
- finally:
- os.close(slave_fd)
- # Request more data than available
- gotdata = os.read(master_fd, len(data) + 1)
- self.assertEqual(gotdata, data)
- finally:
- os.close(master_fd)
-
def test_pipe(self):
if hasattr(posix, 'pipe'):
- self.check_pipe_func(posix.pipe)
-
- def test_openpty(self):
- if hasattr(posix, 'openpty'):
- self.check_pipe_func(posix.openpty)
+ reader, writer = posix.pipe()
+ os.close(reader)
+ os.close(writer)
def test_tempnam(self):
if hasattr(posix, 'tempnam'):