
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

On 11/3/2011 6:02 AM, Yuval Greenfield wrote:
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

On 11/3/2011 6:02 AM, Yuval Greenfield wrote:
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
participants (2)
-
Terry Reedy
-
Yuval Greenfield