We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
When an assert statement has a multi-line string, the condition is split across 3 lines for no reason.
assert
To Reproduce
For example, take this code:
assert some_var == expected_result, f""" expected: {expected_result} actual: {some_var}"""
And run it with these arguments:
$ black file.py
The resulting output is:
assert ( some_var == expected_result ), f""" expected: {expected_result} actual: {some_var}"""
Expected behavior
The condition should remain as a single line.
Environment
The text was updated successfully, but these errors were encountered:
Would not be marginally cleaner to re-format it to:
assert ( some_var == expected_result, f"""expected: {expected_result} actual: {some_var}""" )
Sorry, something went wrong.
Would not be marginally cleaner to re-format it to: assert ( some_var == expected_result, f"""expected: {expected_result} actual: {some_var}""" )
No, because that would change the meaning of the code (and make the assertion useless).
Successfully merging a pull request may close this issue.
Describe the bug
When an
assert
statement has a multi-line string, the condition is split across 3 lines for no reason.To Reproduce
For example, take this code:
And run it with these arguments:
The resulting output is:
Expected behavior
The condition should remain as a single line.
Environment
The text was updated successfully, but these errors were encountered: