7
7
from tests .lib import create_basic_sdist_for_package , create_basic_wheel_for_package
8
8
9
9
_FindLinks = collections .namedtuple (
10
- "_FindLinks" , "index_html sdist_hash wheel_hash" ,
10
+ "_FindLinks" ,
11
+ "index_html sdist_hash wheel_hash" ,
11
12
)
12
13
13
14
@@ -75,9 +76,11 @@ def test_new_resolver_hash_intersect(script, requirements_template, message):
75
76
"--no-cache-dir" ,
76
77
"--no-deps" ,
77
78
"--no-index" ,
78
- "--find-links" , find_links .index_html ,
79
+ "--find-links" ,
80
+ find_links .index_html ,
79
81
"-vv" ,
80
- "--requirement" , requirements_txt ,
82
+ "--requirement" ,
83
+ requirements_txt ,
81
84
)
82
85
83
86
assert message .format (name = "base" ) in result .stdout , str (result )
@@ -107,10 +110,13 @@ def test_new_resolver_hash_intersect_from_constraint(script):
107
110
"--no-cache-dir" ,
108
111
"--no-deps" ,
109
112
"--no-index" ,
110
- "--find-links" , find_links .index_html ,
113
+ "--find-links" ,
114
+ find_links .index_html ,
111
115
"-vv" ,
112
- "--constraint" , constraints_txt ,
113
- "--requirement" , requirements_txt ,
116
+ "--constraint" ,
117
+ constraints_txt ,
118
+ "--requirement" ,
119
+ requirements_txt ,
114
120
)
115
121
116
122
message = (
@@ -138,7 +144,9 @@ def test_new_resolver_hash_intersect_from_constraint(script):
138
144
ids = ["both-requirements" , "one-each" ],
139
145
)
140
146
def test_new_resolver_hash_intersect_empty (
141
- script , requirements_template , constraints_template ,
147
+ script ,
148
+ requirements_template ,
149
+ constraints_template ,
142
150
):
143
151
find_links = _create_find_links (script )
144
152
@@ -163,9 +171,12 @@ def test_new_resolver_hash_intersect_empty(
163
171
"--no-cache-dir" ,
164
172
"--no-deps" ,
165
173
"--no-index" ,
166
- "--find-links" , find_links .index_html ,
167
- "--constraint" , constraints_txt ,
168
- "--requirement" , requirements_txt ,
174
+ "--find-links" ,
175
+ find_links .index_html ,
176
+ "--constraint" ,
177
+ constraints_txt ,
178
+ "--requirement" ,
179
+ requirements_txt ,
169
180
expect_error = True ,
170
181
)
171
182
@@ -193,8 +204,10 @@ def test_new_resolver_hash_intersect_empty_from_constraint(script):
193
204
"--no-cache-dir" ,
194
205
"--no-deps" ,
195
206
"--no-index" ,
196
- "--find-links" , find_links .index_html ,
197
- "--constraint" , constraints_txt ,
207
+ "--find-links" ,
208
+ find_links .index_html ,
209
+ "--constraint" ,
210
+ constraints_txt ,
198
211
"base==0.1.0" ,
199
212
expect_error = True ,
200
213
)
@@ -208,7 +221,8 @@ def test_new_resolver_hash_intersect_empty_from_constraint(script):
208
221
209
222
@pytest .mark .parametrize ("constrain_by_hash" , [False , True ])
210
223
def test_new_resolver_hash_requirement_and_url_constraint_can_succeed (
211
- script , constrain_by_hash ,
224
+ script ,
225
+ constrain_by_hash ,
212
226
):
213
227
wheel_path = create_basic_wheel_for_package (script , "base" , "0.1.0" )
214
228
@@ -235,16 +249,19 @@ def test_new_resolver_hash_requirement_and_url_constraint_can_succeed(
235
249
"install" ,
236
250
"--no-cache-dir" ,
237
251
"--no-index" ,
238
- "--constraint" , constraints_txt ,
239
- "--requirement" , requirements_txt ,
252
+ "--constraint" ,
253
+ constraints_txt ,
254
+ "--requirement" ,
255
+ requirements_txt ,
240
256
)
241
257
242
258
script .assert_installed (base = "0.1.0" )
243
259
244
260
245
261
@pytest .mark .parametrize ("constrain_by_hash" , [False , True ])
246
262
def test_new_resolver_hash_requirement_and_url_constraint_can_fail (
247
- script , constrain_by_hash ,
263
+ script ,
264
+ constrain_by_hash ,
248
265
):
249
266
wheel_path = create_basic_wheel_for_package (script , "base" , "0.1.0" )
250
267
other_path = create_basic_wheel_for_package (script , "other" , "0.1.0" )
@@ -272,8 +289,10 @@ def test_new_resolver_hash_requirement_and_url_constraint_can_fail(
272
289
"install" ,
273
290
"--no-cache-dir" ,
274
291
"--no-index" ,
275
- "--constraint" , constraints_txt ,
276
- "--requirement" , requirements_txt ,
292
+ "--constraint" ,
293
+ constraints_txt ,
294
+ "--requirement" ,
295
+ requirements_txt ,
277
296
expect_error = True ,
278
297
)
279
298
0 commit comments