~jameinel/bzr/leaking-test-experiment

Viewing all changes in revision 5251.

  • Committer: Vincent Ladeuil
  • Date: 2010-05-26 15:25:59 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20100526152559-che4hqfn4pwo8s6g
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: