dgilland / pydash

The kitchen sink of Python utility libraries for doing "stuff" in a functional way. Based on the Lo-Dash Javascript library.

Home Page:http://pydash.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Delay test failing on darwin

viraptor opened this issue · comments

When running the test suite on darwin, the delay test is always just too long to pass.
Specifically:

    @parametrize(
        "func,wait,args,kargs,expected", [(lambda a, b, c: (a, b, c), 250, (1, 2), {"c": 3}, (1, 2, 3))]
    )
    def test_delay(func, wait, args, kargs, expected):
        start = time.time() * 1000
        result = _.delay(func, wait, *args, **kargs)
        stop = time.time() * 1000

>       assert (wait - 10) <= (stop - start) <= (wait + 10)
E       assert (1663478938260.7942 - 1663478937937.6729) <= (250 + 10)

The actual runtimes experienced: 321.181640625, 323.074951171875, 323.121337890625, so a bit longer than 250. (but consistently longer)

Tested on python3.10. This is making the package fail building on nixos which runs the tests on build.

This should be fixed now in v5.1.1: https://pypi.org/project/pydash/5.1.1