mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Merge pull request #5541 from shimpeko/fix-update-outdate-dev-package
[fix] `update --outdated` raises NonExistentKey with dev package
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix: ``update --outdated`` raises NonExistentKey with outdated dev packages
|
||||
+3
-1
@@ -2081,7 +2081,9 @@ def do_outdated(project, pypi_mirror=None, pre=False, clear=False):
|
||||
)
|
||||
if name_in_pipfile:
|
||||
required = ""
|
||||
version = get_version(project.packages[name_in_pipfile])
|
||||
version = get_version(
|
||||
project.get_pipfile_section(category)[name_in_pipfile]
|
||||
)
|
||||
rdeps = reverse_deps.get(canonicalize_name(package))
|
||||
if isinstance(rdeps, Mapping) and "required" in rdeps:
|
||||
required = " {} required".format(rdeps["required"])
|
||||
|
||||
@@ -78,6 +78,7 @@ filterwarnings = [
|
||||
# `pipenv run pytest --markers` will list all markers inlcuding these
|
||||
markers = [
|
||||
"install: tests having to do with `pipenv install`",
|
||||
"update: tests having to do with `pipenv update`",
|
||||
"needs_internet: integration tests that require internet to pass",
|
||||
"basic: basic pipenv tests grouping",
|
||||
"dev: tests having to do with dev and dev packages",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import pytest
|
||||
|
||||
@pytest.mark.parametrize("cmd_option", ["", "--dev"])
|
||||
@pytest.mark.basic
|
||||
@pytest.mark.update
|
||||
def test_update_outdated_with_outdated_package(pipenv_instance_private_pypi, cmd_option):
|
||||
with pipenv_instance_private_pypi() as p:
|
||||
package_name = "six"
|
||||
p.pipenv(f"install {cmd_option} {package_name}==1.11")
|
||||
c = p.pipenv("update --outdated")
|
||||
assert isinstance(c.exception, SystemExit)
|
||||
assert c.stdout_bytes.decode("utf-8").startswith(f"Package '{package_name}' out-of-date:")
|
||||
Reference in New Issue
Block a user