-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
pytest_report_teststatus
documentation is contradictory
#10872
Comments
Indeed the docs are wrong, and the annotation in the code is correct: pytest/src/_pytest/terminal.py Lines 528 to 530 in 31d0b51
The return value can be, for example: ("rerun", "R", "RERUN") Or: ("rerun", "R", ("RERUN", {"yellow": True})) This signature is like that for historical reasons unfortunately, nowadays we would use probably a dataclass. |
The possible values that can be used in the mapping are not really documented I think, they are defined here: pytest/src/_pytest/_io/terminalwriter.py Lines 42 to 63 in 31d0b51
|
makes sense, thanks for the details. |
I feel like we should do just that, and figure out a way to make it backwards compatible. If pytest itself would be the only place invoking the hook, it'd just be a matter of an |
Perhaps a named tuple would work too? |
I wonder if we could try to mirror rich styled spans and supply easy conversation This is one of the rarely used apis that tie us into the legacy terminalwriter apis |
See here:
The example return value is
"rerun", "R", ("RERUN", {"yellow": True})
, while the return type is documented aswhich don't match.
I'm assuming the return type should be
Or something?
Also some clearer documentation on how the third element of the tuple is sued would be great.
The text was updated successfully, but these errors were encountered: