[Python-ideas] Testing with numbers

Yuval Greenfield ubershmekel at gmail.com
Thu Nov 3 11:02:20 CET 2011


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



More information about the Python-ideas mailing list