[TIP] Using one unit test with different input parameters
bignose+hates-spam at benfinney.id.au
Sat Jul 12 07:14:33 PDT 2008
Robert Collins <robertc at robertcollins.net> writes:
> You might like to look at bzrlib.tests.TestScenarioApplier.
I've now migrated to this approach in a pilot project; it's working
well, and I'll likely use it elsewhere. Thank you.
It helps a lot that Bazaar is licensed under GPL :-)
> When run, you'll have test ids like:
> Which is much nicer for debugging [than] a for loop within a single test.
Those id values certainly would make it simpler to identify test
cases. I don't know how to get them via the standard unittest
I see that 'TestCase.id' is a method provided already by
'unittest.TestCase', and you're overriding it in the generated test
What I don't see is anything that actually *uses* this method. I can
find nothing in the standard library 'unittest' module that actually
How are you getting these values at run time? A custom TestRunner
\ “It is far better to grasp the universe as it really is than to |
`\ persist in delusion, however satisfying and reassuring.” —Carl |
_o__) Sagan |
More information about the testing-in-python