Skip to content

Rewrite flaky test_vcs_url_urlquote_normalization to use local git repo #13243

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
Feb 26, 2025
Merged
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
21 changes: 5 additions & 16 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,26 +519,15 @@ def test_install_editable_from_bazaar(script: PipTestEnvironment) -> None:
result.assert_installed("testpackage", with_files=[".bzr"])


@pytest.mark.network
@need_bzr
def test_vcs_url_urlquote_normalization(
script: PipTestEnvironment, tmpdir: Path
) -> None:
def test_vcs_url_urlquote_normalization(script: PipTestEnvironment) -> None:
"""
Test that urlquoted characters are normalized for repo URL comparison.
"""
script.pip(
"install",
"-e",
"{url}/#egg=django-wikiapp".format(
url=local_checkout(
"bzr+http://bazaar.launchpad.net/"
"%7Edjango-wikiapp/django-wikiapp"
"/release-0.1",
tmpdir,
)
),
pkg_path = _create_test_package(
script.scratch_path, name="django_wikiapp", vcs="git"
)
url = f"git+{pkg_path.as_uri().replace('django_', 'django%5F')}/#egg=django_wikiapp"
Comment on lines +526 to +529
Copy link
Member Author

Choose a reason for hiding this comment

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

The _create_test_package helper is pretty rudimentary and will produce a package with broken entry-points if I use a dash (causing setuptools to loudly complain during package building), thus I had to switch it out for an underscore. Same idea, but different character.

script.pip("install", "-e", url)


@pytest.mark.parametrize("resolver", ["", "--use-deprecated=legacy-resolver"])
Expand Down