Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pbr/__pycache__/testr_command.cpython-39.pyc
Ðазад
a i�h� � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZe�e �Z G dd� dej�ZG dd� dej�Z zddlmZ d ZeZW n ey� d Ze ZY n0 dS )a� setuptools/distutils command to run testr via setup.py PBR will hook in the Testr class to provide "setup.py test" when .testr.conf is present in the repository (see pbr/hooks/commands.py). If we are activated but testrepository is not installed, we provide a sensible error. 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. � )�cmdNc @ sP e Zd ZdZg d�Zg d�Zdd� Zdd� Zdd � Zd d� Z dd � Z dd� ZdS )� TestrRealz&DEPRECATED: Run unit tests using testr))�coverageNzGReplace PYTHON with coverage and merge coverage from each testr worker.)ztestr-args=�tzRun 'testr' with these args)zomit=�oz(Files to omit from coverage calculations)zcoverage-package-name=NzLUse this name to select packages for coverage (one or more, comma-separated))�slowestNz-Show slowest test times after tests complete.)zno-parallelNzRun testr serially)z log-level=�lzLog level (default: info))r r �no_parallelc G s2 t �d|� t�tjd gt|� tjtjtj �S )Nz _run_testr called with args = %rr ) �logger�debug�commandsZrun_argv�sys�argv�list�stdin�stdout�stderr)�self�args� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pbr/testr_command.py� _run_testrH s �zTestrReal._run_testrc C s. d | _ d | _d| _d | _d | _d | _d| _d S )N� �info)� testr_argsr �omitr �coverage_package_namer � log_level�r r r r �initialize_optionsM s zTestrReal.initialize_optionsc C sp t t| j�� tj�| _tj| jd� t�d� | jd u r@g | _n| j� � | _| j r^d| j | _ t�d| j� d S )N)�levelzfinalize_options calledz --omit=%sz$finalize_options: self.__dict__ = %r)�getattr�loggingr �upper�INFO�basicConfigr r r �splitr �__dict__r r r r �finalize_optionsV s � zTestrReal.finalize_optionsc C s� t �d� t�dt� tj�d�s,| �d� | j r:| � � | jsX| jddg| j�R � }n| jdg| j�R � }|r�t j�d| ��| jr�td� | �d � | j r�| �� d S )z"Set up testr repo, then run testr.z run calledzctestr integration in pbr is deprecated. Please use the 'testr' setup command or call testr directlyz.testrepository�init�runz --parallelztestr failed (%d)z Slowest Testsr N)r r �warnings�warn�DeprecationWarning�os�path�isdirr r �_coverage_beforer r � distutils�errors�DistutilsErrorr �print�_coverage_after)r Z testr_retr r r r* e s( � � z TestrReal.runc C sb t �d� | j�� }|�d�r*|dd � }| jr6| j}d| }d| tjd<