MOON
Server: Apache
System: Linux server30c.hostingraja.org 3.10.0-962.3.2.lve1.5.63.el7.x86_64 #1 SMP Fri Oct 8 12:03:35 UTC 2021 x86_64
User: jibhires (1887)
PHP: 8.1.30
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open, allow_url_fopen, symlink, escapeshellcmd, pcntl_exec
Upload Files
File: //opt/alt/python35/lib/python3.5/site-packages/pbr/__pycache__/testr_command.cpython-35.opt-1.pyc


�VF�@s�dZddlmZddlZddlZddlZddlZeje�Z	Gdd�dej
�ZGdd�dej
�Zy ddl
mZd	ZeZWnek
r�d
ZeZYnXdS)a�setuptools/distutils commands to run testr via setup.py

Currently provides 'testr' which runs tests using testr. You can pass
--coverage which will also export PYTHON='coverage run --source <your package>'
and automatically combine the coverage from each testr backend test runner
after the run completes.

To use, just use setuptools/distribute and depend on testr, and it should be
picked up automatically (as the commands are exported in the testrepository
package metadata.
�)�cmdNc	@s�eZdZdZd!d"d#d$d%d&d'gZdd
dgZdd�Zdd�Zdd�Zdd�Z	dd�Z
dd �ZdS)(�	TestrRealzRun unit tests using testr�coverageN�GReplace PYTHON with coverage and merge coverage from each testr worker.�testr-args=�t�Run 'testr' with these args�omit=�o�(Files to omit from coverage calculations�coverage-package-name=�"Use this name for coverage package�slowest�-Show slowest test times after tests complete.�no-parallel�Run testr serially�
log-level=�l�Log level (default: info)�no_parallelcGsCtjd|�tjtjdgt|�tjtjtj	�S)Nz _run_testr called with args = %rr)
�logger�debug�commandsZrun_argv�sys�argv�list�stdin�stdout�stderr)�self�args�r!�/testr_command.py�
_run_testrCszTestrReal._run_testrcCsCd|_d|_d|_d|_d|_d|_d|_dS)N��info)�
testr_argsr�omitr�coverage_package_namer�	log_level)rr!r!r"�initialize_optionsHs						zTestrReal.initialize_optionscCs�tt|jj�tj�|_tjd|j�tjd�|jdkr\g|_n|jj	�|_|j
r�d|j
|_
tjd|j�dS)N�levelzfinalize_options calledz	--omit=%sz$finalize_options: self.__dict__ = %r)�getattr�loggingr)�upper�INFO�basicConfigrrr&�splitr'�__dict__)rr!r!r"�finalize_optionsQs
	zTestrReal.finalize_optionscCs�tjd�tjjd�s,|jd�|jr?|j�|jsc|jdd|j	�}n|jd|j	�}|r�t
jjd|��|j
r�td�|jd�|jr�|j�d	S)
z"Set up testr repo, then run testr.z
run calledz.testrepositoryZinit�runz
--parallelztestr failed (%d)z
Slowest TestsrN)rr�os�path�isdirr#r�_coverage_beforerr&�	distutils�errorsZDistutilsErrorr�print�_coverage_after)rZ	testr_retr!r!r"r4`s 

	
		
	

	z
TestrReal.runcCs�tjd�|jj�}|jd�r;|dd�}|jrM|j}d|}d|tjd<tjdtjd�dS)Nz_coverage_before calledzpython-�z--source %s --parallel-modezcoverage run %s�PYTHONzos.environ['PYTHON'] = %r)rrZdistribution�get_name�
startswithr(r5�environ)r�packageZoptionsr!r!r"r8us
		
zTestrReal._coverage_beforecCs2tjd�tjd�tjd|j�dS)Nz_coverage_after calledzcoverage combinezcoverage html -d ./cover %s)rrr5�systemr')rr!r!r"r<�s

zTestrReal._coverage_after)zcoverageNr)rrr)r	r
r)rNr
)zslowestNr)rNr)rrr)�__name__�
__module__�__qualname__�description�user_optionsZboolean_optionsr#r*r3r4r8r<r!r!r!r"r2s		
rc@s@eZdZdZgZdd�Zdd�Zdd�ZdS)	�	TestrFakezRun unit tests using testrcCsdS)Nr!)rr!r!r"r*�szTestrFake.initialize_optionscCsdS)Nr!)rr!r!r"r3�szTestrFake.finalize_optionscCstd�dS)Nz7Install testrepository to run 'testr' command properly.)r;)rr!r!r"r4�sz
TestrFake.runN)rDrErFrGrHr*r3r4r!r!r!r"rI�s
rI)rTF)�__doc__r9rZdistutils.errorsr-r5r�	getLoggerrDrZCommandrrIZtestrepositoryrZ
have_testrZTestr�ImportErrorr!r!r!r"�<module>'sV