Skip to content

Commit 83155a1

Browse files
authored
Rewrite flaky test_vcs_url_urlquote_normalization to use local git repo (#13243)
Looking at the VCS code, I'm not actually sure if the original test is testing what's supposed to be testing nowadays. The docstring suggests it's testing the compare_urls() method in vcs/versioncontrol.py but it never called in the original test. Anyway, this test has been particularly flaky as Launchpad frequently timeouts. We don't need to test bzr here, so let's switch to test against a local git repository.
1 parent 2feaca9 commit 83155a1

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

tests/functional/test_install.py

+5-16
Original file line numberDiff line numberDiff line change
@@ -519,26 +519,15 @@ def test_install_editable_from_bazaar(script: PipTestEnvironment) -> None:
519519
result.assert_installed("testpackage", with_files=[".bzr"])
520520

521521

522-
@pytest.mark.network
523-
@need_bzr
524-
def test_vcs_url_urlquote_normalization(
525-
script: PipTestEnvironment, tmpdir: Path
526-
) -> None:
522+
def test_vcs_url_urlquote_normalization(script: PipTestEnvironment) -> None:
527523
"""
528524
Test that urlquoted characters are normalized for repo URL comparison.
529525
"""
530-
script.pip(
531-
"install",
532-
"-e",
533-
"{url}/#egg=django-wikiapp".format(
534-
url=local_checkout(
535-
"bzr+http://bazaar.launchpad.net/"
536-
"%7Edjango-wikiapp/django-wikiapp"
537-
"/release-0.1",
538-
tmpdir,
539-
)
540-
),
526+
pkg_path = _create_test_package(
527+
script.scratch_path, name="django_wikiapp", vcs="git"
541528
)
529+
url = f"git+{pkg_path.as_uri().replace('django_', 'django%5F')}/#egg=django_wikiapp"
530+
script.pip("install", "-e", url)
542531

543532

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

0 commit comments

Comments
 (0)