From b0dd628f07f0b96a2b2b29d5b5e9505cc3874d80 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 3 Nov 2018 19:49:13 +0000 Subject: [PATCH] issue #406: parent_test fixes, NameError in log_fd_calls(). --- tests/parent_test.py | 7 ++++--- tests/testlib.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/parent_test.py b/tests/parent_test.py index c4921c1f..e83d6f1a 100644 --- a/tests/parent_test.py +++ b/tests/parent_test.py @@ -207,6 +207,7 @@ class TtyCreateChildTest(testlib.TestCase): self.assertEquals(pid, waited_pid) self.assertEquals(0, status) self.assertEquals(mitogen.core.b(''), tf.read()) + os.close(fd) finally: tf.close() @@ -283,7 +284,7 @@ class WriteAllTest(testlib.TestCase): self.func(proc.stdin.fileno(), self.ten_ms_chunk) finally: proc.terminate() - proc.stdout.close() + proc.stdin.close() def test_deadline_exceeded_before_call(self): proc = self.make_proc() @@ -293,7 +294,7 @@ class WriteAllTest(testlib.TestCase): )) finally: proc.terminate() - proc.stdout.close() + proc.stdin.close() def test_deadline_exceeded_during_call(self): proc = self.make_proc() @@ -306,7 +307,7 @@ class WriteAllTest(testlib.TestCase): )) finally: proc.terminate() - proc.stdout.close() + proc.stdin.close() class DisconnectTest(testlib.RouterMixin, testlib.TestCase): diff --git a/tests/testlib.py b/tests/testlib.py index 8d2bd8d9..0f9a405a 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -218,7 +218,7 @@ def log_fd_calls(): real_dup = os.dup def dup(*args): with l: - rc = real_dup(*args) + rv = real_dup(*args) if mypid == os.getpid(): print print '--', args, '->', rv