mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
Correct the exception to PipenvUsageError
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Fix a bug that ``pipenv uninstall`` throws an exception that does not exist.
|
||||
+1
-4
@@ -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
|
||||
]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user