Skip to content

Commit

Permalink
add test for counting pre option and fix it's duplicate (#3479)
Browse files Browse the repository at this point in the history
add test for counting pre option and fix it's duplicate
  • Loading branch information
techalchemy committed May 27, 2019
2 parents 25c02f0 + 88d0581 commit 8813c76
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/3479.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed an issue which caused ``pipenv install --help`` to show duplicate entries for ``--pre``.
1 change: 0 additions & 1 deletion pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,6 @@ def install_options(f):
f = index_option(f)
f = extra_index_option(f)
f = requirementstxt_option(f)
f = pre_option(f)
f = selective_upgrade_option(f)
f = ignore_pipfile_option(f)
f = editable_option(f)
Expand Down
13 changes: 13 additions & 0 deletions tests/unit/test_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,16 @@ def test_help():
stderr=subprocess.STDOUT, env=os.environ.copy(),
)
assert output


def test_count_of_description_pre_option():
test_command = 'pipenv install --help'
test_line = '--pre Allow pre-releases.'
out = subprocess.Popen(test_command.split(), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, _ = out.communicate()
lines = stdout.decode().split('\n')
count = 0
for line in lines:
if line.strip().split() == test_line.split():
count += 1
assert count == 1

0 comments on commit 8813c76

Please sign in to comment.