
3 Nov
2011
3 Nov
'11
3:02 a.m.
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.
As I understand it unittest doesn't have the facilities for such test cases or results.
One could useĀ assertGreater toĀ test for passing a threshold but usually the acceptable numbers are rapidly changing. When running a test, you'd want to see the resulting number instead of an F/E/. result.
Another use case is pypy speed benchmarks.
Are there others here who would/could use this?
--Yuval Greenfield