Your IP : 18.191.192.113


Current Path : /opt/alt/python34/lib/python3.4/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/setuptools/command/__pycache__/test.cpython-34.pyc

�
M�Re,�@s�ddlmZddlmZddlZddlTddlmZddlmZm	Z	Gdd�de�Z
Gd	d
�d
e�ZdS)�)�Command)�DistutilsOptionErrorN)�*)�_namespace_packages)�
TestLoader�mainc@seZdZdd�ZdS)�ScanningLoadercCs,g}|jdkr1|jtj||��nt|d�rV|j|j��nt|d�rx�t|jd�D]�}|jd�r�|dkr�|jd|dd
�}n-t|j|d
�rx|jd|}nqx|j|j	|��qxWnt
|�dkr |j|�S|dSdS)aReturn 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.
        zsetuptools.tests.doctest�additional_tests�__path__�z.pyz__init__.py�.N�z/__init__.py�r���)�__name__�appendr�loadTestsFromModule�hasattrr	�resource_listdir�endswith�resource_existsZloadTestsFromName�lenZ
suiteClass)�self�module�tests�file�	submodule�r�2/tmp/pip-l4uy7dan-build/setuptools/command/test.pyr
s"
z"ScanningLoader.loadTestsFromModuleN)r�
__module__�__qualname__rrrrrrsrc@sdeZdZdZdZddgZd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dS)�testz.Command to run unit tests after in-place buildz#run unit tests after in-place build�test-module=�m�$Run 'test_suite' in specified module�test-suite=�s�1Test suite to run (e.g. 'some_module.test_suite')cCsd|_d|_d|_dS)N)�
test_suite�test_module�test_loader)rrrr�initialize_options7s		ztest.initialize_optionscCs�|jdkrC|jdkr0|jj|_q[|jd|_n|jr[td��n|jg|_|jr�|jjdd�n|jdkr�t|jdd�|_n|jdkr�d|_ndS)Nz.test_suitez1You may specify a module or a suite, but not bothrz	--verboser*z&setuptools.command.test:ScanningLoader)	r(r)�distributionr�	test_args�verbose�insertr*�getattr)rrrr�finalize_options=s		ztest.finalize_optionsc
Cs�tjdkr�t|jdd�r�|jddd�|jd�|jd�}t|j�}|jdd|�|jd�|jd	dd�|jd	�n-|jd�|jd	dd
�|jd	�|jd�}tj	dd�}tj
j�}z[tj	jdt|j
��tj�tdd��td
|j|jf�|�Wd|tj	dd�<tj
j�tj
j|�tj�XdS)Nr
�use_2to3F�build_pyZinplacer�egg_info�egg_base�	build_extrcSs
|j�S)N)�activate)�distrrr�<lambda>tsz/test.with_project_on_sys_path.<locals>.<lambda>z%s==%s)r
)�sys�version_infor0r,�reinitialize_command�run_command�get_finalized_command�normalize_path�	build_lib�path�modules�copyr/r5�working_set�__init__�add_activation_listener�require�egg_nameZegg_version�clear�update)r�funcZbpy_cmdZ
build_pathZei_cmdZold_pathZold_modulesrrr�with_project_on_sys_pathTs2$





ztest.with_project_on_sys_pathcCs�|jjr%|jj|jj�n|jjrJ|jj|jj�n|jr�dj|j�}|jr�|jd|�q�|jd|�|j	|j
�ndS)N� z skipping "unittest %s" (dry run)zrunning "unittest %s")r,Zinstall_requiresZfetch_build_eggsZ
tests_requirer(�joinr-�dry_run�announcerL�	run_tests)r�cmdrrr�run~s		ztest.runcCs2ddl}tjd
kr�t|jdd�r�|jdjd�d}|tkr�g}|tjkr{|j	|�n|d7}x0tjD]%}|j
|�r�|j	|�q�q�Wtttjj
|��q�ntjd|j�}|jdd�}|�}|jdd|jg|jd	|�dS)Nrr
r2Frrzx=rGZ
testLoader)r
���)�unittestr:r;r0r,r-�splitrrBr�
startswith�list�map�__delitem__�
EntryPoint�parser*�loadr�__file__)rrUrZdel_modules�nameZ	loader_ep�loader_classZcksrrrrQ�s$$
	ztest.run_testsN)r"r#r$)r%r&r')rrr �__doc__�description�user_optionsr+r1rLrSrQrrrrr!+s	*r!)�
setuptoolsr�distutils.errorsrr:�
pkg_resourcesrrUrrrr!rrrr�<module>s
#

?>