Change error message to clearly relate it to pytest-timeout#180
Merged
flub merged 2 commits intopytest-dev:mainfrom May 5, 2025
Merged
Change error message to clearly relate it to pytest-timeout#180flub merged 2 commits intopytest-dev:mainfrom
flub merged 2 commits intopytest-dev:mainfrom
Conversation
Pierre-Sassoulas
previously approved these changes
Sep 28, 2024
RonnyPfannschmidt
previously approved these changes
Sep 28, 2024
Member
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
i like that the plugin name and the timeout time ar now part of the error for clarity
i wonder if we ought to set out to make the timeout a OutcomeExcpetion (like with fail/skip/xfail in core ) as a eventual followup
pytest_timeout.py
Outdated
| if nthreads > 1: | ||
| terminal.sep("+", title="Timeout") | ||
| pytest.fail("Timeout >%ss" % settings.timeout) | ||
| pytest.fail("Timeout (>%ss) from pytest-timeout plugin." % settings.timeout) |
Member
There was a problem hiding this comment.
a nitpick for consideration - the word plugin at the end may not be necessary
As suggested, removed the unecessary 'plugin' word. Also, extracted the message to a constant.
9952bd7
RonnyPfannschmidt
approved these changes
Oct 9, 2024
flub
reviewed
Oct 10, 2024
| SESSION_TIMEOUT_KEY = pytest.StashKey[float]() | ||
| SESSION_EXPIRE_KEY = pytest.StashKey[float]() | ||
|
|
||
| PYTEST_FAILURE_MESSAGE = "Timeout (>%ss) from pytest-timeout." |
Member
There was a problem hiding this comment.
Suggested change
| PYTEST_FAILURE_MESSAGE = "Timeout (>%ss) from pytest-timeout." | |
| PYTEST_FAILURE_TEMPLATE = "Timeout (>%ss) from pytest-timeout." |
maybe? It's a little confusing otherwise to me
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Is should have less than 60 chars for most timeout values and is more direct than the one I proposed in the issue.
Closes #179