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
[RFC] assert: keep "where … and …" output in verbose mode #5933
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -472,7 +472,7 @@ def pytest_unconfigure(config): | |
# ------------------------------------------------------------------------- | ||
|
||
|
||
def pytest_assertrepr_compare(config, op, left, right): | ||
def pytest_assertrepr_compare(config, op, left, right, expl): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please update the docstring with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would need more updating in general then, especially for when we go with the return-string-to-skip special postprocessing approach. |
||
"""return explanation for comparisons in failing assert expressions. | ||
|
||
Return None for no custom explanation, otherwise return a list | ||
|
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.
Sorry, I don't get the
"\n~"
part...? 🤔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.
It mimics https://github.com/blueyed/pytest/blob/1543a16330a5be10022505429b66608e7ee0ed19/src/_pytest/assertion/__init__.py#L139 (which is skipped for strings).
It's the "mini language" used with https://github.com/blueyed/pytest/blob/1543a16330a5be10022505429b66608e7ee0ed19/src/_pytest/assertion/util.py#L59-L91.