-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
fix(check): don't raise error on pypi reference #9475
base: main
Are you sure you want to change the base?
Conversation
e0a4ce0
to
a320010
Compare
@@ -111,19 +127,55 @@ def test_check_valid_legacy( | |||
assert tester.io.fetch_error() == expected | |||
|
|||
|
|||
def test_check_invalid( | |||
def test_check_invalid_dep_name_same_as_project_name( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for splitting (almost duplicating) the test and how is it related to the fix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old one was checking the dependency name vs project name. This is not possible with a fixture being a Poetry instance, so I moved this to another test to keep this case tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if we do not introduce the fixture, we do not have to split the test? Then, why introduce a fixture in the first place? (Further, it still seems unrelated to the test case for the fix.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to introduce the fixture because otherwise (with patching pyproject file) we get the wrong list of sources for the project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still do not get why this is an issue. We now have two almost similar tests (test_check_invalid_dep_name_same_as_project_name
and test_check_invalid
). Both provide the same errors except for that the first one provides two more errors:
Error: Project name (invalid) is same as one of its dependencies
Error: Invalid source "exists" referenced in dependencies.
And both tests are unrelated to the issue that is resolved by this PR. This is tested in test_check_does_not_error_on_pypi_reference
, which uses another fixture.
Pull Request Check List
Resolves: #9436