Your IP : 216.73.216.213
B
�d{T�� � @ sD d Z ddlmZ dZddlZddlZddlmZ ddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ dd lmZ dd
lmZmZmZmZ ddlmZ ddl Z!e"e!dd��syddl#Z dd
l#m$Z$ W n" e%k
�r e%de& ��Y nX nddl Z dd
l m$Z$ ddl'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0 dddddgZ1dZ2ed�e�Z3dZ4dd� Z5dd� Z6dd � Z7e2d!d"d#fd$d�Z8d%d&� Z9G d'd(� d(e j:�Z;G d)d*� d*e<�Z=dd+l,m>Z> e>e j?�d,d-� �Z@e>e j?�d.d/� �ZAe j?Z?G d0d1� d1eB�ZCG d2d3� d3eD�ZEe jFZGG d4d5� d5e$�ZHd6d7� ZIG d8d9� d9eD�ZJG d:d;� d;eK�ZLd<d=� ZMG d>d?� d?e jN�ZNed@�eNjO�eN_OddlPZPG dAdB� dBe j?�ZQG dCdD� dDePjR�ZRG dEdF� dFeN�ZSdaTG dGdH� dH�ZUG dIdJ� dJejV�ZWG dKdL� dL�ZXdMdN� ZYdOdP� ZZG dQdR� dR�Z[dSdT� Z\dUdV� Z]dWdX� Z^dS )Ya� Run tests.
This will find all modules whose name match a given prefix in the test
directory, and run them. Various command line options provide
additional facilities.
Command line options:
-v verbose -- run tests in verbose mode with output to stdout
-q quiet -- don't print anything except if a test fails
-t testdir -- directory where the tests will be found
-x exclude -- add a test to exclude
-p profile -- profiled execution
-d dbc -- enable design-by-contract
-m match -- only run test matching the tag pattern which follow
If no non-option arguments are present, prefixes used are 'test',
'regrtest', 'smoketest' and 'unittest'.
� )�print_functionzrestructuredtext enN)�rmtree)�
itemgetter)� dropwhile)�isgeneratorfunction)�string_types)�builtins�range�configparser�input)�
deprecated�__package__)�SkipTestz.You have to install python-unittest2 to use %s)�wraps)�Debugger�colorize_source)�cached�
classproperty)� textutils�main�
unittest_main�
find_testsZrun_test�spawn)�testZregrtestZ smoketest�unittest�funcZ
validationz*[lgc 0.63] use inspect.isgeneratorfunction� c s0 t � �r� fdd�}|S t� �� fdd��}|S )z�A decorator ensuring no temporary file left when the function return
Work only for temporary file create with the tempfile modulec ? sZ t �� }t jdd�}|t _zx� | |�D ]
}|V q(W W d zt|dd� W d |t _X X d S )Nz temp-lgc-)�prefixT)�
ignore_errors)�tempfile�
gettempdir�mkdtemp�tempdirr )�args�kwargs�
old_tmpdir�
new_tmpdir�x)�callable� �G/opt/alt/python37/lib/python3.7/site-packages/logilab/common/testlib.py�proxyc s zwith_tempdir.<locals>.proxyc sF t �� }t jdd�}|t _z
� | |�S zt|dd� W d |t _X X d S )Nz temp-lgc-)r T)r )r r r! r"