Current File : //opt/imh-python/lib/python2.7/test/test_zipimport_support.pyo
�
��Wc@s>ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZmZmZmZmZmZejjZddlmZmZmZmZddlmZd�Zdefd��YZd�Zed	kr:e�ndS(
i����N(tspawn_pythontkill_pythont
run_pythonttemp_dirtmake_scripttmake_zip_script(ttest_doctesttsample_doctesttsample_doctest_no_docteststsample_doctest_no_docstrings(tImportHooksBaseTestCasec	Cstj}tjj�t_z�tjdtdt�}tj	dt�}yd|j
|jf}Wntk
r~|j}nXx*|j
|||�D]}|j|�q�W|j|j}}|r�tjjd||f��nWd|t_Xtr
d|j|fGHn||fS(Ntverbosetrecurses%s.%ss%d of %d doctests faileds,doctest (%s) ... %d tests with zero failures(tsyststdoutttestttest_supporttget_original_stdouttdoctestt
DocTestFinderRtFalset
DocTestRunnert
__module__t__name__tAttributeErrortfindtruntfailuresttriest
TestFailed(	tobjtmoduletsave_stdouttfindertrunnertnametexampletftt((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyt_run_object_doctest%s$	

#
tZipSupportTestscBs5eZd�Zd�Zd�Zd�Zd�ZRS(cCs(tj�tjj�tj|�dS(N(t	linecachet
clearcachet	zipimportt_zip_directory_cachetclearR
tsetUp(tself((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyR.Fs

c	Cs�d}t���}t|d|�}tjjdtjj|��}t|d||�\}}tj|�tjj	d|�ddl
}|jtj
|j�|�WdQXdS(Nsdef foo(): pass
t__init__tzip_pkgttest_zipii����(RRtostpathtjointbasenameRtremoveR
tinsertR1tassertEqualtinspectt	getsourcetfoo(R/ttest_srctdt	init_nametname_in_ziptzip_nametrun_nameR1((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyt test_inspect_getsource_issue4223Ls	
c%Cs%tjt�}|jdd�}|jdd�}|jdd�}i}xjtttgD]Y}tj|�}|jdd�}|jjd�d}|jd	d
�}|||<q[Wt	��^}t
|d|�}t|d|�\}}	tj
|d�}
x.|j�D] \}}|
j|d
|�q
W|
j�trstj
|d�}d|GH|j�|j�ntj|�tjjd|�ddl}|j|jj|jjj|jj|jj|jj|jj|jj|jj |j!|j!j|j!j|j!j |j"|j#|j$|j%|j&|j'|j(|j)j*|j)j+|j)j,|j)j-|j)j.|j/|j0|j1|j2|j3|j4|j5|j6g!}
|j7|j8|j9g}g}tj:r�|dt;fdt<fg7}nt=j>j?|��#x|
D]}t@||�q�WWdQXWdQXdS(Nsfrom test import test_doctests*import test_zipped_doctest as test_docteststest.test_doctestttest_zipped_docteststest.sample_doctesttsample_zipped_doctestt.i����tsample_tsample_zipped_R2tas.pytrsContents of %r:isbackquote not supportedsexecfile.. not supported(AR:R;RtreplaceRRR	RtsplitRRRtzipfiletZipFiletitemstwritestrtcloseRtprintdirR3R7R
R4R8RDtSampleClasstNestedClassR0t
a_classmethodt
a_propertyta_staticmethodtdoubletgettSampleNewStyleClasst	old_test1t	old_test2t	old_test3t	old_test4tsample_functtest_DocTestttest_DocTestParserttest_DocTestRunnertbasicst
exceptionstoption_directivestoptionflagstverbose_flagttest_Examplet
test_debugttest_pdb_set_tracettest_pdb_set_trace_nestedttest_testsourcettest_trailing_space_in_testttest_DocTestSuitettest_DocTestFinderttest_DocFileSuitet
test_testfilettest_unittest_reportflagstpy3kwarningt
SyntaxWarningtDeprecationWarningRRtcheck_warningsR'(R/R=tsample_sourcestmodtsrctmod_nameR>tscript_nameRARBtztzip_fileRDtknown_good_teststfail_due_to_missing_data_filestdeprecationsR((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyttest_doctest_issue4197Ys�						
			
	


																		
c
	Cs�tjd�}d}t���}t|d|�}t|�\}}||df}trqdG|GHdGH|GHn|j||�t|d|d�\}}	t|�\}}||	df}tr�dG|GHdGH|GHn|j||�WdQXdS(	Ns�                    class Test:
                        ">>> 'line 2'"
                        pass

                    import doctest
                    doctest.testmod()
                    sFile "%s", line 2, in %stscripts
__main__.Tests
Expected linesGot stdout:R2s__main__.py(ttextwraptdedentRRRRtassertInR(
R/R=tpatternR>R{t	exit_codetdatatexpectedRARB((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyttest_doctest_main_issue4197�s*				c	Cs�tjd�}t���}t|d|�}t|�}|jjd�t|�}|j||�t	|d|d�\}}t|�}|jjd�t|�}|j||�WdQXdS(Ns�                    def f():
                        pass

                    import pdb
                    pdb.runcall(f)
                    R�sl
R2s__main__.py(
R�R�RRRtstdintwriteRR�R(R/R=R>R{tpR�RARB((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyttest_pdb_issue4201�s		(RRR.RCR�R�R�(((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyR(@s
		
	i	cCs!tjjt�tjj�dS(N(RRtrun_unittestR(t
reap_children(((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyt	test_main�st__main__( ttest.test_supportRR3tos.pathR
R�RMR+RR:R)tpdbtwarningsttest.script_helperRRRRRRRRRRRR	ttest.test_importhooksR
R'R(R�R(((st/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_zipimport_support.pyt<module>s(."	�