Message151432
Allowing loadTestsFromTestCase() to take either a testCaseClass
or a (testCaseClass, param) tuple, where the param is then past
to the __init__ function might do the trick. One param is sufficient, since it can
be a container for any number of params. This allows more fields
to be added to the tuple for some future, unforeseen need.
An container object for class and parameters would be a bit more
structured than a tuple.
A factory function would be the most flexible, however it seems
to go against the class introspection for discovering tests.
Then again, I don't know the code very well.
R. David Murray <report@bugs.python.org> writes:
>
> R. David Murray <rdmurray@bitdance.com> added the comment:
>
> Maybe we could add a recipe for doing this to the load_tests docs?
>
> I don't think that load_tests is going to be more readable, though, since it doesn't allow you to put the parameterization next to the class you are parameterizing (unless you do some additional hackery).
>
> But yes, if anything else is done a concrete API proposal is the first requirement.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue12600>
> _______________________________________ |
|
Date |
User |
Action |
Args |
2012-01-17 09:00:51 | diekhans | set | recipients:
+ diekhans, terry.reedy, exarkun, ncoghlan, pitrou, ezio.melotti, eric.araujo, r.david.murray, michael.foord, brian.curtin, fperez, Yaroslav.Halchenko, nchauvat, abingham, eric.snow, pere.martir |
2012-01-17 09:00:50 | diekhans | link | issue12600 messages |
2012-01-17 09:00:49 | diekhans | create | |
|