From 3265f2755d16c0a3dfc9f1feee39722ddc11ee80 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 18 Feb 2020 02:18:39 +0100 Subject: Don't use strictly larger for warn_slow test In certain circumstances the time difference can be 0, which previously causes the test to fail, e.g. https://github.com/NixOS/nixpkgs/issues/75554 --- src/tests/documentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/documentation.py b/src/tests/documentation.py index 2256fea..9dd843a 100644 --- a/src/tests/documentation.py +++ b/src/tests/documentation.py @@ -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 -- cgit v1.2.1