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

Fix tests broken by Setuptools 69.0.3 which now preserves underscores in egg_info #12458

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/functional/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def test_check_complicated_name_missing(script: PipTestEnvironment) -> None:

# Without dependency
result = script.pip("install", "--no-index", package_a_path, "--no-deps")
assert "Successfully installed package-A-1.0" in result.stdout, str(result)
assert "Successfully installed package_A-1.0" in result.stdout, str(result)
Copy link
Member

Choose a reason for hiding this comment

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

maybe we should do a regex match so the pip test suite is not dependent on setuptools>=69 ?

Copy link
Member

Choose a reason for hiding this comment

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

or a simple or

Copy link
Member Author

@ichard26 ichard26 Jan 14, 2024

Choose a reason for hiding this comment

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

Haha, I totally forgot about that. I'm glad you picked this up. Thanks! 🙂


result = script.pip("check", expect_error=True)
expected_lines = ("package-a 1.0 requires dependency-b, which is not installed.",)
Expand All @@ -142,7 +142,7 @@ def test_check_complicated_name_broken(script: PipTestEnvironment) -> None:

# With broken dependency
result = script.pip("install", "--no-index", package_a_path, "--no-deps")
assert "Successfully installed package-A-1.0" in result.stdout, str(result)
assert "Successfully installed package_A-1.0" in result.stdout, str(result)

result = script.pip(
"install",
Expand Down Expand Up @@ -175,7 +175,7 @@ def test_check_complicated_name_clean(script: PipTestEnvironment) -> None:
)

result = script.pip("install", "--no-index", package_a_path, "--no-deps")
assert "Successfully installed package-A-1.0" in result.stdout, str(result)
assert "Successfully installed package_A-1.0" in result.stdout, str(result)

result = script.pip(
"install",
Expand Down Expand Up @@ -203,7 +203,7 @@ def test_check_considers_conditional_reqs(script: PipTestEnvironment) -> None:
)

result = script.pip("install", "--no-index", package_a_path, "--no-deps")
assert "Successfully installed package-A-1.0" in result.stdout, str(result)
assert "Successfully installed package_A-1.0" in result.stdout, str(result)

result = script.pip("check", expect_error=True)
expected_lines = ("package-a 1.0 requires dependency-b, which is not installed.",)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_install_vcs_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ def test_git_with_ambiguous_revs(script: PipTestEnvironment) -> None:
assert "Could not find a tag or branch" not in result.stdout
# it is 'version-pkg' instead of 'version_pkg' because
# egg-link name is version-pkg.egg-link because it is a single .py module
result.assert_installed("version-pkg", with_files=[".git"])
result.assert_installed("version_pkg", with_files=[".git"])


def test_editable__no_revision(script: PipTestEnvironment) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_new_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ def test_new_resolver_succeeds_on_matching_constraint_and_requirement(

script.assert_installed(test_pkg="0.1.0")
if editable:
assert_editable(script, "test-pkg")
assert_editable(script, "test_pkg")


def test_new_resolver_applies_url_constraint_to_dep(script: PipTestEnvironment) -> None:
Expand Down
8 changes: 4 additions & 4 deletions tests/functional/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def test_show_required_by_packages_basic(
lines = result.stdout.splitlines()

assert "Name: simple" in lines
assert "Required-by: requires-simple" in lines
assert "Required-by: requires_simple" in lines


def test_show_required_by_packages_capitalized(
Expand All @@ -294,7 +294,7 @@ def test_show_required_by_packages_capitalized(
lines = result.stdout.splitlines()

assert "Name: simple" in lines
assert "Required-by: Requires-Capitalized" in lines
assert "Required-by: Requires_Capitalized" in lines


def test_show_required_by_packages_requiring_capitalized(
Expand All @@ -314,8 +314,8 @@ def test_show_required_by_packages_requiring_capitalized(
lines = result.stdout.splitlines()
print(lines)

assert "Name: Requires-Capitalized" in lines
assert "Required-by: requires-requires-capitalized" in lines
assert "Name: Requires_Capitalized" in lines
assert "Required-by: requires_requires_capitalized" in lines


def test_show_skip_work_dir_pkg(script: PipTestEnvironment) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def assert_installed(
e = self.test_env

if editable:
pkg_dir = e.venv / "src" / pkg_name.lower()
pkg_dir = e.venv / "src" / canonicalize_name(pkg_name)
# If package was installed in a sub directory
if sub_dir:
pkg_dir = pkg_dir / sub_dir
Expand Down
Loading