mirror of https://github.com/pypa/pip
refactor(tests): Add helper methods for path lookups
This adds helper methods to test_install_force_reinstall.py and test_uninstall_user.py
This commit is contained in:
parent
549a9d11a1
commit
e03f8e8868
|
@ -33,7 +33,7 @@ def check_force_reinstall(script, specifier, expected):
|
||||||
# site_packages_path is absolute, but files_created mapping uses
|
# site_packages_path is absolute, but files_created mapping uses
|
||||||
# relative paths as key.
|
# relative paths as key.
|
||||||
fixed_key = os.path.relpath(to_fix, script.base_path)
|
fixed_key = os.path.relpath(to_fix, script.base_path)
|
||||||
assert fixed_key in result2.files_created, 'force-reinstall failed'
|
result2.did_create(fixed_key, message='force-reinstall failed')
|
||||||
|
|
||||||
result3 = script.pip('uninstall', 'simplewheel', '-y')
|
result3 = script.pip('uninstall', 'simplewheel', '-y')
|
||||||
assert_all_changes(result, result3, [script.venv / 'build', 'cache'])
|
assert_all_changes(result, result3, [script.venv / 'build', 'cache'])
|
||||||
|
|
|
@ -62,7 +62,7 @@ class Tests_UninstallUserSite:
|
||||||
'install', '--user', '-e', to_install
|
'install', '--user', '-e', to_install
|
||||||
)
|
)
|
||||||
egg_link = script.user_site / 'FSPkg.egg-link'
|
egg_link = script.user_site / 'FSPkg.egg-link'
|
||||||
assert egg_link in result1.files_created, str(result1.stdout)
|
result1.did_create(egg_link)
|
||||||
|
|
||||||
# uninstall
|
# uninstall
|
||||||
result2 = script.pip('uninstall', '-y', 'FSPkg')
|
result2 = script.pip('uninstall', '-y', 'FSPkg')
|
||||||
|
|
Loading…
Reference in New Issue