issue #406: parent_test fixes, NameError in log_fd_calls().

issue260
David Wilson 6 years ago
parent 375182b71b
commit b0dd628f07

@ -207,6 +207,7 @@ class TtyCreateChildTest(testlib.TestCase):
self.assertEquals(pid, waited_pid) self.assertEquals(pid, waited_pid)
self.assertEquals(0, status) self.assertEquals(0, status)
self.assertEquals(mitogen.core.b(''), tf.read()) self.assertEquals(mitogen.core.b(''), tf.read())
os.close(fd)
finally: finally:
tf.close() tf.close()
@ -283,7 +284,7 @@ class WriteAllTest(testlib.TestCase):
self.func(proc.stdin.fileno(), self.ten_ms_chunk) self.func(proc.stdin.fileno(), self.ten_ms_chunk)
finally: finally:
proc.terminate() proc.terminate()
proc.stdout.close() proc.stdin.close()
def test_deadline_exceeded_before_call(self): def test_deadline_exceeded_before_call(self):
proc = self.make_proc() proc = self.make_proc()
@ -293,7 +294,7 @@ class WriteAllTest(testlib.TestCase):
)) ))
finally: finally:
proc.terminate() proc.terminate()
proc.stdout.close() proc.stdin.close()
def test_deadline_exceeded_during_call(self): def test_deadline_exceeded_during_call(self):
proc = self.make_proc() proc = self.make_proc()
@ -306,7 +307,7 @@ class WriteAllTest(testlib.TestCase):
)) ))
finally: finally:
proc.terminate() proc.terminate()
proc.stdout.close() proc.stdin.close()
class DisconnectTest(testlib.RouterMixin, testlib.TestCase): class DisconnectTest(testlib.RouterMixin, testlib.TestCase):

@ -218,7 +218,7 @@ def log_fd_calls():
real_dup = os.dup real_dup = os.dup
def dup(*args): def dup(*args):
with l: with l:
rc = real_dup(*args) rv = real_dup(*args)
if mypid == os.getpid(): if mypid == os.getpid():
print print
print '--', args, '->', rv print '--', args, '->', rv

Loading…
Cancel
Save