Skip to content

Commit

Permalink
Don't use strictly larger for warn_slow test
Browse files Browse the repository at this point in the history
In certain circumstances the time difference can be 0, which previously
causes the test to fail, e.g. NixOS/nixpkgs#75554
  • Loading branch information
infinisil committed Feb 18, 2020
1 parent fd6c59d commit 3265f27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tests/documentation.py
Expand Up @@ -1869,7 +1869,7 @@ def warn_slow(func, duration=0, *args, **kwargs):
t0 = time.time()
res = func(*args, **kwargs)
dt = time.time() - t0
if dt > duration:
if dt >= duration:
print('%s is slow' % func.__name__)
return res

Expand Down

0 comments on commit 3265f27

Please sign in to comment.