Commit bfcdcf92 authored by Benjamin Peterson's avatar Benjamin Peterson

merge heads

parents 5cc10b00 08c719eb
...@@ -630,9 +630,11 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -630,9 +630,11 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
if test is None: if test is None:
finished += 1 finished += 1
continue continue
accumulate_result(test, result)
if not quiet: if not quiet:
print("[{1:{0}}{2}] {3}".format( print("[{1:{0}}{2}/{3}] {4}".format(
test_count_width, test_index, test_count, test)) test_count_width, test_index, test_count,
len(bad), test))
if stdout: if stdout:
print(stdout) print(stdout)
if stderr: if stderr:
...@@ -642,7 +644,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -642,7 +644,6 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
raise KeyboardInterrupt # What else? raise KeyboardInterrupt # What else?
if result[0] == CHILD_ERROR: if result[0] == CHILD_ERROR:
raise Exception("Child error on {}: {}".format(test, result[1])) raise Exception("Child error on {}: {}".format(test, result[1]))
accumulate_result(test, result)
test_index += 1 test_index += 1
except KeyboardInterrupt: except KeyboardInterrupt:
interrupted = True interrupted = True
...@@ -652,8 +653,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False, ...@@ -652,8 +653,8 @@ def main(tests=None, testdir=None, verbose=0, quiet=False,
else: else:
for test_index, test in enumerate(tests, 1): for test_index, test in enumerate(tests, 1):
if not quiet: if not quiet:
print("[{1:{0}}{2}] {3}".format( print("[{1:{0}}{2}/{3}] {4}".format(
test_count_width, test_index, test_count, test)) test_count_width, test_index, test_count, len(bad), test))
sys.stdout.flush() sys.stdout.flush()
if trace: if trace:
# If we're tracing code coverage, then we don't exit with status # If we're tracing code coverage, then we don't exit with status
......
...@@ -893,14 +893,29 @@ if threading: ...@@ -893,14 +893,29 @@ if threading:
def handle(self): def handle(self):
self.server._handler(self) self.server._handler(self)
def finish(self):
data = self.wfile.getvalue()
try:
super(DelegatingUDPRequestHandler, self).finish()
except socket.error:
msg = ('Error during finish, while sending %r, '
'closed = %s')
print(msg % (data, self.server._closed), file=sys.stderr)
raise
ThreadingUDPServer.__init__(self, addr, DelegatingUDPRequestHandler, ThreadingUDPServer.__init__(self, addr, DelegatingUDPRequestHandler,
bind_and_activate) bind_and_activate)
ControlMixin.__init__(self, handler, poll_interval) ControlMixin.__init__(self, handler, poll_interval)
self._closed = False
def server_bind(self): def server_bind(self):
super(TestUDPServer, self).server_bind() super(TestUDPServer, self).server_bind()
self.port = self.socket.getsockname()[1] self.port = self.socket.getsockname()[1]
def server_close(self):
super(TestUDPServer, self).server_close()
self._closed = True
# - end of server_helper section # - end of server_helper section
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment