-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix encoding error with print statements in doctests
#3584
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
Conversation
|
I would have added the minimal example from #3583 as a test case, but I wasn't sure how exactly to do that. Someone who knows what they're doing should probably do that. |
nicoddemus
left a comment
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.
| @@ -0,0 +1 @@ | |||
| Fix encoding error with `print` statements in doctests | |||
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.
This should be rst:
Fix encoding error with ``print`` statements in doctests.
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 is RST; reStructuredText uses single backticks for individual identifiers, while double backticks are for arbitrary inline code.
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.
Oh you are right, sorry;
We use inline code in the changelog though because there won't be any references to it in the final document (but TBH I don't remember if they render differently).
|
@nicoddemus I added a failing test case, but now the fix doesn't fix it; it was working when I tried modifying a copy of pytest in a virtualenv a few hours ago.... |
This fix was suggested by Stack Overflow user phd in <https://stackoverflow.com/a/50863820/744178>.
|
I figured out what was wrong with the test case I added (the string should have been raw); it now correctly fails before applying the fix and succeeds after. |
nicoddemus
left a comment
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.
LGTM, thanks again @jwodder!
This fixes #3583. This fix was suggested by Stack Overflow user phd in
https://stackoverflow.com/a/50863820/744178.