Fix the assumption that all sources are named. (#5004)

* Fix the assumption that all sources are named.

* Add test case

* Add news fragment
This commit is contained in:
Matt Davis
2022-03-23 09:04:13 -04:00
committed by GitHub
parent 004316cf40
commit b60fa7f5e6
3 changed files with 30 additions and 1 deletions
+27
View File
@@ -497,3 +497,30 @@ extras = ["socks"]
assert 'six = {version = "*"}' in contents
assert 'requests = {version = "*"' in contents
assert 'flask = "*"' in contents
@flaky
@pytest.mark.dev
@pytest.mark.basic
@pytest.mark.install
@pytest.mark.needs_internet
def test_install_with_unnamed_source(PipenvInstance):
"""Ensure that running `pipenv install` doesn't break with an unamed index"""
with PipenvInstance(chdir=True) as p:
with open(p.pipfile_path, "w") as f:
contents = """
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
[packages]
requests = {version="*", index="pypi"}
""".strip()
f.write(contents)
c = p.pipenv("install")
assert c.returncode == 0