diff --git a/news/3353.bugfix b/news/3353.bugfix new file mode 100644 index 00000000..23e2b6af --- /dev/null +++ b/news/3353.bugfix @@ -0,0 +1 @@ +Fix a bug where pipenv --clear is not working diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 5168ecce..a897cff0 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -62,18 +62,15 @@ def cli( state, where=False, venv=False, - rm=False, - bare=False, - three=False, - python=False, - help=False, py=False, envs=False, - man=False, + rm=False, + bare=False, completion=False, - pypi_mirror=None, + man=False, support=None, - clear=False, + help=False, + site_packages=False, **kwargs ): # Handle this ASAP to make shell startup fast. @@ -143,10 +140,9 @@ def cli( get_pipenv_diagnostics() return 0 # --clear was passed… - elif clear: + elif state.clear: do_clear() return 0 - # --venv was passed… elif venv: # There is no virtualenv yet. diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 4be05cfb..6153658d 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -235,3 +235,19 @@ import flask c = p.pipenv('check --unused .') assert 'tablib' not in c.out assert 'flask' not in c.out + + +@pytest.mark.cli +def test_pipenv_clear(PipenvInstance): + with PipenvInstance() as p: + c = p.pipenv('--clear') + assert c.return_code == 0 + assert 'Clearing caches' in c.out + + +@pytest.mark.cli +def test_pipenv_three(PipenvInstance): + with PipenvInstance() as p: + c = p.pipenv('--three') + assert c.return_code == 0 + assert 'Successfully created virtual environment' in c.err