fortpy icon indicating copy to clipboard operation
fortpy copied to clipboard

ZeroDivisionError: float division by zero when comparing test outputs

Open wsmorgan opened this issue 10 years ago • 1 comments

Traceback (most recent call last): File "/Users/wileymorgan/.virtualenvs/fortpy/bin/runtests.py", line 91, in initialize() File "/Users/wileymorgan/.virtualenvs/fortpy/bin/runtests.py", line 51, in initialize print_result(idk, result[idk].percent, timestr, result[idk].common) File "/Users/wileymorgan/.virtualenvs/fortpy/lib/python2.7/site-packages/fortpy/testing/tester.py", line 302, in percent return float(total) / (len(self.cases) + self.failure_count) ZeroDivisionError: float division by zero

wsmorgan avatar Jun 08 '15 18:06 wsmorgan

The only way this can happen is if fortpy doesn't find any test cases to report on (probably an error in the test XML). I added a check for it so that if no cases are present it will return 0 percent success (and 0 for common property as well). Check present in revision 1.6.0.

We will need more context to deal with the underlying problem: why didn't the cases get recognized?

rosenbrockc avatar Jun 10 '15 21:06 rosenbrockc