Issue #1 resolved

Benchmark: ZeroDivisionError

Andriy Kornatskyy
repo owner created an issue
=================================== FAILURES ===================================
__________________ [doctest] wheezy.core.benchmark.Benchmark ___________________
034     """ Measure execution time of your code.
035 
036         >>> def test_1():
037         ...     pass
038         >>> def test_2():
039         ...     pass
040         >>> b = Benchmark((test_1, test_2), 1000)
041         >>> b.report() # doctest: +ELLIPSIS
UNEXPECTED EXCEPTION: ZeroDivisionError('float division',)
Traceback (most recent call last):

  File "/usr/local/lib/python2.5/doctest.py", line 1228, in __run
    compileflags, 1) in test.globs

  File "<doctest wheezy.core.benchmark.Benchmark[3]>", line 1, in <module>

  File "src/wheezy/core/benchmark.py", line 90, in report
    base_relative = round(base / result, 3)

ZeroDivisionError: float division

src/wheezy/core/benchmark.py:41: UnexpectedException
!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!

Comments (1)

  1. Log in to comment