From 1f75cac01eb24be8c907e5235cf88ae66b376e2f Mon Sep 17 00:00:00 2001 From: jxltom Date: Wed, 5 Dec 2018 10:07:55 +0800 Subject: [PATCH 1/5] Fix bug where --clear option is not supported for clearing cache --- pipenv/cli/command.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index e51c98a61d..84c797d40d 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. From 57a61a7ad8507900542218fb713435121c3b68a7 Mon Sep 17 00:00:00 2001 From: jxltom Date: Wed, 5 Dec 2018 10:10:22 +0800 Subject: [PATCH 2/5] Add bugfix news for issue 3353 --- news/3353.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/3353.bugfix diff --git a/news/3353.bugfix b/news/3353.bugfix new file mode 100644 index 0000000000..23e2b6af8a --- /dev/null +++ b/news/3353.bugfix @@ -0,0 +1 @@ +Fix a bug where pipenv --clear is not working From dfec732860cd60918b296e54a151f0a86a2ec72c Mon Sep 17 00:00:00 2001 From: jxltom Date: Wed, 5 Dec 2018 10:30:28 +0800 Subject: [PATCH 3/5] Add test for pipenv --clear --- tests/integration/test_cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index a38883e0ed..2545e01421 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -232,3 +232,11 @@ def test_check_unused(PipenvInstance, pypi): c = p.pipenv('check --unused .') assert 'tablib' 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 From 88e30d8fd2b0eff3117a6754994c0a224600027f Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 May 2019 10:39:47 +0800 Subject: [PATCH 4/5] Add smoke test for --three argument --- pipenv/core.py | 1 - tests/integration/test_cli.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index 76ce7e8b47..115e497361 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -931,7 +931,6 @@ def do_create_virtualenv(python=None, site_packages=False, pypi_mirror=None): extra=[crayons.red("{0}".format(error)),] ) else: - sp.green.ok(environments.PIPENV_SPINNER_OK_TEXT.format(u"Successfully created virtual environment!")) # Associate project directory with the environment. diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 2545e01421..df422e354f 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -240,3 +240,11 @@ def test_pipenv_clear(PipenvInstance): 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.out From 7f2eaf7d509919152bb1c1c03bcdef291877aac7 Mon Sep 17 00:00:00 2001 From: jxltom Date: Tue, 28 May 2019 10:34:09 +0800 Subject: [PATCH 5/5] Fix tests --- tests/integration/test_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_cli.py b/tests/integration/test_cli.py index 01bfa98d27..70cc430269 100644 --- a/tests/integration/test_cli.py +++ b/tests/integration/test_cli.py @@ -249,4 +249,4 @@ 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.out \ No newline at end of file + assert 'Successfully created virtual environment' in c.err