~bzr-pqm/bzr/bzr.dev

Viewing all changes in revision 5247.2.4.

Add an event to ThreadWithException that can be shared with the calling thread.

* bzrlib/tests/test_server.py:
(ThreadWithException.__init__): Add an 'event' parameter that can
be shared with the caller.
(ThreadWithException.run): Sset the event once the exception has
been recorded so we can release the caller and provide the
exception.
(ThreadWithException.join): Properly raise the recorded exception.

* bzrlib/tests/test_http.py:
(TestHTTPServer.test_force_invalid_protocol): Just rely on
assertRaises or we don't get the traceback on error.
(TestHTTPServer.test_server_start_and_stop): Cleanup.

* bzrlib/tests/http_server.py:
(HttpServer._http_start): Simplified.
(HttpServer.start_server): Leave the ThreadWithException do its
work.
(HttpServer.stop_server): Shutdown the server only if it was
started.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: