Server IP : 103.119.228.120 / Your IP : 18.223.213.76 Web Server : Apache System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64 User : nobody ( 99) PHP Version : 5.6.40 Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/ssl/lib/mysqlsh/lib/python3.9/site-packages/setuptools/tests/ |
Upload File : |
"""Run some integration tests. Try to install a few packages. """ import glob import os import sys import urllib.request import pytest from setuptools.command import easy_install as easy_install_pkg from setuptools.command.easy_install import easy_install from setuptools.dist import Distribution pytestmark = pytest.mark.skipif( 'platform.python_implementation() == "PyPy" and platform.system() == "Windows"', reason="pypa/setuptools#2496", ) def setup_module(module): packages = 'stevedore', 'virtualenvwrapper', 'pbr', 'novaclient' for pkg in packages: try: __import__(pkg) tmpl = "Integration tests cannot run when {pkg} is installed" pytest.skip(tmpl.format(**locals())) except ImportError: pass try: urllib.request.urlopen('https://pypi.python.org/pypi') except Exception as exc: pytest.skip(str(exc)) @pytest.fixture def install_context(request, tmpdir, monkeypatch): """Fixture to set up temporary installation directory.""" # Save old values so we can restore them. new_cwd = tmpdir.mkdir('cwd') user_base = tmpdir.mkdir('user_base') user_site = tmpdir.mkdir('user_site') install_dir = tmpdir.mkdir('install_dir') def fin(): # undo the monkeypatch, particularly needed under # windows because of kept handle on cwd monkeypatch.undo() new_cwd.remove() user_base.remove() user_site.remove() install_dir.remove() request.addfinalizer(fin) # Change the environment and site settings to control where the # files are installed and ensure we do not overwrite anything. monkeypatch.chdir(new_cwd) monkeypatch.setattr(easy_install_pkg, '__file__', user_site.strpath) monkeypatch.setattr('site.USER_BASE', user_base.strpath) monkeypatch.setattr('site.USER_SITE', user_site.strpath) monkeypatch.setattr('sys.path', sys.path + [install_dir.strpath]) monkeypatch.setenv('PYTHONPATH', str(os.path.pathsep.join(sys.path))) # Set up the command for performing the installation. dist = Distribution() cmd = easy_install(dist) cmd.install_dir = install_dir.strpath return cmd def _install_one(requirement, cmd, pkgname, modulename): cmd.args = [requirement] cmd.ensure_finalized() cmd.run() target = cmd.install_dir dest_path = glob.glob(os.path.join(target, pkgname + '*.egg')) assert dest_path assert os.path.exists(os.path.join(dest_path[0], pkgname, modulename)) def test_stevedore(install_context): _install_one('stevedore', install_context, 'stevedore', 'extension.py') @pytest.mark.xfail def test_virtualenvwrapper(install_context): _install_one( 'virtualenvwrapper', install_context, 'virtualenvwrapper', 'hook_loader.py' ) def test_pbr(install_context): _install_one('pbr', install_context, 'pbr', 'core.py') @pytest.mark.xfail @pytest.mark.filterwarnings("ignore:'encoding' argument not specified") # ^-- Dependency chain: `python-novaclient` < `oslo-utils` < `netifaces==0.11.0` # netifaces' setup.py uses `open` without `encoding="utf-8"` which is hijacked by # `setuptools.sandbox._open` and triggers the EncodingWarning. # Can't use EncodingWarning in the filter, as it does not exist on Python < 3.10. def test_python_novaclient(install_context): _install_one('python-novaclient', install_context, 'novaclient', 'base.py') def test_pyuri(install_context): """ Install the pyuri package (version 0.3.1 at the time of writing). This is also a regression test for issue #1016. """ _install_one('pyuri', install_context, 'pyuri', 'uri.py') pyuri = install_context.installed_projects['pyuri'] # The package data should be installed. assert os.path.exists(os.path.join(pyuri.location, 'pyuri', 'uri.regex'))