Your IP : 216.73.216.196
B
C$�Xjl � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZyddlm Z
W n ek
rl ddlm
Z
Y nX ddlmZ ddlmZ ej�ej��� ZdZdZdZd Zd
ZdZdd
� Zdd� Zdd� Zdd� Z dd� Z!dd� Z"dd� Z#dd� Z$dd� Z%G dd� d�Z&G d d!� d!e'�Z(G d"d#� d#e
�Z)G d$d%� d%e'�Z*G d&d'� d'e*�Z+G d(d)� d)e+�Z,G d*d+� d+e,�Z-G d,d-� d-e*�Z.G d.d/� d/e/�Z0G d0d1� d1e1�Z2G d2d3� d3e,�Z3dS )4zF core implementation of testing process: init, session, runtest loop. � N)�MutableMapping)� DictMixin)�
directory_arg)�collect_one_node� � � � � c C sV | j ddddddddd d
gd� | j dd
dg d� | �dd�}|jddddddd�f |jdddtdddd� |jdddd � |jd!d"td#d$d%� |jd&dd'd(d)d*� | �d+d,�}|jd-d.dd/d �f |jd0dd1d � |jd2d3d4d5d6� |jd7d8d d9tjtd7d:�d;d<� |jd=dd>d'd?d@� |jdAdBddCd'dDd@� | �dEdF�}|jdGdHd d9dIdJ� d S )KN�
norecursedirsz)directory patterns to avoid for recursion�argsz.*�build�distZCVSZ_darcsz{arch}z*.egg)�type�defaultZ testpathsz[directories to search for tests when no files or directories are given in the command line.Zgeneralzrunning and selection optionsz-xz--exitfirstZstore_const�maxfailr z-exit instantly on first error or failed test.)�action�dest�const�helpz --maxfail�num�storer z(exit after first num failures or errors.)�metavarr r r r r z--strict�
store_truez2run pytest in strict mode, warnings become errors.)r r z-c�fileZinifilenamezcload configuration from `file` instead of trying to locate one of the implicit configuration files.)r r r r z--continue-on-collection-errorsF�continue_on_collection_errorsz5Force test execution even if collection errors occur.)r r r r �collect�
collectionz
--collectonlyz--collect-onlyz'only collect tests, don't execute them.z--pyargsz2try to interpret all arguments as python packages.z--ignore�append�pathz.ignore path during collection (multi-allowed).)r r r z--confcutdirZ
confcutdir�dir)�optnamez2only load conftest.py's relative to specified dir.)r r r r r z--noconftestZ
noconftestz!Don't load any conftest.py files.)r r r r z--keepduplicatesz--keep-duplicates�keepduplicateszKeep duplicate tests.Zdebugconfigz(test session debugging and configurationz
--basetempZbasetempz+base temporary directory for this test run.)r r r r ) ZaddiniZgetgroupZ
_addoption�int�strZ addoption� functools�partialr )�parser�group� r) �=/opt/alt/python37/lib/python3.7/site-packages/_pytest/main.py�pytest_addoption sL
r+ c C s t ttttd�} t | d�S )N)�Item� Collector�File�Session)r )�dictr, r- r. r/ )r r) r) r* �pytest_namespaceN s r1 c C s
| t _d S )N)�pytest�config)r3 r) r) r* �pytest_configureS s r4 c
C s> t | �}t|_d}z�y2| �� d}| jj|d� d}|| |�p@d|_W n� tjk
r^ � Y n� tk
r� t j
�� }|dk r�t|j
tjj�r�tj�d�|j|j
j�� | jj|d� t|_Y n@ t j
�� }| �|| j� t|_|�t�r�tj�d� Y nX W dd}|j�� |dk�r.| jj||jd � | � � X |jS )
zSkeleton command line programr r )�sessionr z {0}: {1}
)�excinfoz&mainloop: caught Spurious SystemExit!
N)r5 �
exitstatus)!r/ �EXIT_OKr7 Z
_do_configure�hookZpytest_sessionstartr2 �
UsageError�KeyboardInterrupt�_pytest�_codeZ
ExceptionInfo�
isinstance�value�exit� Exception�sys�stderr�write�format�typename�msgZpytest_keyboard_interrupt�EXIT_INTERRUPTEDZnotify_exception�option�EXIT_INTERNALERROR�
errisinstance�
SystemExit�startdir�chdirZpytest_sessionfinishZ_ensure_unconfigure)r3 Zdoitr5 Z initstater6 r) r) r* �wrap_sessionW sD
rO c C s
t | t�S )N)rO �_main)r3 r) r) r* �pytest_cmdline_main~ s rQ c C s8 | j j|d� | j j|d� |jr&tS |jdkr4tS dS )z] default command line protocol for initialization, session,
running tests and reporting. )r5 r N)r9 �pytest_collection�pytest_runtestloop�testsfailed�EXIT_TESTSFAILED�testscollected�EXIT_NOTESTSCOLLECTED)r3 r5 r) r) r* rP � s
rP c C s | � � S )N)�perform_collect)r5 r) r) r* rR � s rR c C s� | j r | jjjs | �d| j ��| jjjr.dS x^t| j�D ]P\}}|d t| j�k rb| j|d nd }|jj j
||d� | jr:| �| j��q:W dS )Nz%d errors during collectionTr )�item�nextitem)rT r3 rI r �InterruptedZcollectonly� enumerate�items�lenr9 Zpytest_runtest_protocol�
shouldstop)r5 �irY rZ r) r) r* rS � s
$rS c C s| | � � }|jd|d�}|pg }|�d�}|r@|�dd� |D �� | |krLdS |�d�}|jj}|sx| |krndS |�| � dS ) NZcollect_ignore)r �ignorec S s g | ]}t j�|��qS r) )�pyr �local)�.0�xr) r) r* �
<listcomp>� s z)pytest_ignore_collect.<locals>.<listcomp>Tr"