[issue7897] Support parametrized tests in unittest

Michael Foord report at bugs.python.org
Thu Jul 21 12:37:00 CEST 2011


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

Well, pyflakes will tell you about name clashes within a TestCase (unless you're shadowing a test on a base class which I guess is rarely the case)...

When we generate the tests we could add the parameter reprs to the docstring. A decorator factor that takes arguments and an optional name builder seem like a reasonable api to me.

Actually, name clashes *aren't* a problem - as we're generating TestCase instances these generated tests won't shadow existing tests (you'll just have two tests with the same name - does this mean id() may not be unique - worth checking).

----------

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


More information about the Python-bugs-list mailing list