@@ -52,8 +52,7 @@ def test_show_with_files_from_wheel(script: PipTestEnvironment, data: TestData)
52
52
"""
53
53
Test that a wheel's files can be listed.
54
54
"""
55
- wheel_file = data .packages .joinpath ("simple.dist-0.1-py2.py3-none-any.whl" )
56
- script .pip ("install" , "--no-index" , wheel_file )
55
+ script .pip_install_local (data .packages / "simple.dist-0.1-py2.py3-none-any.whl" )
57
56
result = script .pip ("show" , "-f" , "simple.dist" )
58
57
lines = result .stdout .splitlines ()
59
58
assert "Name: simple.dist" in lines
@@ -181,8 +180,7 @@ def test_show_verbose_installer(script: PipTestEnvironment, data: TestData) -> N
181
180
"""
182
181
Test that the installer is shown (this currently needs a wheel install)
183
182
"""
184
- wheel_file = data .packages .joinpath ("simple.dist-0.1-py2.py3-none-any.whl" )
185
- script .pip ("install" , "--no-index" , wheel_file )
183
+ script .pip_install_local (data .packages / "simple.dist-0.1-py2.py3-none-any.whl" )
186
184
result = script .pip ("show" , "--verbose" , "simple.dist" )
187
185
lines = result .stdout .splitlines ()
188
186
assert "Name: simple.dist" in lines
@@ -260,20 +258,18 @@ def test_pip_show_is_short(script: PipTestEnvironment) -> None:
260
258
assert len (lines ) <= 11
261
259
262
260
263
- def test_pip_show_divider (script : PipTestEnvironment , data : TestData ) -> None :
261
+ def test_pip_show_divider (script : PipTestEnvironment ) -> None :
264
262
"""
265
263
Expect a divider between packages
266
264
"""
267
- script .pip ( "install" , " pip-test-package", "--no-index" , "-f" , data . packages )
265
+ script .pip_install_local ( " pip-test-package" )
268
266
result = script .pip ("show" , "pip" , "pip-test-package" )
269
267
lines = result .stdout .splitlines ()
270
268
assert "---" in lines
271
269
272
270
273
- def test_package_name_is_canonicalized (
274
- script : PipTestEnvironment , data : TestData
275
- ) -> None :
276
- script .pip ("install" , "pip-test-package" , "--no-index" , "-f" , data .packages )
271
+ def test_package_name_is_canonicalized (script : PipTestEnvironment ) -> None :
272
+ script .pip_install_local ("pip-test-package" )
277
273
278
274
dash_show_result = script .pip ("show" , "pip-test-package" )
279
275
underscore_upper_show_result = script .pip ("show" , "pip-test_Package" )
@@ -288,8 +284,7 @@ def test_show_required_by_packages_basic(
288
284
"""
289
285
Test that installed packages that depend on this package are shown
290
286
"""
291
- editable_path = os .path .join (data .src , "requires_simple" )
292
- script .pip ("install" , "--no-index" , "-f" , data .find_links , editable_path )
287
+ script .pip_install_local (data .src / "requires_simple" )
293
288
294
289
result = script .pip ("show" , "simple" )
295
290
lines = result .stdout .splitlines ()
@@ -308,8 +303,7 @@ def test_show_required_by_packages_capitalized(
308
303
Test that the installed packages which depend on a package are shown
309
304
where the package has a capital letter
310
305
"""
311
- editable_path = os .path .join (data .src , "requires_capitalized" )
312
- script .pip ("install" , "--no-index" , "-f" , data .find_links , editable_path )
306
+ script .pip_install_local (data .src / "requires_capitalized" )
313
307
314
308
result = script .pip ("show" , "simple" )
315
309
lines = result .stdout .splitlines ()
@@ -329,10 +323,8 @@ def test_show_required_by_packages_requiring_capitalized(
329
323
where the package has a name with a mix of
330
324
lower and upper case letters
331
325
"""
332
- required_package_path = os .path .join (data .src , "requires_capitalized" )
333
- script .pip ("install" , "--no-index" , "-f" , data .find_links , required_package_path )
334
- editable_path = os .path .join (data .src , "requires_requires_capitalized" )
335
- script .pip ("install" , "--no-index" , "-f" , data .find_links , editable_path )
326
+ script .pip_install_local (data .src / "requires_capitalized" )
327
+ script .pip_install_local (data .src / "requires_requires_capitalized" )
336
328
337
329
result = script .pip ("show" , "Requires_Capitalized" )
338
330
lines = result .stdout .splitlines ()
@@ -432,8 +424,7 @@ def test_show_license_expression(script: PipTestEnvironment, data: TestData) ->
432
424
"""
433
425
Show License-Expression if present in metadata >= 2.4.
434
426
"""
435
- wheel_file = data .packages .joinpath ("license.dist-0.1-py2.py3-none-any.whl" )
436
- script .pip ("install" , "--no-index" , wheel_file )
427
+ script .pip_install_local (data .packages / "license.dist-0.1-py2.py3-none-any.whl" )
437
428
result = script .pip ("show" , "license.dist" )
438
429
lines = result .stdout .splitlines ()
439
430
assert "License-Expression: MIT AND MIT-0" in lines
@@ -446,8 +437,7 @@ def test_show_license_for_metadata_24(
446
437
"""
447
438
Show License if License-Expression is not there for metadata >= 2.4.
448
439
"""
449
- wheel_file = data .packages .joinpath ("license.dist-0.2-py2.py3-none-any.whl" )
450
- script .pip ("install" , "--no-index" , wheel_file )
440
+ script .pip_install_local (data .packages / "license.dist-0.2-py2.py3-none-any.whl" )
451
441
result = script .pip ("show" , "license.dist" )
452
442
lines = result .stdout .splitlines ()
453
443
assert "License-Expression: " not in lines
0 commit comments