Nick Coghlan <ncogh...@gmail.com> added the comment:

OK, I've now looked into *why* the socket tests are throwing errors in 
tearDown, and it has to do with the way the threaded client/server tests in 
test_socket are set up.

Specifically, ThreadableTest uses tearDown to reraise any exception raised in 
the client thread, and these are therefore outside the scope of the 
"expectedFailure" suppression in unittest.

Now that I've tracked this down, it would be fairly straightforward to fix this 
specifically within test_socket.ThreadableTest by appropriately adjusting the 
definition of ThreadableTest.clientRun to discard exceptions encountered in 
tests flagged as expected failures.

However, I'm wondering if that's the right thing to do. Perhaps it would make 
more sense to change unittest itself so that "expectedFailure" also suppresses 
tearDown errors. It doesn't seem all that unusual for a known failing test to 
also cause problems for the tearDown code.

Added Michael to the nosy list to ask for his advice/opinion. In the meantime, 
I'll work on a patch that adjusts ThreadableTest directly.

----------
assignee:  -> ncoghlan
nosy: +michael.foord

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12958>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to