Your IP : 3.145.152.146
B
��Re� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl m
Z
d dlmZ d dlm
Z
mZmZmZmZmZmZmZ d dlmZ d dlmZ G dd � d e�ZG d
d� d�ZG dd
� d
e�ZdS )� N)�DistutilsError�DistutilsOptionError)�log)�
TestLoader)�resource_listdir�resource_exists�normalize_path�working_set�evaluate_marker�add_activation_listener�require�
EntryPoint)�Command)�unique_everseenc @ s e Zd Zdd� Zddd�ZdS )�ScanningLoaderc C s t �| � t� | _d S )N)r �__init__�set�_visited)�self� r ��/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/test.pyr s
zScanningLoader.__init__Nc C s� || j krdS | j �|� g }|�t�| |�� t|d�rH|�|�� � t|d�r�xpt|jd�D ]`}|� d�r�|dkr�|jd |dd� }n"t
|j|d �r`|jd | }nq`|�| �|�� q`W t|�d
kr�| �
|�S |d S dS )a Return a suite of all tests cases contained in the given module
If the module is a package, load tests from all the modules in it.
If the module has an ``additional_tests`` function, call it and add
the return value to the tests.
N�additional_tests�__path__� z.pyz__init__.py�.���z/__init__.py� r )r �add�appendr �loadTestsFromModule�hasattrr r �__name__�endswithr ZloadTestsFromName�lenZ
suiteClass)r �module�pattern�tests�file� submoduler r r r s$
z"ScanningLoader.loadTestsFromModule)N)r! �
__module__�__qualname__r r r r r r r s r c @ s e Zd Zdd� Zddd�ZdS )�NonDataPropertyc C s
|| _ d S )N)�fget)r r, r r r r B s zNonDataProperty.__init__Nc C s |d kr| S | � |�S )N)r, )r �objZobjtyper r r �__get__E s zNonDataProperty.__get__)N)r! r) r* r r. r r r r r+ A s r+ c @ s� e Zd ZdZdZdddgZdd� Zdd � Zed
d� �Z dd
� Z
dd� Zej
g fdd��Zeej
dd� ��Zedd� �Zdd� Zdd� Zedd� �Zedd� �ZdS )�testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated))ztest-module=�mz$Run 'test_suite' in specified module)ztest-suite=�sz9Run single test, case or suite (e.g. 'module.test_suite'))ztest-runner=�rzTest runner to usec C s d | _ d | _d | _d | _d S )N)�
test_suite�test_module�test_loader�test_runner)r r r r �initialize_optionsZ s ztest.initialize_optionsc C s� | j r| jrd}t|��| j d krD| jd kr8| jj | _ n| jd | _ | jd kr^t| jdd �| _| jd krnd| _| jd kr�t| jdd �| _d S )Nz1You may specify a module or a suite, but not bothz.test_suiter5 z&setuptools.command.test:ScanningLoaderr6 )r3 r4 r �distributionr5 �getattrr6 )r �msgr r r �finalize_options` s
ztest.finalize_optionsc C s t | �� �S )N)�list�
_test_args)r r r r � test_argss s ztest.test_argsc c s4 | j stjdkrdV | jr"dV | j r0| j V d S )N)� � Zdiscoverz --verbose)r3 �sys�version_info�verbose)r r r r r= w s ztest._test_argsc C s | � � � |� W dQ R X dS )zI
Backward compatibility for project_on_sys_path context.
N)�project_on_sys_path)r �funcr r r �with_project_on_sys_path s
ztest.with_project_on_sys_pathc
c s� | � d� | jddd� | � d� | �d�}tjd d � }tj�� }zbt|j�}tj� d|� t
�� tdd� � t
d|j|jf � | �|g�� d V W d Q R X W d |tjd d �<