File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -191,7 +191,7 @@ def _is_remote_pip_uri(value: str) -> bool:
191191 The test is performed by trying a URL parse and reading the scheme.
192192 """
193193 scheme = urllib .parse .urlsplit (value ).scheme
194- return scheme in ( "http " , "https " , "file" )
194+ return scheme in { "file " , "http " , "https" }
195195
196196
197197def create_wheel_cache (cache_dir : str , format_control : str | None = None ) -> WheelCache :
Original file line number Diff line number Diff line change @@ -4065,8 +4065,9 @@ def test_url_constraints_are_not_treated_as_file_paths(
40654065 This is a regression test for
40664066 https://github.com/jazzband/pip-tools/issues/2223
40674067 """
4068- reqs_in = tmp_path / "requirements.in"
40694068 constraints_url = "https://example.com/files/common_constraints.txt"
4069+
4070+ reqs_in = tmp_path / "requirements.in"
40704071 reqs_in .write_text (
40714072 f"""
40724073 small-fake-a
@@ -4094,19 +4095,19 @@ def fake_url_get(url):
40944095
40954096 with monkeypatch .context () as revertable_ctx :
40964097 revertable_ctx .chdir (tmp_path )
4097- with mock . patch . object (PipSession , "get" , mock_get ):
4098- out = runner .invoke (
4099- cli ,
4100- [
4101- "--output-file" ,
4102- "-" ,
4103- "--quiet" ,
4104- "--no-header" ,
4105- "--no-emit-options" ,
4106- "-r" ,
4107- input_path ,
4108- ],
4109- )
4098+ revertable_ctx . setattr (PipSession , "get" , mock_get )
4099+ out = runner .invoke (
4100+ cli ,
4101+ [
4102+ "--output-file" ,
4103+ "-" ,
4104+ "--quiet" ,
4105+ "--no-header" ,
4106+ "--no-emit-options" ,
4107+ "-r" ,
4108+ input_path ,
4109+ ],
4110+ )
41104111
41114112 # sanity check, pip should have tried to fetch the constraints
41124113 mock_get .assert_called_once_with (constraints_url )
You can’t perform that action at this time.
0 commit comments