Replies: 2 comments 2 replies
-
Well, since no one had any comments, I've gone ahead and released this as a plugin on PyPI: https://github.com/jwodder/pytest-fail-slow. If there is anything wrong with the code above, post an issue on the repository. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Let me note that there's pytest-timeout too, which can also take care of interrupting the test. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've written the following pytest hook (currently just for inclusion in a project's
conftest.py
) for marking an otherwise-passing test as failed if it takes too long to run. It seems to work correctly, but I feel the need for input from pytest experts before I go using it in the wild. Are there any cases that this fails to handle correctly or anything I should know about doing this sort of thing? (Also, minor side question: is there a way to make a custom message for failed slow tests appear in the "short test summary info" at the end of the pytest output? Currently, the tests failed by this hook just show up as "FAILED " there, which isn't very helpful.)Beta Was this translation helpful? Give feedback.
All reactions