|
140 | 140 | ["--use-feature", "2020-resolver", "--use-feature", "fast-deps"],
|
141 | 141 | id="use-feature multiple duplicate different line",
|
142 | 142 | ),
|
143 |
| - pytest.param("--no-binary :all:", {"no_binary": ":all:"}, [], ["--no-binary", ":all:"], id="no-binary all"), |
144 |
| - pytest.param("--no-binary :none:", {"no_binary": ":none:"}, [], ["--no-binary", ":none:"], id="no-binary none"), |
145 |
| - pytest.param("--only-binary :all:", {"only_binary": ":all:"}, [], ["--only-binary", ":all:"], id="only-binary all"), |
| 143 | + pytest.param("--no-binary :all:", {"no_binary": {":all:"}}, [], ["--no-binary", {":all:"}], id="no-binary all"), |
| 144 | + pytest.param("--no-binary :none:", {"no_binary": {":none:"}}, [], [], id="no-binary none"), |
| 145 | + pytest.param( |
| 146 | + "--only-binary :all:", |
| 147 | + {"only_binary": {":all:"}}, |
| 148 | + [], |
| 149 | + ["--only-binary", {":all:"}], |
| 150 | + id="only-binary all", |
| 151 | + ), |
146 | 152 | pytest.param(
|
147 | 153 | "--only-binary :none:",
|
148 |
| - {"only_binary": ":none:"}, |
| 154 | + {"only_binary": {":none:"}}, |
| 155 | + [], |
149 | 156 | [],
|
150 |
| - ["--only-binary", ":none:"], |
151 | 157 | id="only-binary none",
|
152 | 158 | ),
|
| 159 | + pytest.param( |
| 160 | + "--no-binary=foo --only-binary=foo", |
| 161 | + {"only_binary": {"foo"}}, |
| 162 | + [], |
| 163 | + ["--only-binary", {"foo"}], |
| 164 | + id="no-binary-and-only-binary", |
| 165 | + ), |
| 166 | + pytest.param( |
| 167 | + "--no-binary=foo --no-binary=:none:", |
| 168 | + {}, |
| 169 | + [], |
| 170 | + [], |
| 171 | + id="no-binary-none-last", |
| 172 | + ), |
| 173 | + pytest.param( |
| 174 | + "--only-binary=:none: --no-binary=foo", |
| 175 | + {"no_binary": {"foo"}}, |
| 176 | + [], |
| 177 | + ["--no-binary", {"foo"}], |
| 178 | + id="no-binary-none-first", |
| 179 | + ), |
153 | 180 | pytest.param("####### example-requirements.txt #######", {}, [], [], id="comment"),
|
154 | 181 | pytest.param("\t##### Requirements without Version Specifiers ######", {}, [], [], id="tab and comment"),
|
155 | 182 | pytest.param(" # start", {}, [], [], id="space and comment"),
|
@@ -289,7 +316,7 @@ def test_req_file(tmp_path: Path, req: str, opts: dict[str, Any], requirements:
|
289 | 316 | req_file = RequirementsFile(requirements_txt, constraint=False)
|
290 | 317 | assert req_file.as_root_args == as_args
|
291 | 318 | assert str(req_file) == f"-r {requirements_txt}"
|
292 |
| - assert vars(req_file.options) == opts |
| 319 | + assert vars(req_file.options) == (opts if {":none:"} not in opts.values() else {}) |
293 | 320 | found = [str(i) for i in req_file.requirements]
|
294 | 321 | assert found == requirements
|
295 | 322 |
|
|
0 commit comments