A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/025265.html below:

[Python-Dev] unittest and sockets. Ugh!?

[Python-Dev] unittest and sockets. Ugh!? [Python-Dev] unittest and sockets. Ugh!?Tim Peters tim.one@comcast.net
Mon, 10 Jun 2002 11:30:22 -0400
BTW, if you want to run threads with unittest, I expect you'll have to
ensure that only the thread that starts unittest reports errors to unittest.
I'll call that "the main thread".  You should be aware that if a non-main
thread dies, unittest won't know that.  A common problem in the threaded
tests PLabs has written is that a thread dies an ignoble death but unittest
goes on regardless and says "ok!" at the end; if you didn't stare at all the
output, you never would have known something went wrong.

So wrap the body of your thread's work in a catch-all try/except, and if
anything goes wrong communicate that back to the main thread.  For example,
a Queue object (one or more) could work nicely for this.





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4