File tree 1 file changed +10
-3
lines changed
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 6
6
import pytest
7
7
from pretend import stub
8
8
9
+ from pip .exceptions import RequirementsFileParseError
9
10
from pip .download import PipSession
10
11
from pip .index import PackageFinder
11
12
from pip .req .req_install import InstallRequirement
@@ -111,9 +112,6 @@ def test_install_and_global_options(self):
111
112
class TestParseLine (object ):
112
113
"""tests for `parse_line`"""
113
114
114
- # TODO
115
- # parser error tests
116
-
117
115
def test_parse_line_editable (self ):
118
116
assert parse_line ('-e url' ) == (REQUIREMENT_EDITABLE , 'url' )
119
117
assert parse_line ('--editable url' ) == (REQUIREMENT_EDITABLE , 'url' )
@@ -147,6 +145,15 @@ def test_parse_line_requirement_with_options(self):
147
145
('SomeProject' , {'install_options' : ['--user' ]})
148
146
)
149
147
148
+ def test_flag_with_value_raises (self ):
149
+ with pytest .raises (RequirementsFileParseError ):
150
+ parse_line ('--no-index url' )
151
+
152
+ def test_option_with_no_value_raises (self ):
153
+ with pytest .raises (RequirementsFileParseError ):
154
+ parse_line ('--index-url' )
155
+
156
+
150
157
151
158
class TestParseContent (object ):
152
159
"""tests for `parse_content`"""
You can’t perform that action at this time.
0 commit comments