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 --install-options and --global-options to the requirements file parser. #2537

Merged
merged 25 commits into from
Apr 12, 2015
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b014668
Add --install-options and --global-options to the requirements file p…
gvalkov Mar 14, 2015
d6e21b9
Use options={} instead of options=None.
gvalkov Mar 18, 2015
4a70730
Replace all occurrences of install|global-options with install|global…
gvalkov Mar 18, 2015
0ab7a7b
Use optparse and pip.cmdoptions for parsing requirement-line options
gvalkov Mar 18, 2015
7e1bcf5
Remove evil trailing comma
gvalkov Mar 18, 2015
00dc755
Revert back to using options=None and fix loose ends
gvalkov Mar 19, 2015
fbffb09
Python 2/3 compatibiltiy fix
gvalkov Mar 19, 2015
832c050
Fix pep8 compatibility
gvalkov Mar 21, 2015
1c0021b
Add an --install|global-option functional test
gvalkov Mar 21, 2015
5a57325
Fix pep8 compatibility
gvalkov Mar 21, 2015
29f0c75
Do not shlex.split() and flatten value of global|install_options
gvalkov Mar 22, 2015
0da51b1
Remove misleading test cases and improve docs
gvalkov Mar 24, 2015
351d809
remove the functional test. for this change, we can achieve as much …
qwcode Mar 31, 2015
d051669
create new test module for req_file.py and stub out the classes
qwcode Mar 31, 2015
e26d67c
tests for pip.req.req_file
qwcode Apr 7, 2015
6c747be
move some tests from test_req to test_req_file
qwcode Apr 7, 2015
90f1791
consolidate tests from test_req to test_req_file
qwcode Apr 8, 2015
1294c0d
replace use of obscure '--one-two-3' option in test
qwcode Apr 8, 2015
9159a1d
assert the order of the install/global options in the install call
qwcode Apr 8, 2015
81a41e4
pep8 fixes
qwcode Apr 8, 2015
480a6f4
add tests for raising RequirementsFileParseError
qwcode Apr 9, 2015
12eab18
functional test for --install-option in a requirements file
qwcode Apr 9, 2015
fc5c6e5
tests for: isolated mode, default vcs, ignoring comments, setting the…
qwcode Apr 11, 2015
9f88946
remove comment about setuppyargs test package
qwcode Apr 11, 2015
3315242
fix join_lines test
qwcode Apr 11, 2015
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
Prev Previous commit
Next Next commit
add tests for raising RequirementsFileParseError
  • Loading branch information
qwcode authored and gvalkov committed Apr 12, 2015
commit 480a6f4245b3e90a5bb088516f11a8bacbba13b1
13 changes: 10 additions & 3 deletions tests/unit/test_req_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytest
from pretend import stub

from pip.exceptions import RequirementsFileParseError
from pip.download import PipSession
from pip.index import PackageFinder
from pip.req.req_install import InstallRequirement
Expand Down Expand Up @@ -111,9 +112,6 @@ def test_install_and_global_options(self):
class TestParseLine(object):
"""tests for `parse_line`"""

# TODO
# parser error tests

def test_parse_line_editable(self):
assert parse_line('-e url') == (REQUIREMENT_EDITABLE, 'url')
assert parse_line('--editable url') == (REQUIREMENT_EDITABLE, 'url')
Expand Down Expand Up @@ -147,6 +145,15 @@ def test_parse_line_requirement_with_options(self):
('SomeProject', {'install_options': ['--user']})
)

def test_flag_with_value_raises(self):
with pytest.raises(RequirementsFileParseError):
parse_line('--no-index url')

def test_option_with_no_value_raises(self):
with pytest.raises(RequirementsFileParseError):
parse_line('--index-url')



class TestParseContent(object):
"""tests for `parse_content`"""
Expand Down