-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
New version removes blank in doctest, so all doctests fail. #1654
Comments
Thanks for your report! I agree Black should do better here but bear in mind that your doctests are very brittle as is. If you tell your text editor (or |
That makes sense. However, we love using doctests for both documentation and very simple testing. Using |
Another option is the
or
|
This prevents using two trailing spaces (line break) in Markdown docstrings 😕 |
Ah, found a more recent issue for this: #3306 |
Curiously black 24.2.0 does not treat trailing whitespace in all doctests equally, consider this test case: black 24.2.0 does not alter the module level doctest, just the function doctest. ruff lint 0.3.1 alters both, reported as astral-sh/ruff#10275 |
@peterjc Black doesn't format module docstrings in their stable style (it's a recent preview style addition), whereas Ruff shipped module docstring formatting in the latest stable release. # Input
"""test
"""
# Black stable
"""test
"""
# Black preview
"""test"""
# Ruff
"""test""" |
Description
After updating from 19.10b0 to 20.8, black removes trailing whitespaces in our doctests (that Pandas returns), so all the doctests fail. In the example below, the trailing blank is after "Texthero" in the doctest's output.
To Reproduce
Create a file
python3 main.py -v
-> they passExpected behavior
Black should not remove the trailing blank in the doctests.
Environment.
Does this bug also happen on master?
Yes
The text was updated successfully, but these errors were encountered: