Antoine Pitrou added the comment:

That said, I agree that the __dict__ proposal is a hack, but as is the current 
_removetestAtIndex mechanism.

The only clean solution I can think of would be to have two separate classes:
- a TestSpec which contains execution-independent data about a test case, and 
knows how to instantiate it
- a TestCase that is used for the actual test execution, but isn't saved in the 
test suite

Maybe it's possible to do this without any backwards compat problem by making 
TestSuite.__iter__ always return TestCases (but freshly-created ones, from the 
inner test specs). The main point of adaptation would be 
TestLoader.loadTestsFromTestCase().

----------

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

Reply via email to