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

[pylint] Fixes all use-maxplit-args, consider-using-enumerate, implicit-str-concat #12172

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Pierre-Sassoulas
Copy link
Contributor

Using maxsplit=1 from use-maxplit-args will make splits slightly faster and is the important one that will improve performances.

The other fix are about readability / style.

@Pierre-Sassoulas
Copy link
Contributor Author

Converting to draft as I need to add tests for the missing coverage

@@ -207,7 +207,7 @@ def test_visit_norecurse(self, path1):

@pytest.mark.parametrize(
"fil",
["*dir", "*dir", pytest.mark.skip("sys.version_info <" " (3,6)")(b"*dir")],
["*dir", "*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can remove this:

Suggested change
["*dir", "*dir", pytest.mark.skip("sys.version_info < (3,6)")(b"*dir")],
["*dir", "*dir", b"*dir"],

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right ! Removed the reminder for the whole codebase in 7ded8d8

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yikes, we had skip instead of skipif and the tests where broken

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for looking into it, I was stuck. I'm not sure I understand though, should I replace ["*dir", "*dir", b"*dir"], back to ["*dir", "*dir", pytest.mark.skipif("sys.version_info < (3,6)")(b"*dir")], and then fix the tests ? Maybe in another merge request at this point ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the Visitor class of the local path clone, there is a condition we need to replace
https://github.com/pytest-dev/pytest/blob/main/src/_pytest/_py/path.py#L140 - it should also check for bytes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when asottile took out a lot of cruft a basestring usage was misinterpreted and replaced with just str

unfortunately the skips where wrong and thus the error was never noted as the tests skipped instead of passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants