Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for counting pre option and fix it's duplicate #3479

Merged
merged 5 commits into from
May 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case should be in integration directory and use PipenvInstance to keep consistency.

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