mplanchard / pydecor

Easy peasy Python decorators
MIT License
32 stars 6 forks source link

Make TimedCache tests not time-dependent #3

Open mplanchard opened 7 years ago

mplanchard commented 7 years ago

Sometimes Travis is slower than others, and it's always slower than my machine, so the 0.005 seconds given to do some of the operations pre-cache invalidation in the tests isn't always enough. Rather than bumping it again, I'd prefer to do some mocking so that the test isn't actually time dependent, maybe use side_effect to return appropriate values for time.time() as the test progresses.