Your IP : 216.73.216.85


Current Path : /opt/alt/python35/lib64/python3.5/lib2to3/tests/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/lib2to3/tests/__pycache__/support.cpython-35.pyc



��Yf��@sBdZddlZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZ
ejje�Zejjejjed��Zejjedd�Ze
je�Ze
jede	j�Zd	d
�Zdddd�Zd
d�Zddddd�Zdd�ZejZdS)z Support code for test_*.py files�N)�dedent)�pytree�refactor)�driverz..zGrammar.txt�convertcCstjt|�dd�S)N�debugT)r�parse_string�reformat)�string�r�:/opt/alt/python35/lib64/python3.5/lib2to3/tests/support.pyrsrcCs>|dkr!tj�j|�}tjdd�j|�dS)N�	verbosity�)�unittestZ
TestLoaderZloadTestsFromModuleZTextTestRunnerZrun)Ztest_modZtestsrrr�
run_all_testssrcCst|�dS)Nz

)r)r
rrrr	sr	�lib2to3cs]|dk	r(�fdd�|D�}ntj�d�}|pDi}tj||dd�S)a

    A convenience function for creating a RefactoringTool for tests.

    fixers is a list of fixers for the RefactoringTool to use. By default
    "lib2to3.fixes.*" is used. options is an optional dictionary of options to
    be passed to the RefactoringTool.
    Ncsg|]}�d|�qS)z.fixes.fix_r)�.0Zfix)�	fixer_pkgrr�
<listcomp>*s	z"get_refactorer.<locals>.<listcomp>z.fixesZexplicitT)rZget_fixers_from_packageZRefactoringTool)rZfixersZoptionsr)rr�get_refactorer!s
rccs[xTtjt�D]C\}}}x1|D])}|jd�r&tjj||�Vq&WqWdS)Nz.py)�os�walk�proj_dir�endswith�path�join)�dirpathZdirnames�	filenames�filenamerrr�all_project_files0s
r) �__doc__r�sysrZos.path�re�textwraprrrrZ
lib2to3.pgen2rZpgen2_driverr�dirname�__file__Ztest_dir�normpathrrZgrammar_pathZload_grammarZgrammarZDriverrrrr	rrZTestCaserrrr�<module>s&!