News for hackers. Stuff that matters.
Re:Solving Algorithmic Problems in Python with Pytest (2019) by nanis on Saturday December 19, 2020 @09:23AM (#25477554)
> Simple: use mocker.patch to patch out random.randrange and have it return a fixed sequence of results that would imply a known result.

Thank you for this. Another way to put this is "your tests for code that uses a 3rd party API should not amount to an uptime test for the 3rd party API."

Some time ago, I observed that tests in the Boost.Accumulators library were similarly confounding tests for the code one wrote vs tests of statistical hypotheses:

https://www.nu42.com/2016/12/cpp-boost-median-test.html

There are no comments on this comment yet.