diff --git a/news/4321.bugfix.rst b/news/4321.bugfix.rst new file mode 100644 index 00000000..e5194de4 --- /dev/null +++ b/news/4321.bugfix.rst @@ -0,0 +1 @@ +Fix a bug that ``pipenv uninstall`` throws an exception that does not exist. diff --git a/pipenv/core.py b/pipenv/core.py index 5ba8ab92..d196d9f2 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -2231,10 +2231,7 @@ def do_uninstall( ensure_project(three=three, python=python, pypi_mirror=pypi_mirror) # Un-install all dependencies, if --all was provided. if not any([packages, editable_packages, all_dev, all]): - raise exceptions.MissingParameter( - crayons.red("No package provided!"), - ctx=ctx, param_type="parameter", - ) + raise exceptions.PipenvUsageError("No package provided!", ctx=ctx) editable_pkgs = [ Requirement.from_line("-e {0}".format(p)).name for p in editable_packages if p ] diff --git a/tests/integration/test_uninstall.py b/tests/integration/test_uninstall.py index 1168e2ff..462919b2 100644 --- a/tests/integration/test_uninstall.py +++ b/tests/integration/test_uninstall.py @@ -186,3 +186,14 @@ def test_uninstall_all_dev_with_shared_dependencies(PipenvInstance): assert c.return_code == 0 assert "six" in p.lockfile["develop"] + + +@pytest.mark.uninstall +def test_uninstall_missing_parameters(PipenvInstance): + with PipenvInstance() as p: + c = p.pipenv("install requests") + assert c.return_code == 0 + + c = p.pipenv("uninstall") + assert c.return_code != 0 + assert "No package provided!" in c.err