Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pytest_plugin: disable flood protection for example tests
For quite a while, we've had three tests from the `rand` plugin that take several seconds each. I had a Sopelunk with the Git version [1] of `pytest-profiling` [2] and discovered that about 98% of the time spent on the five tests selected by `pytest -k rand.py` was in `time.sleep()`. Drilling down, I saw that was being called from `bot.say()`, which led pretty quickly to the real culprit: Flood protection. There's no server to flood during tests, so we can just turn that protection off. With this change, those five tests from `rand` went from about 12 seconds on my test system down to about 0.25 sec. [1]: The last actual release of `pytest-profiling` is from 2019, and it doesn't work on modern Python. (I started analyzing this under Python 3.13, while verifying fixes for new warnings there.) All of the necessary updates already exist in the Git repo, though; they just haven't published a new release in five years. [2]: https://github.com/man-group/pytest-plugins/tree/master/pytest-profiling
- Loading branch information