Skip to content

Commit

Permalink
Fix division by zero in asv continuous
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Jun 27, 2015
1 parent 1d84c83 commit c74a558
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion asv/commands/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ def run(cls, conf, branch=None, base=None, factor=2.0, show_stderr=False, bench=
table = []
slowed_down = False
for name, benchmark in six.iteritems(all_benchmarks):
change = after[name] / before[name]
if before[name] == 0:
if after[name] == 0:
change = 1.0
else:
change = float('inf')
else:
change = after[name] / before[name]

if change > factor or change < 1.0 / factor:
table.append(
(change, before[name], after[name], name, benchmark))
Expand Down

0 comments on commit c74a558

Please sign in to comment.