[Python-ideas] Testing with numbers
Terry Reedy
tjreedy at udel.edu
Thu Nov 3 23:39:42 CET 2011
On 11/3/2011 6:02 AM, Yuval Greenfield wrote:
> Working on algorithms that don't have just the boolean states of
> "success" or "failure", I find myself wanting to have regular unit
> tests adjacent to where I put my scalar result of how well the
> algorithm worked. E.g. the percentage of test samples failed, an x
> minus y squared sum, etc.
If I were using unittest for such, where I did not want to make each
test sample an individual test but wanted to report a collective result,
I would report the percentage (or fraction) and test equality to 100 (or
1). The test would always fail (until it passed ;-), but the actual
fraction would be printed, and could be compared to the current target.
--
Terry Jan Reedy
More information about the Python-ideas
mailing list