Skip to content

Add regression test for #3651 #7117

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

Merged
merged 2 commits into from
Aug 21, 2022
Merged

Conversation

jacobtylerwalls
Copy link
Member

@jacobtylerwalls jacobtylerwalls commented Jul 3, 2022

Type of Changes

Type
βœ“ πŸ› Bug fix

Description

Closes #3651 with test

@jacobtylerwalls jacobtylerwalls added this to the 2.15.0 milestone Jul 3, 2022
@jacobtylerwalls
Copy link
Member Author

jacobtylerwalls commented Jul 3, 2022

Ah, ok, some test isolation issues to look into. It passes in isolation.
Now it's blocked on #4444, which has a WIP patch at #7114, but that patch breaks this test ONLY when run in the context of the full suite. So the next step (eventually) is to find out if that's a real problem or merely a test isolation issue. Marking as draft for now.

@jacobtylerwalls jacobtylerwalls added the Needs astroid update Needs an astroid update (probably a release too) before being mergable label Jul 3, 2022
@jacobtylerwalls jacobtylerwalls marked this pull request as draft July 3, 2022 15:07
@Pierre-Sassoulas
Copy link
Member

So the next step (eventually) is to find out if that's a real problem

Our custom context managers could be at fault, I'm thinking in particular of _test_sys_pathand _test_cwd that could be replaced by tmpdir.as_cwd() but I did not find the time yet (some are tricky to replace).

@jacobtylerwalls jacobtylerwalls added Skip news πŸ”‡ This change does not require a changelog entry and removed Skip news πŸ”‡ This change does not require a changelog entry labels Jul 17, 2022
@jacobtylerwalls
Copy link
Member Author

Found the test pollution issue!

@jacobtylerwalls jacobtylerwalls marked this pull request as ready for review July 17, 2022 23:10
@jacobtylerwalls jacobtylerwalls removed the request for review from Pierre-Sassoulas July 17, 2022 23:38
@jacobtylerwalls jacobtylerwalls marked this pull request as draft July 17, 2022 23:38
@github-actions
Copy link
Contributor

πŸ€– According to the primer, this change has no effect on the checked open source code. πŸ€–πŸŽ‰

This comment was generated for commit 66bda55

Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

That's a really great catch !

@jacobtylerwalls
Copy link
Member Author

This test passes for me locally, but I don't have the capacity to look into why it's failing on CI.

@DanielNoord
Copy link
Collaborator

@jacobtylerwalls Test does pass on 3.7 and raises parse-error on other interpreters. Is this using syntax that was changed in 3.8+?

@jacobtylerwalls
Copy link
Member Author

It passes locally for me on all interpreters, so something to investigate with path/cwd vagaries on CI?

@Pierre-Sassoulas
Copy link
Member

I opened Pierre-Sassoulas#157 to investigate, I don't have pypy locally so I'm going this with the CI and it's not really practical.

@DanielNoord
Copy link
Collaborator

@jacobtylerwalls I did a little investigation and I could get this to fail with pytest -k unittest_lint. The fail is related to x/__init__.py not existing. By changing the test to use linter.check(["x/y"]) the failure goes away but I'm not sure if that breaks the intention of the test. Would that be a suitable fix?

@jacobtylerwalls
Copy link
Member Author

Unfortunately yes, that would break the intention of the test.

Possibly relevant: #3651 (comment)

@DanielNoord
Copy link
Collaborator

Hm, but it seems as if the failed test is due to something else? Namespace packages not being listed correctly? If you lint x/y it does work since that is a real package. For directory x with only subdirectory y we don't recognise that it is a linkable package, isn't that expected behaviour?

@jacobtylerwalls
Copy link
Member Author

Ah, you're right!

@DanielNoord
Copy link
Collaborator

@jacobtylerwalls So, should the test be changed to close the issue? Or do we need another type of test for this issue?

@jacobtylerwalls
Copy link
Member Author

Yes, I have just pushed an update and reopened the PR. Thanks for walking me through it. (There were a lot of astroid changes recently, and I got distracted based on the author's original expectation that you could lint x.)

@jacobtylerwalls jacobtylerwalls marked this pull request as ready for review August 21, 2022 14:34
@DanielNoord DanielNoord enabled auto-merge (squash) August 21, 2022 14:35
@DanielNoord DanielNoord removed the Needs astroid update Needs an astroid update (probably a release too) before being mergable label Aug 21, 2022
@coveralls
Copy link

coveralls commented Aug 21, 2022

Pull Request Test Coverage Report for Build 2898835605

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 121 unchanged lines in 7 files lost coverage.
  • Overall coverage decreased (-0.0009%) to 95.254%

Files with Coverage Reduction New Missed Lines %
pylint/epylint.py 2 83.33%
pylint/checkers/classes/special_methods_checker.py 8 94.97%
pylint/checkers/format.py 10 96.56%
pylint/checkers/variables.py 14 97.36%
pylint/checkers/refactoring/refactoring_checker.py 16 98.19%
pylint/lint/pylinter.py 23 95.25%
pylint/checkers/classes/class_checker.py 48 94.74%
Totals Coverage Status
Change from base Build 2770034625: -0.0009%
Covered Lines: 16881
Relevant Lines: 17722

πŸ’› - Coveralls

@DanielNoord DanielNoord merged commit 3bfd075 into pylint-dev:main Aug 21, 2022
@jacobtylerwalls jacobtylerwalls deleted the issue-3651 branch August 21, 2022 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Import system Skip news πŸ”‡ This change does not require a changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Relative imports broken in pylint 2.5.2
4 participants