Skip to content

Commit 8813c76

Browse files
authored
add test for counting pre option and fix it's duplicate (#3479)
add test for counting pre option and fix it's duplicate
2 parents 25c02f0 + 88d0581 commit 8813c76

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

news/3479.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed an issue which caused ``pipenv install --help`` to show duplicate entries for ``--pre``.

pipenv/cli/options.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ def install_options(f):
377377
f = index_option(f)
378378
f = extra_index_option(f)
379379
f = requirementstxt_option(f)
380-
f = pre_option(f)
381380
f = selective_upgrade_option(f)
382381
f = ignore_pipfile_option(f)
383382
f = editable_option(f)

tests/unit/test_help.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,16 @@ def test_help():
99
stderr=subprocess.STDOUT, env=os.environ.copy(),
1010
)
1111
assert output
12+
13+
14+
def test_count_of_description_pre_option():
15+
test_command = 'pipenv install --help'
16+
test_line = '--pre Allow pre-releases.'
17+
out = subprocess.Popen(test_command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
18+
stdout, _ = out.communicate()
19+
lines = stdout.decode().split('\n')
20+
count = 0
21+
for line in lines:
22+
if line.strip().split() == test_line.split():
23+
count += 1
24+
assert count == 1

0 commit comments

Comments
 (0)