@@ -52,8 +52,7 @@ def test_show_with_files_from_wheel(script: PipTestEnvironment, data: TestData)
5252 """
5353 Test that a wheel's files can be listed.
5454 """
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" )
5756 result = script .pip ("show" , "-f" , "simple.dist" )
5857 lines = result .stdout .splitlines ()
5958 assert "Name: simple.dist" in lines
@@ -181,8 +180,7 @@ def test_show_verbose_installer(script: PipTestEnvironment, data: TestData) -> N
181180 """
182181 Test that the installer is shown (this currently needs a wheel install)
183182 """
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" )
186184 result = script .pip ("show" , "--verbose" , "simple.dist" )
187185 lines = result .stdout .splitlines ()
188186 assert "Name: simple.dist" in lines
@@ -260,20 +258,18 @@ def test_pip_show_is_short(script: PipTestEnvironment) -> None:
260258 assert len (lines ) <= 11
261259
262260
263- def test_pip_show_divider (script : PipTestEnvironment , data : TestData ) -> None :
261+ def test_pip_show_divider (script : PipTestEnvironment ) -> None :
264262 """
265263 Expect a divider between packages
266264 """
267- script .pip ( "install" , " pip-test-package", "--no-index" , "-f" , data . packages )
265+ script .pip_install_local ( " pip-test-package" )
268266 result = script .pip ("show" , "pip" , "pip-test-package" )
269267 lines = result .stdout .splitlines ()
270268 assert "---" in lines
271269
272270
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" )
277273
278274 dash_show_result = script .pip ("show" , "pip-test-package" )
279275 underscore_upper_show_result = script .pip ("show" , "pip-test_Package" )
@@ -288,8 +284,7 @@ def test_show_required_by_packages_basic(
288284 """
289285 Test that installed packages that depend on this package are shown
290286 """
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" )
293288
294289 result = script .pip ("show" , "simple" )
295290 lines = result .stdout .splitlines ()
@@ -308,8 +303,7 @@ def test_show_required_by_packages_capitalized(
308303 Test that the installed packages which depend on a package are shown
309304 where the package has a capital letter
310305 """
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" )
313307
314308 result = script .pip ("show" , "simple" )
315309 lines = result .stdout .splitlines ()
@@ -329,10 +323,8 @@ def test_show_required_by_packages_requiring_capitalized(
329323 where the package has a name with a mix of
330324 lower and upper case letters
331325 """
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" )
336328
337329 result = script .pip ("show" , "Requires_Capitalized" )
338330 lines = result .stdout .splitlines ()
@@ -432,8 +424,7 @@ def test_show_license_expression(script: PipTestEnvironment, data: TestData) ->
432424 """
433425 Show License-Expression if present in metadata >= 2.4.
434426 """
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" )
437428 result = script .pip ("show" , "license.dist" )
438429 lines = result .stdout .splitlines ()
439430 assert "License-Expression: MIT AND MIT-0" in lines
@@ -446,8 +437,7 @@ def test_show_license_for_metadata_24(
446437 """
447438 Show License if License-Expression is not there for metadata >= 2.4.
448439 """
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" )
451441 result = script .pip ("show" , "license.dist" )
452442 lines = result .stdout .splitlines ()
453443 assert "License-Expression: " not in lines
0 commit comments