Skip to content
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

Failed to create fix for PytestCompositeAssertion: Unable to fix multiline statement #6812

Closed
qarmin opened this issue Aug 23, 2023 · 1 comment · Fixed by #6829
Closed
Assignees
Labels
fuzzer Surfaced via fuzzing. needs-decision Awaiting a decision from a maintainer

Comments

@qarmin
Copy link

qarmin commented Aug 23, 2023

Ruff 0.0.285 (latest changes from main branch)

ruff  *.py --select ALL --no-cache

file content:

class TokenTests(unittest.TestCase):
                try:
                    x = eval(s)
                except OverflowError:
                    self.fail("OverflowError on huge integer literal %r" % s)
            for _s in "9223372036854775808", "0o2000000000000000000000", \
                     "0b100000000000000000000000000000000000000000000000000000000000000":
        x = ""; y = ""; assert len(x) == 0 and x == y

error:

Failed to create fix for PytestCompositeAssertion: Unable to fix multiline statement

PY_FILE_TEST_14908435400.py.zip

@charliermarsh
Copy link
Member

In this case, this is expected, so we should probably avoid showing this message at all.

@charliermarsh charliermarsh added fuzzer Surfaced via fuzzing. needs-decision Awaiting a decision from a maintainer labels Aug 23, 2023
@charliermarsh charliermarsh self-assigned this Aug 23, 2023
charliermarsh added a commit that referenced this issue Aug 23, 2023
## Summary

These fixes will _always_ fail, so we should avoid trying to construct
them in the first place.

Closes #6812.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzzer Surfaced via fuzzing. needs-decision Awaiting a decision from a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants