Michael Foord <mich...@voidspace.org.uk> added the comment:

Right, _wrapped_run is private and not intended to be overridden. 

Perhaps slightly ironically (for this particular bug report) is that the change 
was introduced to support class and module level setUp and tearDown (similar to 
the use-case it now blocks).

Another workaround would be to inherit from BaseTestSuite (which would disable 
the class and module level fixture support).

A backwards compatible change would be to rename BaseTestSuite *back* to 
TestSuite and give the current TestSuite a new name. This means that the new 
class / module level fixtures would only be supported in code that gets suites 
from the TestLoader (which uses the new class) or by creating suites using the 
new class.

The disadvantage of this approach is that it is not uncommon for test 
frameworks to create suites themselves - and doing this could 'break' tests 
using class / module fixtures.

The reason for the change is that in order to tearDown the final class and 
module level fixtures we need to know when we exit the 'top level' of a run 
from inside a suite.

Any other suggestions or ideas?

(Another idea is to add explicit setUp and tearDown hooks to the TestSuite 
object. This isn't backwards compatible but meets the direct use case. 
Obviously backwards compatibility is greatly preferable.)

----------

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

Reply via email to