Pin setuptools under 52 for easy_install tests

This commit is contained in:
Tzu-ping Chung 2021-01-25 07:58:07 +08:00
parent 8d042c4487
commit c72631a5f1
1 changed files with 13 additions and 2 deletions

View File

@ -63,6 +63,9 @@ def test_basic_uninstall_with_scripts(script):
Uninstall an easy_installed package with scripts. Uninstall an easy_installed package with scripts.
""" """
# setuptools 52 removed easy_install.
script.pip("install", "setuptools==51.3.3", use_module=True)
result = script.easy_install('PyLogo', expect_stderr=True) result = script.easy_install('PyLogo', expect_stderr=True)
easy_install_pth = script.site_packages / 'easy-install.pth' easy_install_pth = script.site_packages / 'easy-install.pth'
pylogo = sys.platform == 'win32' and 'pylogo' or 'PyLogo' pylogo = sys.platform == 'win32' and 'pylogo' or 'PyLogo'
@ -81,6 +84,9 @@ def test_uninstall_easy_install_after_import(script):
Uninstall an easy_installed package after it's been imported Uninstall an easy_installed package after it's been imported
""" """
# setuptools 52 removed easy_install.
script.pip("install", "setuptools==51.3.3", use_module=True)
result = script.easy_install('INITools==0.2', expect_stderr=True) result = script.easy_install('INITools==0.2', expect_stderr=True)
# the import forces the generation of __pycache__ if the version of python # the import forces the generation of __pycache__ if the version of python
# supports it # supports it
@ -104,6 +110,9 @@ def test_uninstall_trailing_newline(script):
lacks a trailing newline lacks a trailing newline
""" """
# setuptools 52 removed easy_install.
script.pip("install", "setuptools==51.3.3", use_module=True)
script.easy_install('INITools==0.2', expect_stderr=True) script.easy_install('INITools==0.2', expect_stderr=True)
script.easy_install('PyLogo', expect_stderr=True) script.easy_install('PyLogo', expect_stderr=True)
easy_install_pth = script.site_packages_path / 'easy-install.pth' easy_install_pth = script.site_packages_path / 'easy-install.pth'
@ -285,8 +294,10 @@ def test_uninstall_easy_installed_console_scripts(script):
""" """
Test uninstalling package with console_scripts that is easy_installed. Test uninstalling package with console_scripts that is easy_installed.
""" """
# setuptools >= 42.0.0 deprecates easy_install and prints a warning when # setuptools 52 removed easy_install and prints a warning after 42 when
# used # the command is used.
script.pip("install", "setuptools==51.3.3", use_module=True)
result = script.easy_install('discover', allow_stderr_warning=True) result = script.easy_install('discover', allow_stderr_warning=True)
result.did_create(script.bin / 'discover' + script.exe) result.did_create(script.bin / 'discover' + script.exe)
result2 = script.pip('uninstall', 'discover', '-y') result2 = script.pip('uninstall', 'discover', '-y')