Your IP : 3.147.68.18
a
(�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-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/setuptools/command/test.pyr s
zScanningLoader.__init__Nc C s� || j v rdS | j �|� g }|�t�| |�� t|d�rH|�|�� � t|d�r�t|jd�D ]`}|� d�r�|dkr�|jd |dd� }n"t
|j|d �r^|jd | }nq^|�| �|�� q^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 r ��fget)r r/ r r r r B s zNonDataProperty.__init__Nc C s |d u r| S | � |�S r r. )r �objZobjtyper r r �__get__E s zNonDataProperty.__get__)N)r# r+ r, r r1 r r r r r- A s r- c @ s� e Zd ZdZdZg d�Zdd� Zdd� Zedd � �Z d
d� 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 r )�
test_suite�test_module�test_loader�test_runnerr r r r �initialize_optionsZ s ztest.initialize_optionsc C s� | j r| jrd}t|��| j d u rD| jd u r8| jj | _ n| jd | _ | jd u r^t| jdd �| _| jd u rnd| _| jd u r�t| jdd �| _d S )Nz1You may specify a module or a suite, but not bothz.test_suiter8 z&setuptools.command.test:ScanningLoaderr9 )r6 r7 r �distributionr8 �getattrr9 )r �msgr r r �finalize_options` s
ztest.finalize_optionsc C s t | �� �S r )�list�
_test_argsr r r r � test_argss s ztest.test_argsc c s4 | j stjdkrdV | jr"dV | j r0| j V d S )N)� � Zdiscoverz --verbose)r6 �sys�version_info�verboser r r r r@ w s ztest._test_argsc C s2 | � � � |� W d � n1 s$0 Y 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�� }z�t|j�}tj� d|� t
�� tdd� � t
d|j|jf � | �|g�� d V W d � n1 s�0 Y W |tjd d �<