Skip to content

Commit 098fd82

Browse files
committed
pypa#3722 Add test for excluding shared packages during pipenv uninstall --all-dev
1 parent bfbe130 commit 098fd82

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/integration/test_uninstall.py

+34
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,40 @@ def test_uninstall_all_dev(PipenvInstance):
150150
assert c.return_code == 0
151151

152152

153+
@pytest.mark.run
154+
@pytest.mark.uninstall
155+
@pytest.mark.install
156+
def test_uninstall_all_dev_leave_prod_packages(PipenvInstance):
157+
with PipenvInstance() as p:
158+
c = p.pipenv("install flask")
159+
assert c.return_code == 0
160+
161+
c = p.pipenv("install --dev black")
162+
assert c.return_code == 0
163+
164+
assert "flask" in p.pipfile["packages"]
165+
assert "black" in p.pipfile["dev-packages"]
166+
assert "flask" in p.lockfile["default"]
167+
assert "black" in p.lockfile["develop"]
168+
assert "click" in p.lockfile["default"]
169+
assert "click" in p.lockfile["develop"]
170+
171+
c = p.pipenv('run python -c "import click"')
172+
assert c.return_code == 0
173+
174+
c = p.pipenv("uninstall --all-dev")
175+
assert c.return_code == 0
176+
assert p.pipfile["dev-packages"] == {}
177+
assert["black"] not in p.lockfile["develop"]
178+
assert["click"] not in p.lockfile["develop"]
179+
assert["flask"] in p.pipfile["packages"]
180+
assert["flask"] in p.lockfile["default"]
181+
assert["click"] in p.lockfile["default"]
182+
183+
c = p.pipenv('run python -c "import click')
184+
assert c.return_code == 0
185+
186+
153187
@pytest.mark.uninstall
154188
@pytest.mark.run
155189
def test_normalize_name_uninstall(PipenvInstance):

0 commit comments

Comments
 (0)