unittests with different parameters

Ulrich Eckhardt ulrich.eckhardt at dominolaser.com
Mon Nov 22 18:56:14 CET 2010

Ian Kelly wrote:
> On 11/22/2010 4:38 AM, Ulrich Eckhardt wrote:
>> Also, I'd rather construct the error message from the data
>> instead of maintaining it in different places, because 
>> manually keeping those in sync is another, errorprone burden.
> I'm not sure I follow the problem you're describing.  If the factored
> out workhorse function receives the data to test, what prevents it from
> constructing an error message from that data?

Sorry, unprecise description of what I want. If you define a test function
and run the tests with "-v", the framework prints the first line of the
docstring of that function followed by okay/fail/error, which is much
friendlier to the reader than the exception dump afterwards. Using multiple
very similar functions requires equally similar docstrings that repeat
themselves. I'd prefer creating these from the input data.

Thanks for your suggestion, Ian!


Domino Laser GmbH
Geschäftsführer: Thorsten Föcking, Amtsgericht Hamburg HR B62 932

More information about the Python-list mailing list