diff options
| author | Silvan Mosberger <contact@infinisil.com> | 2020-02-18 02:18:39 +0100 |
|---|---|---|
| committer | Silvan Mosberger <contact@infinisil.com> | 2020-02-18 02:18:39 +0100 |
| commit | 3265f2755d16c0a3dfc9f1feee39722ddc11ee80 (patch) | |
| tree | 5cd86b8ae3618623770d8e56011a1244795ee7ab | |
| parent | fd6c59d0b4b530c711a3e34702b166f285e33629 (diff) | |
| download | python-decorator-git-3265f2755d16c0a3dfc9f1feee39722ddc11ee80.tar.gz | |
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
| -rw-r--r-- | src/tests/documentation.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |
