Robert Collins added the comment:

I'd argue for 
 - An error - its not covered by the decorator.
 - An error - the last two are not covered by the decorator.
 - An error - the last two are not covered by the decorator.
 - An error - the exception isn't a 'failure' [today - we should revisit this 
but its a separate issue to the code coverage aspect and the last two aren't 
covered by the decorator.

Perhaps I'm infected by knowing too much about the plumbing, but we can make 
things *super* complex (both implementation and reasoning-about-for-users) if 
we are too clever - and making the decorator affect multiple different methods 
is very much across that line IMO.

"If the test itself fails as expected, then I'm OK with cleanup code also 
failing as a consequence."

I'm not unless we've got a really specific reason to be OK with it - in my 
experience that will mask nasty things like leaked temp files which can have 
bad consequences - and because its masked its then hard for developers to 
diagnose. So its bad all around.

"However, I'd also be OK with the simpler model that treats the decorator as 
covering the whole setUp/test/cleanUp/tearDown cycle, in which case an 
exception from *any* of those methods would be categorised as satisfying the 
"expected failure" decorator."

So - I think a simpler still model which is that the decorator covers the 
decorated code is better still, as it doesn't need any explanation about how 
its different to regular python decorators.

----------

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

Reply via email to