Skip to content

Commit 3a25be5

Browse files
fix test failures
1 parent 5463825 commit 3a25be5

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/pip/_internal/operations/prepare.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -564,18 +564,17 @@ def _complete_partial_requirements(
564564
links_to_fully_download: Dict[Link, InstallRequirement] = {}
565565
for req in partially_downloaded_reqs:
566566
assert req.link
567-
# (1) File URLs don't need to be downloaded, so skip them.
568-
if req.link.scheme == "file":
569-
continue
570-
# (2) If this is e.g. a git url, we don't know how to handle that in the
567+
# If this is e.g. a git url, we don't know how to handle that in the
571568
# BatchDownloader, so leave it for self._prepare_linked_requirement() at the
572569
# end of this method, which knows how to handle any URL.
570+
can_simply_download = True
573571
try:
574572
# This will raise InvalidSchema if our Session can't download it.
575573
self._session.get_adapter(req.link.url)
576-
links_to_fully_download[req.link] = req
577574
except InvalidSchema:
578-
pass
575+
can_simply_download = False
576+
if can_simply_download:
577+
links_to_fully_download[req.link] = req
579578

580579
batch_download = self._batch_download(
581580
links_to_fully_download.keys(),

tests/functional/test_check.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_check_complicated_name_missing(script: PipTestEnvironment) -> None:
119119

120120
# Without dependency
121121
result = script.pip("install", "--no-index", package_a_path, "--no-deps")
122-
assert "Successfully installed package-A-1.0" in result.stdout, str(result)
122+
assert "Successfully installed package-a-1.0" in result.stdout, str(result)
123123

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

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

147147
result = script.pip(
148148
"install",
@@ -175,7 +175,7 @@ def test_check_complicated_name_clean(script: PipTestEnvironment) -> None:
175175
)
176176

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

180180
result = script.pip(
181181
"install",
@@ -203,7 +203,7 @@ def test_check_considers_conditional_reqs(script: PipTestEnvironment) -> None:
203203
)
204204

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

208208
result = script.pip("check", expect_error=True)
209209
expected_lines = ("package-a 1.0 requires dependency-b, which is not installed.",)

tests/functional/test_install_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_check_install_canonicalization(script: PipTestEnvironment) -> None:
2828

2929
# Let's install pkgA without its dependency
3030
result = script.pip("install", "--no-index", pkga_path, "--no-deps")
31-
assert "Successfully installed pkgA-1.0" in result.stdout, str(result)
31+
assert "Successfully installed pkga-1.0" in result.stdout, str(result)
3232

3333
# Install the first missing dependency. Only an error for the
3434
# second dependency should remain.

tests/functional/test_install_reqs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def test_install_distribution_full_union(
626626
result = script.pip_install_local(
627627
to_install, f"{to_install}[bar]", f"{to_install}[baz]"
628628
)
629-
assert "Building wheel for LocalExtras" in result.stdout
629+
assert "Building wheel for localextras" in result.stdout
630630
result.did_create(script.site_packages / "simple")
631631
result.did_create(script.site_packages / "singlemodule.py")
632632

0 commit comments

Comments
 (0)