Current File : //opt/imh-python/lib/python2.7/test/test_warnings.pyc
�
��Wc@sddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlZddl
Ze	jdddg�Ze	jdddg�Zed	��Zd
ejfd��YZdefd
��YZdeejfd��YZdeejfd��YZdefd��YZdeefd��YZdeefd��YZdejfd��YZdeefd��YZdeefd��YZdejfd��YZd eefd!��YZ d"eefd#��YZ!d$efd%��YZ"d&ejfd'��YZ#d(ee#fd)��YZ$d*ee#fd+��YZ%d,efd-��YZ&d.e&fd/��YZ'd0e&fd1��YZ(d2efd3��YZ)d4e)fd5��YZ*d6e)fd7��YZ+d8�Z,e-d9kre,�ndS(:i����(tcontextmanagerN(ttest_support(tassert_python_oktwarningstblockedt	_warningstfreshccs�x9ttfD]+}y|jj�Wq
tk
r7q
Xq
Wytj�Wntk
r]nXtj}|j}z)||_|jd�|t_dVWd|t_||_XdS(s8Use a specific warnings implementation in warning_tests.tonceN(	tsyst
warning_testst__warningregistry__tcleartAttributeErrort	NameErrorRtfilterstsimplefilter(tmoduletto_cleartoriginal_warningstoriginal_filters((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pytwarnings_states$

		

			tBaseTestcBs eZdZd�Zd�ZRS(s'Basic bookkeeping required for testing.cCssdt�krt�d=nttd�r4t`nttd�rLt`n|jtjd<tt|�j	�dS(NR
R(
tglobalsthasattrR	R
RRtmodulestsuperRtsetUp(tself((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR/s
		cCs$ttjd<tt|�j�dS(NR(RRRRRttearDown(R((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR=s
(t__name__t
__module__t__doc__RR(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR+s	tPublicAPITestscBseZdZd�ZRS(sGEnsures that the correct values are exposed in the
    public API.
    cCs]|jt|jd��dddddddd	g}|jt|jj�t|��dS(
Nt__all__twarnt
warn_explicittshowwarningt
formatwarningtfilterwarningsRt
resetwarningstcatch_warnings(t
assertTrueRRtassertSetEqualtsetR!(Rt
target_api((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_module_all_attributeGs		(RRRR-(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR AstCPublicAPITestscBseZeZRS((RRt
c_warningsR(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR.OstPyPublicAPITestscBseZeZRS((RRtpy_warningsR(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR0RstFilterTestscBs_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
s$Testing the filtering functionality.cCs^tjd|j��C}|jj�|jjddt�|jt|jjd�WdQXdS(NRterrortcategorysFilterTests.test_error(RR(RR'R&tUserWarningtassertRaisesR"(Rtw((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt
test_errorYs

cCsttjdtd|j��S}|jj�|jjddt�|jjdt�|jt	|�d�WdQXdS(NtrecordRtignoreR4sFilterTests.test_ignorei(
RR(tTrueRR'R&R5R"tassertEqualtlen(RR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_ignore`s
cCs�tjdtd|j���}|jj�|jjddt�d}|jj|t�|j||dj	�|jj|t�|j|dj	|�WdQXdS(NR9RtalwaysR4sFilterTests.test_alwaysi����(
RR(R;RR'R&R5R"R)tmessage(RR7R@((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_alwayshs
cCs�tjdtd|j���}|jj�|jjddt�td�}x�td�D]t}|jj|t�|dkr�|j	|dj
|�|2qZ|d	kr�|j	t|�d�qZtd
��qZWWdQXdS(NR9RtdefaultR4sFilterTests.test_defaultiii����isloop variant unhandled(
RR(R;RR'R&R5txrangeR"R<R@R=t
ValueError(RR7R@tx((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_defaultss
cCs�tjdtd|j���}|jj�|jjddt�td�}|jj|t�|j|dj	|�|2|jj|t�|jt
|�d�WdQXdS(NR9RR4sFilterTests.test_modulei����i(RR(R;RR'R&R5R"R<R@R=(RR7R@((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_module�s
c	Cs�tjdtd|j���}|jj�|jjddt�td�}|jj|tdd�|j|dj	|�|2|jj|tdd	�|jt
|�d
�|jj|tdd�|jt
|�d
�WdQXdS(NR9RRR4sFilterTests.test_oncestest_warnings.pyi*i����i
istest_warnings2.py(RR(R;RR'R&R5R#R<R@R=(RR7R@((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt	test_once�s
c	Csatjd|j��F}|jj�|jjddt�|jt|jjdt�WdQXdS(NRR3R4sFilterTests.test_inheritance(	RR(RR'R&tWarningR6R5R"(RR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_inheritance�s

c
Cs�tjdtd|j���}|jj�|jjddt�|jjddtdt�|2y|jjdt�Wntk
r�|jd�nX|j	t
|�d	�WdQXdS(
NR9RR:R4R3tappendsFilterTests.test_orderings!order handling for actions failedi(RR(R;RR'R&R5R"tfailR<R=(RR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt
test_ordering�s

c
Cs�tjdtd|j��t}|jjddtdd�|jt|jjd�|jj	�d}|jj|�|j
t|dj�|�|j
|djtk�|jjd	dtdd�d
}|jj|�|jt|dj�|�|jj	�|jjddtdd�|jt|jjd�d
}|jj|�|j
t|dj�|�|j
|djtk�WdQXdS(NR9RR3tisconvert to errorshandle normallyi����R:sfiltered outshex*shex/octsnonmatching text(RR(R;RR&RIR6R5R"R'R<tstrR@R)R4tassertNotEqual(RR7ttext((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_filterwarnings�s(

(RRRR8R>RARFRGRHRJRMRR(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR2Us								tCFilterTestscBseZeZRS((RRR/R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyRS�st
PyFilterTestscBseZeZRS((RRR1R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyRT�st	WarnTestscBszeZdZd�Zd�Zd�Zd�Zeje	e
d�d�d��Zd�Zd	�Z
d
�Zd�ZRS(s2Test warnings.warn() and warnings.warn_explicit().c	Cs�tjdtd|j��}|jjd�xetd�D]W}d|}|jj|�|jt|dj	�|�|j
|djtk�q;WWdQXdS(NR9RRismulti %di����(
RR(R;RRtrangeR"R<ROR@R)R4R5(RR7tiRQ((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_message�s
cCs�t|j���tjdtd|j��g}tjd�|jtj	j
|dj�d�tjd�|jtj	j
|dj�d�WdQXWdQXdS(NR9Rtspam1i����swarning_tests.pytspam2(
RRRR(R;R	tinnerR<tostpathtbasenametfilenametouter(RR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt
test_filename�s

cCs�t|j��mtjdtd|j��K}tjddd�|jtj	j
|dj�d�tjddd�|jtj	j
|dj�d�tjd	dd
�|jtj	j
|dj�d�tjddd
�|jtj	j
|dj�d�tjd
dd�|jtj	j
|dj�d�tjddd�|jtj	j
|dj�d�WdQXWdQXdS(NR9Rtspam3t
stacklevelii����swarning_tests.pytspam4tspam5istest_warnings.pytspam6sspam6.5itspam7i'R(
RRRR(R;R	R[R<R\R]R^R_R`(RR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_stacklevel�s*cCs�tj}zqt`t|j��Vtjdtd|j��4}tjddd�|j|dj	tj
�WdQXWdQXWd|t_XdS(NR9Rtspam8Rcii����(R	t__file__RRRR(R;R[R<R_R(RR_R7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_missing_filename_not_mains	*targvstest needs sys.argvcCs�tj}tj}z~t`dt_t|j��Ztjdtd|j��8}tjddd�|j	|dj
tjd�WdQXWdQXWd|t_|t_XdS(	Nt__main__R9Rtspam9Rcii����i(
R	RjRRRRR(R;R[R<R_RRl(RR_tmodule_nameR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt$test_missing_filename_main_with_argvs			.	cCs�tj}tj}tj}z}t`dt_t`t|j��Stjdt	d|j��1}tj
ddd�|j|djd�WdQXWdQXWd|t_|t_|t_XdS(NRmR9Rtspam10Rcii����(
R	RjRRRlRRRR(R;R[R<R_(RR_RoRlR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt'test_missing_filename_main_without_argv+s				'		cCs�tj}tj}tj}z�t`dt_dgt_t|j��Stjdt	d|j��1}tj
ddd�|j|djd�WdQXWdQXWd|t_|t_|t_XdS(	NRmRNR9Rtspam11Rcii����(
R	RjRRRlRRRR(R;R[R<R_(Rt	file_nameRoRlR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt1test_missing_filename_main_with_argv_empty_string?s				'		c	Csv|jt|jjdtdd�|jt|jjdddd�|jttf|jjdtdddd�dS(Nitregistryi*(R6t	TypeErrorRR#tNoneR5RRI(R((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_warn_explicit_type_errorsTs	cCsCdtfd��Y}|jt��|jj|��WdQXdS(Nt
BadStrWarningcBseZdZd�ZRS(s-Warning with a bad format string for __str__.cSsdidd6S(NsA bad formatted string %(err)sthere is no %(err)sterr((R((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt__str__is(RRRR|(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyRzgs(RIR6RDRR"(RRz((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_bad_strcs(RRRRXRaRhRktunittestt
skipUnlessRRRpRrRuRyR}(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyRU�s	
			$			t
CWarnTestscBseZeZd�ZRS(cCs6|jt|jk�|jt|jjd��dS(Nt	func_code(tassertFalseRRRR"(R((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_acceleratedvs(RRR/RR�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR�qstPyWarnTestscBseZeZd�ZRS(cCs6|jt|jk�|jt|jjd��dS(NR�(R�RRR)RR"(R((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_pure_pythons(RRR1RR�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR�zst
WCmdLineTestscBs#eZd�Zd�Zd�ZRS(cCs�tjd|j���|j|jj|jjd�|j|jj|jjd�|j|jj|jjd�|jjd�|jt|jjd�WdQXdS(NRs1:2:3:4:5:6sbogus::Warningsignore:2::4:-5serror::Warning::0sconvert to error(RR(RR6t_OptionErrort
_setoptionR5R"(R((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_improper_input�scCs/tddd�\}}}|jd|�dS(Ns-Wxxxs-ctpasss0Invalid -W option ignored: invalid action: 'xxx'(RtassertIn(RtrctoutR{((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_improper_option�scCsBtddd�\}}}|j|j��|jd|�dS(Ns-Wis-cs?import sys; sys.modules['warnings'].warn('foo', RuntimeWarning)tRuntimeWarning(RR�tstriptassertNotIn(RR�R�R{((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_warnings_bootstrap�s	(RRR�R�R�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��s	
	tCWCmdLineTestscBseZeZRS((RRR/R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��stPyWCmdLineTestscBseZeZRS((RRR1R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��st_WarningsTestscBs\eZdZeZd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�ZRS(	s'Tests specific to the _warnings module.c
Csytjd|j��^}|jjddtdd�|jt|jjd�|j`|jt|jjd�WdQXdS(NRR3RNisconvert to error(	RR(RR&RIR6R5R"R(RR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_filter�s	c	Csatd�}zA|jj}iatjdtd|j��}|jj�|jjddt�|jj	|tdd�|j
|dj|�|2|jj	|tdd�|j
t|�d	�i|j_ia|jj
d�|j
|djj|j�|2|j`ia|jj	|tdd�|j
t|�d	�WdQXWd||j_XdS(
Nsonceregistry testR9RRR4tfilei*i����i(R5RtonceregistryR
RR(R;R'R&R#R<R@R=R"targs(RR@toriginal_registryR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_onceregistry�s.
	 cCs�td�}|jj}zitjdtd|j��H}|jj�i}|jj|tddd|�|j|dj	|�|jt
|�d�|jt
|�d�|2|j`i}i}|jj|tdd	d|�|j|dj	|�|jt
|�d�|jt
|�d�|2d
|j_i}i}|jj|tddd|�|jt
|�d�WdQXWd||j_XdS(
Nsdefaultaction testR9Rs<test>i*Rvi����ii+R:i,i(R5Rt
defaultactionRR(R;R'R#R<R@R=(RR@toriginalR7RvR
((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_default_action�s:
	 c
Cs�d}tjd|j��X|jjddt�|j`tjd��#}|jj|�|j	�}WdQXWdQX|j
||�dS(Nsdel showwarning testRR?R4tstderr(RR(RR&R5R$Rtcaptured_outputR"tgetvalueR�(RRQtstreamtresult((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_showwarning_missing�s	c	Cs{tjd|j��`|jjddt�|jj}d|j_z|jt|jjd�Wd||j_XWdQXdS(NRR?R4isWarning!(	RR(RR&R5R$R6RwR"(Rtold_showwarning((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_showwarning_not_callablesc

Csrd}tjd|j��U|jjddt�|j`tjd�� }tj	|�|j
�}WdQXWdQX|j|jd�dd|�|j
dd	�\}}tjjtj�d
d}|jdd
�}|\}}	}
}t|	�}	|j||�|j|
dtj�|j|d|�dtj||	�j�d}|s^t�|j||�dS(Nstest show_warningRR?R4R�s
isToo many newlines in %riis.pyt:it s  (RR(RR&R5R$RR�R	R[R�R<tcounttsplitR\R]tsplitextRjtrsplittintRt	linecachetgetlineR�tAssertionError(
RRQR�R�t
first_linetsecond_linet
expected_filetfirst_line_partsR]tlinet
warning_classR@t
expected_line((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_show_warning_outputs(	
 cCs�t�}|d}z�tjd|jdt��:}|jjddt�d|d<|jjdt�WdQX|j	t
|�d�|j	|djt�|j	t|dj
�d�Wd||d<XdS(	NRjRR9R?R4ttestii(RRR(RR;R&R5RxR"R<R=R4ROR@(Rtglobals_dicttoldfileR7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_filename_none's	

!cCsLtdd�\}}}|j|d�|jd|�|jd|�dS(Ns-csjimport sys; sys.stderr = None; import warnings; warnings.simplefilter('always'); warnings.warn('Warning!')RNsWarning!tError(RR<R�(RR�tstdoutR�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_stderr_none6s
(
RRRR/RR�R�R�R�R�R�R�R�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��s	
		#		
		tWarningsDisplayTestscBskeZdZd�Zejd��Zejejej	d�d���Z
ejd��Zd�ZRS(siTest the displaying of warnings and the ability to overload functions
    related to displaying warnings.cCs�d}t}tjjtj�dd}d}tj||�j�}d}||||j	||f}|j
||jj||||��|d7}||||j	||f}|j
||jj|||||��dS(Ntmsgis.pyis%s:%s: %s: %s
  %s
s
 for the win!(
RIR\R]R�R	RjR�R�R�RR<RR%(RR@R4Rttline_numt	file_linetformattexpect((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_formatwarningEs


cCs�d}t}tjjtj�dd}d}tj||�j�}d}||||j	||f}|j
||jj||||��|d7}||||j	||f}|j
||jj|||||��dS(Numsgis.pyis%s:%s: %s: %s
  %s
s
 for the win!(
RIR\R]R�R	RjR�R�R�RR<RR%(RR@R4RtR�R�R�R�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_formatwarning_unicode_msgWs


sneed test_support.FS_NONASCIIc	Cs�d}t}tjd}|jtj��}d}d}d}||||jt|�|f}|j||j	j
|||||��d}||||j||f}|j||j	j
|||||��dS(Numsgu.pyitspams%s:%s: %s: %s
  %s
uµsg(RIRtFS_NONASCIItencodeRtgetfilesystemencodingRROR<RR%(	RR@R4tunicode_file_nameRtR�R�R�R�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt0test_formatwarning_unicode_msg_nonascii_filenamejs 


cCs�d}t}d}d}d}d}||||jt|�|f}|j||jj|||||��d}||||j|t|d�f}|j||jj|||||��dS(Numsgsfile.pyissp�ms%s:%s: %s: %s
  %s
uµsgtlatin1(RIRROR<RR%tunicode(RR@R4RtR�R�R�R�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt0test_formatwarning_unicode_msg_nonascii_fileline~s
cCs
tjjtj�dd}d}tj||�j�}d}t}t	j	�}|j
j||||�}|j
j|||||�|j
|j�|�|d7}|j
j|||||�}t	j	�}|j
j||||||�|j
||j��dS(Nis.pyiR�sfor the win!(R\R]R�R	RjR�R�R�RItStringIORR%R$R<R�(RRtR�texpected_file_lineR@R4tfile_objectR�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_showwarning�s$	

(
RRRR�Rtrequires_unicodeR�R~RR�R�R�R�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR�@s	!tCWarningsDisplayTestscBseZeZRS((RRR/R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��stPyWarningsDisplayTestscBseZeZRS((RRR1R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��stCatchWarningTestscBs;eZdZd�Zd�Zd�Zd�Zd�ZRS(sTest catch_warnings().cCs�|j}|j}|j}|jd|dt��t�|_|_WdQX|j|j|k�|j|j|k�|jd|dt��t�|_|_WdQX|j|j|k�|j|j|k�dS(NRR9(RRR$R(R;tobjectR)tFalse(Rtwmodtorig_filterstorig_showwarning((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_catch_warnings_restore�s			cCsY|j}|jd|dt���}|j|g�|jt|�tk�|jd�|jd�|jt	|dj
�d�|jd�|jt	|dj
�d�|jt	|dj
�d�|jt	|dj
�d�|2|j|g�WdQX|j}|jd|dt��0}|j|dk�|j|j|k�WdQXdS(	NRR9R?tfooi����tbarii(RR(R;R<R)ttypetlistRR"ROR@R$R�Rx(RR�R7R�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_catch_warnings_recording�s"	


	cCs�|j}|jd|dt�}|jt|j�|�|jt|j�WdQX|jd|dt�}|jt|j�|�|jt|j�WdQXdS(NRR9(RR(R;R6tRuntimeErrort__exit__t	__enter__R�(RR�RE((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt!test_catch_warnings_reentry_guard�s	cCs|j}|j}|j}|jd|��F}|j|dk�|j|j|k�|j|j|k	�WdQX|j|j|k�|tjdkr|j��F}|j|dk�|j|j|k�|j|j|k	�WdQX|j|j|k�ndS(NRR(RRR$R(R)RxRR(RR�R�R�R7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_catch_warnings_defaults�s			cCs�|j}|tjdk	r,|jd�ntjdt���}|j|jg�|j	d�|j
d�|jt|j�d�|j
d�|jt|j�d�|jt|jdj�d�|jt|jdj�d�|j
�|j|jg�WdQXtj��WdQXtjdtf��|j
d�WdQX|jt��!tjd	tf��WdQXWdQX|jt��.tjdtf��|j
d�WdQXWdQXdS(
NRs,module to test is not loaded warnings moduletquietR?R�R�iiRN(RRRtskipTestRtcheck_warningsR�R<RRR"ROR@tresetR5R6R�R�(RR�R7((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_check_warnings�s0	


  

(RRRR�R�R�R�R�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR��s			
	tCCatchWarningTestscBseZeZRS((RRR/R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR�stPyCatchWarningTestscBseZeZRS((RRR1R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR�stEnvironmentVariableTestscBs#eZd�Zd�Zd�ZRS(cCswtjj�}d|d<tjtjddgdtjd|�}|j|j	�dd�|j|j
�d�dS(	Nsignore::DeprecationWarningtPYTHONWARNINGSs-cs2import sys; sys.stdout.write(str(sys.warnoptions))R�tenvis['ignore::DeprecationWarning'](R\tenvirontcopyt
subprocesstPopenRt
executabletPIPER<tcommunicatetwait(Rtnewenvtp((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_single_warnings
cCswtjj�}d|d<tjtjddgdtjd|�}|j|j	�dd�|j|j
�d�dS(	Ns1ignore::DeprecationWarning,ignore::UnicodeWarningR�s-cs2import sys; sys.stdout.write(str(sys.warnoptions))R�R�is8['ignore::DeprecationWarning', 'ignore::UnicodeWarning'](R\R�R�R�R�RR�R�R<R�R�(RR�R�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_comma_separated_warnings%s
cCsztjj�}d|d<tjtjdddgdtjd|�}|j|j	�dd	�|j|j
�d�dS(
Nsignore::DeprecationWarningR�s-Wignore::UnicodeWarnings-cs2import sys; sys.stdout.write(str(sys.warnoptions))R�R�is8['ignore::UnicodeWarning', 'ignore::DeprecationWarning'](R\R�R�R�R�RR�R�R<R�R�(RR�R�((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyttest_envvar_and_command_line0s
(RRR�R�R�(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR�s			tCEnvironmentVariableTestscBseZeZRS((RRR/R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR:stPyEnvironmentVariableTestscBseZeZRS((RRR1R(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyR=scCsOtjj�tjj�tjtttt	t
ttt
ttttt�
dS(N(R1R�RR/Rtrun_unittestRSRTR�R�R�R�R�R�R�R�R�RR(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt	test_mainAs

Rm(.t
contextlibRR�R\R�RR~R�R�Rttest.script_helperRR	RRtimport_fresh_moduleR1R/RtTestCaseRR R.R0R�R2RSRTRUR�R�R�R�R�R�R�R�R�R�R�R�R�RRRR(((sk/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_warnings.pyt<module>sN{�	
�eg