-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change error message to clearly relate it to pytest-timeout #180
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -495,7 +495,7 @@ def timeout_sigalrm(item, settings): | |||
dump_stacks(terminal) | |||
if nthreads > 1: | |||
terminal.sep("+", title="Timeout") | |||
pytest.fail("Timeout >%ss" % settings.timeout) | |||
pytest.fail("Timeout (>%ss) from pytest-timeout plugin." % settings.timeout) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -21,7 +21,7 @@ | |||
__all__ = ("is_debugging", "Settings") | |||
SESSION_TIMEOUT_KEY = pytest.StashKey[float]() | |||
SESSION_EXPIRE_KEY = pytest.StashKey[float]() | |||
|
|||
PYTEST_FAILURE_MESSAGE = "Timeout (>%ss) from pytest-timeout." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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