[issue7897] Support parametrized tests in unittest

Michael Foord report at bugs.python.org
Wed Jul 20 16:03:26 CEST 2011


Michael Foord <michael at voidspace.org.uk> added the comment:

*If* we add this to unittest then we need to decide between test load time parameterised tests and test run time parameterisation. 

Load time is more backwards compatible / easier (all tests can be generated at load time and the number of tests can be known). Run time is more useful. (With load time parameterisation the danger is that test generation can fail so we need to have the test run not bomb out in this case.)

A hack for run time parameterisation is to have all tests represented by a single test but generate a single failure that represents all the failures. I think this would be an acceptable approach. It could still be done with a decorator.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7897>
_______________________________________


More information about the Python-bugs-list mailing list