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

Clean up beyond_top_level tests #7279

Merged
merged 2 commits into from
Aug 12, 2022
Merged

Conversation

DanielNoord
Copy link
Collaborator

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Write a good description on what the PR does.

Type of Changes

Type
🔨 Refactoring

Description

Closes #7252.

@DanielNoord DanielNoord added the Skip news 🔇 This change does not require a changelog entry label Aug 9, 2022
@coveralls
Copy link

coveralls commented Aug 9, 2022

Pull Request Test Coverage Report for Build 2849766793

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 95.248%

Files with Coverage Reduction New Missed Lines %
pylint/epylint.py 2 83.33%
Totals Coverage Status
Change from base Build 2849481030: -0.01%
Covered Lines: 16837
Relevant Lines: 17677

💛 - Coveralls

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.

Nice clean up, using pytest fixtures really help with tests complexity.

Comment on lines +64 to +65
# The first package fails to lint
assert len(output.split("\n")) == 1
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave this as 5 and xfail it? Tests are documentation, and I don't want to document the wrong result.

Copy link
Member

Choose a reason for hiding this comment

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

Well, maybe the result is correct if the expectation is that you have to cd to a namespace package you want to lint.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I was meaning to ask this. Is the new behavior how we want to do this? Or is this a temporary result because of improved but not perfect namespace package handling?

If this is desired (ie., you can't lint a package like this) I think it makes sense to just have this as a test itself.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for giving me time to double-check. Yes, you need to cd or otherwise do something fancy (with a hook?) if you want to find namespace packages. This matches the behavior of python's import statement, so far as I can tell. So the result is correct.

To go back to the original issue linked in these tests, we're just trying to test for the absence of no-name-in-module or relative-beyond-top-level.

Copy link
Member

Choose a reason for hiding this comment

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

I was wrong about this after all. I guess the beyond_top_two is on sys.path somewhere, so it should be linted. (I guess because tests is on sys.path?) See #7304.

Ultimately new tests should create their own isolated packages with code, to make this easier to reason about!

@jacobtylerwalls jacobtylerwalls merged commit f97a872 into pylint-dev:main Aug 12, 2022
@DanielNoord DanielNoord deleted the test branch August 13, 2022 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip news 🔇 This change does not require a changelog entry tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

epylint runner confounding results of test_relative_beyond... test methods
4 participants