On Wed, Jul 7, 2010 at 15:31, Nick Coghlan <ncogh...@gmail.com> wrote: > On Thu, Jul 8, 2010 at 7:56 AM, Michael Foord <fuzzy...@voidspace.org.uk> > wrote: >> Using a class decorator to duplicate each _test_ into two test_* methods >> sounds like a good approach. > > Note that parameterised methods have a similar problem to > parameterised modules - unittest results are reported in terms of > "testmodule.testclass.testfunction", so proper attribution of results > in the test output will require additional work. The separate > subclasses approach doesn't share this issue, since it changes the > value of the second item in accordance with the module under test.
This is why a new method would need to be created with a special suffix to delineate what module the test was called with. So instead of testclass specifying what module was used, it would be testfunction. I guess it becomes a question of what boilerplate you prefer. One nice benefit of the class decorator that I can think of is it could handle the import trickery for you so you wouldn't even need to worry about that issue. This could also allow the decorator to not bother running the tests twice if the extension helper was not available. -Brett > > Cheers, > Nick. > > -- > Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia > _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com