[TIP] Plugin API for nose: Expanding one test case into many
ben+python at benfinney.id.au
Tue Jul 22 20:38:50 PDT 2008
"Kumar McMillan" <kumar.mcmillan at gmail.com> writes:
> I'm still having a hard time understanding how one would transform a
> test case into multiple copies. Typically I would do this through
> class inheritance but what I don't like about that is the test code
> starts to get obfuscated in the chain of parent classes.
The 'nose_scenario' plugin does it by adapting an individual test case
to multiple test cases when loading them. It does this for classes
that declare their scenarios through a 'scenarios' attribute.
> I read through the doc strings but I think I need an example like
> "here is a test case that has been transformed into multiple copies"
> (with actual code). I read through your tests too but it was
> importing a module called sample_scenarios and that wasn't present
> in the distribution.
You're absolutely right. (My setuptools-fu is weak.)
It is now included in version 0.1.3, now uploaded to
The modules 'test/test_*.py' are the examples to look at, as you
\ “Puritanism: The haunting fear that someone, somewhere, may be |
`\ happy.” —Henry L. Mencken |
More information about the testing-in-python