diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-06-10 16:31:39 +0100 |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-06-10 16:31:39 +0100 |
commit | a35a128accfd2b9d07029387b97995f4854bca12 (patch) | |
tree | 4de2efca771e0668d24658ffad4f323042d5ea15 /Lib/test | |
parent | cac17b4d78fdc8ad617e59281160749c91665fb3 (diff) | |
parent | 0e547b66dc206e46b69b91790aa73010290f4fcb (diff) | |
download | cpython-git-a35a128accfd2b9d07029387b97995f4854bca12.tar.gz |
Merge.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_openpty.py | 2 | ||||
-rw-r--r-- | Lib/test/test_subprocess.py | 3 | ||||
-rw-r--r-- | Lib/test/test_uuid.py | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_openpty.py b/Lib/test/test_openpty.py index 8713d34671..47851072c1 100644 --- a/Lib/test/test_openpty.py +++ b/Lib/test/test_openpty.py @@ -10,6 +10,8 @@ if not hasattr(os, "openpty"): class OpenptyTest(unittest.TestCase): def test(self): master, slave = os.openpty() + self.addCleanup(os.close, master) + self.addCleanup(os.close, slave) if not os.isatty(slave): self.fail("Slave-end of pty is not a terminal.") diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 50923e8cdb..7899aebe06 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1296,7 +1296,8 @@ class POSIXProcessTestCase(BaseTestCase): self.stderr.fileno()), msg="At least one fd was closed early.") finally: - map(os.close, devzero_fds) + for fd in devzero_fds: + os.close(fd) @unittest.skipIf(not os.path.exists("/dev/zero"), "/dev/zero required.") def test_preexec_errpipe_does_not_double_close_pipes(self): diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index 016100d407..97ad6d0c2f 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -458,6 +458,7 @@ class TestUUID(unittest.TestCase): else: os.close(fds[1]) + self.addCleanup(os.close, fds[0]) parent_value = uuid.uuid4().hex os.waitpid(pid, 0) child_value = os.read(fds[0], 100).decode('latin-1') |