ó
    ×›‘hšI  ã                  óò   • S r SSKJr  SSKrSSKrSSKJr  SSKJrJ	r	J
r
  SSKJr  SSKJr  SSKJrJrJr  SS	KJr   " S
 S5      r\
" S5      r\
" S5      r " S S\5      r " S S\5      r " S S\5      rg)z?
Tests for Trial's interaction with the Python warning system.
é    )ÚannotationsN)ÚStringIO)ÚMappingÚSequenceÚTypeVar)Ú
TestResult)ÚFilePath)Ú_collectWarningsÚ_setWarningRegistryToNoneÚ_Warning)ÚSynchronousTestCasec                  ó.   • \ rS rSrSr " S S\5      rSrg)ÚMaské   zI
Hide a test case definition from trial's automatic discovery mechanism.
c                  ó@   • \ rS rSr% SrSr\rS\S'   S
S jr	S
S jr
Srg	)ÚMask.MockTestsé   z…
A test case which is used by L{FlushWarningsTests} to verify behavior
which cannot be verified by code inside a single test method.
úsome warning textztype[Warning]Úcategoryc                óZ   • [         R                  " U R                  U R                  5        g)z(
Generate a warning and don't flush it.
N)ÚwarningsÚwarnÚmessager   ©Úselfs    ÚcC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\twisted/trial/test/test_warning.pyÚtest_unflushedÚMask.MockTests.test_unflushed&   s   € ô �MŠM˜$Ÿ,™,¨¯©Õ6ó    c                ó¬   • [         R                  " U R                  U R                  5        U R	                  [        U R                  5       5      S5        g)z"
Generate a warning and flush it.
é   N)r   r   r   r   ÚassertEqualÚlenÚflushWarningsr   s    r   Útest_flushedÚMask.MockTests.test_flushed,   s8   € ô �MŠM˜$Ÿ,™,¨¯©Ô6Ø×ÑœS ×!3Ñ!3Ó!5Ó6¸Õ:r   © N©ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚUserWarningr   Ú__annotations__r   r%   Ú__static_attributes__r'   r   r   Ú	MockTestsr      s"   ‡ ñ	ð
 &ˆØ"-ˆ�-Ó-ô	7÷	;r   r3   r'   N)r+   r,   r-   r.   r/   r   r3   r2   r'   r   r   r   r      s   † ñô;Ð'÷ ;r   r   Ú_KÚ_Vc                  óÎ   • \ rS rSrSrSS jr      SS jrSS jrSS jrSS jr	SS jr
SS	 jrSS
 jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSrg)ÚFlushWarningsTestsé8   zY
Tests for C{flushWarnings}, an API for examining the warnings
emitted so far in a test.
c                ó^   • UR                  5        H  u  p4U R                  X   U5        M     g)zw
Assert that all the keys present in C{subset} are also present in
C{set} and that the corresponding values are equal.
N)Úitemsr"   )r   ÚsetÚsubsetÚkÚvs        r   ÚassertDictSubsetÚ#FlushWarningsTests.assertDictSubset>   s(   € ð
 —L‘L–N‰DˆAØ×Ñ˜S™V QÖ'ò #r   c                ó–   • U R                  [        U5      [        U5      5        [        X5       H  u  p4U R                  X45        M     g)z•
For each pair of corresponding elements in C{sets} and C{subsets},
assert that the element from C{subsets} is a subset of the element from
C{sets}.
N)r"   r#   Úzipr?   )r   ÚsetsÚsubsetsÚaÚbs        r   ÚassertDictSubsetsÚ$FlushWarningsTests.assertDictSubsetsF   s;   € ð 	×Ñœ˜T›¤C¨£LÔ1Ü˜Ö&‰DˆAØ×!Ñ! !Ö'ò 'r   c                óD   • U R                  U R                  5       / 5        g)zO
If no warnings are emitted by a test, C{flushWarnings} returns an empty
list.
N)r"   r$   r   s    r   Ú	test_noneÚFlushWarningsTests.test_noneR   s   € ð
 	×Ñ˜×+Ñ+Ó-¨rÕ2r   c                óÀ   • Sn[         n[        R                  " XS9  Sn[        n[        R                  " X4S9  U R	                  U R                  5       X!S.XCS./5        g)zd
If several warnings are emitted by a test, C{flushWarnings} returns a
list containing all of them.
zfirst warning message©r   r   zsecond warning message©r   r   N)r0   r   r   ÚRuntimeWarningrG   r$   )r   ÚfirstMessageÚfirstCategoryÚsecondMessageÚsecondCategorys        r   Útest_severalÚFlushWarningsTests.test_severalY   s[   € ð
 /ˆÜ#ˆÜ�Š˜lÒCà0ˆÜ'ˆÜ�Š˜mÒEà×ÑØ×ÑÓ à*ÑDØ+ÑFðõ	
r   c                ó¬   • Sn[         n[        S5       H  n[        R                  " XS9  M     U R	                  U R                  5       X!S./S-  5        g)zr
The same warning triggered twice from the same place is included twice
in the list returned by C{flushWarnings}.
úthe messageé   rM   rN   N)rO   Úranger   r   rG   r$   )r   r   r   Úis       r   Útest_repeatedÚ FlushWarningsTests.test_repeatedn   sR   € ð
  ˆÜ!ˆÜ�q–ˆAÜ�MŠM 'Ô=ñ ð 	×ÑØ×ÑÓ °Ñ#MÐ"NÐQRÑ"Rõ	
r   c                óÂ   • Sn[         n[        R                  " XS9  U R                  U R	                  5       X!S./5        U R                  U R	                  5       / 5        g)zq
After a particular warning event has been returned by C{flushWarnings},
it is not returned by subsequent calls.
rW   rM   rN   N)rO   r   r   rG   r$   r"   )r   r   r   s      r   Útest_clearedÚFlushWarningsTests.test_cleared|   sW   € ð
  ˆÜ!ˆÜ�Š˜gÒ9Ø×ÑØ×ÑÓ °Ñ#MÐ"Nô	
ð 	×Ñ˜×+Ñ+Ó-¨rÕ2r   c                ó*  • [        5       n[        R                  S5      nUR                  U5        U R	                  [        R                  R
                  /5      nU R                  US   S   S5        U R                  US   S   [        5        [        U5      R
                  R                  nUR                  nUR                  S-   nU R                  US   S   U5        U R                  US   S   U5        U R                  [        U5      S	5        g
)z`
Any warnings emitted by a test which are not flushed are emitted to the
Python warning system.
r   r   r   r   r   é   ÚfilenameÚlinenor!   N)r   r   r3   Úrunr$   r   r"   ÚassertIdenticalr0   ÚtypeÚ__code__Úco_filenameÚco_firstlinenor#   )r   ÚresultÚcaseÚwarningsShownÚwhererb   rc   s          r   r   Ú!FlushWarningsTests.test_unflushed‰   só   € ô
 “ˆÜ�~‰~Ð.Ó/ˆØ�‰�ÔØ×*Ñ*¬D¯N©N×,IÑ,IÐ+JÓKˆØ×Ñ˜ qÑ)¨)Ñ4Ð6IÔJØ×Ñ˜]¨1Ñ-¨jÑ9¼;ÔGä�T“
×)Ñ)×2Ñ2ˆØ×$Ñ$ˆð ×%Ñ%¨Ñ)ˆà×Ñ˜ qÑ)¨*Ñ5°xÔ@Ø×Ñ˜ qÑ)¨(Ñ3°VÔ<à×Ñœ˜]Ó+¨QÕ/r   c                ó  • [        5       n[        R                  S5      n[        5       nU R	                  [
        SU5      nUR                  U5        UR                  5         U R                  UR                  5       S5        g)z`
Any warnings emitted by a test which are flushed are not emitted to the
Python warning system.
r%   ÚstdoutÚ N)
r   r   r3   r   ÚpatchÚsysrd   Úrestorer"   Úgetvalue)r   rj   rk   ÚoutputÚmonkeys        r   r%   ÚFlushWarningsTests.test_flushed    s_   € ô
 “ˆÜ�~‰~˜nÓ-ˆÜ“ˆØ—‘œC ¨6Ó2ˆØ�‰�ÔØ�‰ÔØ×Ñ˜Ÿ™Ó*¨BÕ/r   c                óH  •  " S S[         5      n[        5       n[        R                  S5      nXl        [
        R                  SS n [
        R                  " S5        UR                  U5        U R                  [        UR                  5      S5        U R                  UR                  S   S   U5        U R                  UR                  S   S   R                  5       S   R                  S	5      5        U[
        R                  SS& g! U[
        R                  SS& f = f)
zž
If a warnings filter has been installed which turns warnings into
exceptions, tests have an error added to the reporter for them for each
unflushed warning.
c                  ó   • \ rS rSrSrg)ÚIFlushWarningsTests.test_warningsConfiguredAsErrors.<locals>.CustomWarningé´   r'   N©r+   r,   r-   r.   r2   r'   r   r   ÚCustomWarningr{   ´   ó   † Úr   r~   r   NÚerrorr!   r   éÿÿÿÿz CustomWarning: some warning text)ÚWarningr   r   r3   r   r   ÚfiltersÚsimplefilterrd   r"   r#   Úerrorsre   Ú
assertTrueÚ
splitlinesÚendswith©r   r~   rj   rk   ÚoriginalWarningss        r   Útest_warningsConfiguredAsErrorsÚ2FlushWarningsTests.test_warningsConfiguredAsErrors­   sî   € ô	œGô 	ô “ˆÜ�~‰~Ð.Ó/ˆØ%Œä#×+Ñ+©AÐ.Ðð	3Ü×!Ò! 'Ô*Ø�H‰H�VÔØ×ÑœS §¡Ó/°Ô3Ø× Ñ  §¡¨qÑ!1°!Ñ!4°dÔ;Ø�O‰Oð —‘˜aÑ  Ñ#ß‘“˜bñ"ç‘Ð<Ó=ôð #3ŒH×Ñ™QÑøÐ"2ŒH×Ñ™QÑús   Á	B/D ÄD!c                óp  •  " S S[         5      n[        5       n[        R                  S5      nXl        [
        R                  SS n [
        R                  " S5        UR                  U5        U R                  UR                  / 5        U[
        R                  SS& g! U[
        R                  SS& f = f)zª
If a warnings filter has been installed which turns warnings into
exceptions, tests which emit those warnings but flush them do not have
an error added to the reporter.
c                  ó   • \ rS rSrSrg)ÚPFlushWarningsTests.test_flushedWarningsConfiguredAsErrors.<locals>.CustomWarningéÒ   r'   Nr}   r'   r   r   r~   r�   Ò   r   r   r~   r%   Nr€   )r‚   r   r   r3   r   r   rƒ   r„   rd   r"   r…   r‰   s        r   Ú&test_flushedWarningsConfiguredAsErrorsÚ9FlushWarningsTests.test_flushedWarningsConfiguredAsErrorsË   s�   € ô	œGô 	ô “ˆÜ�~‰~˜nÓ-ˆØ%Œä#×+Ñ+©AÐ.Ðð	3Ü×!Ò! 'Ô*Ø�H‰H�VÔØ×Ñ˜VŸ]™]¨BÔ/à"2ŒH×Ñ™QÑøÐ"2ŒH×Ñ™QÑús   Á	AB  Â B5c                ó   • [         R                  " S5        U R                  [        U R	                  5       5      S5        [         R                  " S5        U R                  [        U R	                  5       5      S5        g)zk
Any warnings emitted after a call to C{flushWarnings} can be flushed by
another call to C{flushWarnings}.
zfirst messager!   zsecond messageN)r   r   r"   r#   r$   r   s    r   Útest_multipleFlushesÚ'FlushWarningsTests.test_multipleFlushesá   sY   € ô
 	�Š�oÔ&Ø×Ñœ˜T×/Ñ/Ó1Ó2°AÔ6Ü�ŠÐ&Ô'Ø×Ñœ˜T×/Ñ/Ó1Ó2°AÕ6r   c                óü   ^^^^• Sm[         mSUU4S jjnSm[        mSUU4S jjnU" 5         U" 5         U R                  U R                  U/S9TTS./5        U R                  U R                  U/S9TTS./5        g)	zÅ
The list returned by C{flushWarnings} includes only those
warnings which refer to the source of the function passed as the value
for C{offendingFunction}, if a value is passed for that parameter.
zfirst warning textc                 ó2   >• [         R                  " TT SS9  g ©Nr!   )Ú
stacklevel©r   r   )rQ   rP   s   €€r   ÚoneÚ>FlushWarningsTests.test_filterOnOffendingFunction.<locals>.oneô   s   ø€ Ü�MŠM˜,¨À!ÓDr   z	some textc                 ó2   >• [         R                  " TT SS9  g r˜   rš   )rS   rR   s   €€r   ÚtwoÚ>FlushWarningsTests.test_filterOnOffendingFunction.<locals>.twoú   s   ø€ Ü�MŠM˜-¨ÀAÓFr   ©ÚoffendingFunctionsrN   Nr(   )r0   rO   rG   r$   )r   r›   rž   rQ   rP   rS   rR   s      @@@@r   Útest_filterOnOffendingFunctionÚ1FlushWarningsTests.test_filterOnOffendingFunctionë   s™   û€ ð ,ˆÜ#ˆ÷	Eð 	Eð $ˆÜ'ˆ÷	Gð 	Gñ 	ŒÙŒà×ÑØ×Ñ°3°%ÐÐ8Ø'°LÑAÐBô	
ð 	×ÑØ×Ñ°3°%ÐÐ8Ø(°]ÑCÐDõ	
r   c                ón   • SS jnU" 5         U R                  [        U R                  U/S95      S5        g)zu
Verify that warnings emitted at the very edges of a function are still
determined to be emitted from that function.
c                 óˆ   • [         R                  " S5        [         R                  " S5        [         R                  " S5        g )Nzfirst line warningzinternal line warningzlast line warningrš   r'   r   r   ÚwarnerÚ:FlushWarningsTests.test_functionBoundaries.<locals>.warner  s)   € Ü�MŠMÐ.Ô/Ü�MŠMÐ1Ô2Ü�MŠMÐ-Õ.r   r    é   Nr(   ©r"   r#   r$   )r   r¦   s     r   Útest_functionBoundariesÚ*FlushWarningsTests.test_functionBoundaries	  s3   € ô	/ñ
 	ŒØ×Ñœ˜T×/Ñ/ÀFÀ8Ð/ÐLÓMÈqÕQr   c                óÆ   • [         R                  " S5        U R                  [        U R                  S/5        U R                  [        U R	                  5       5      S5        g)z¯
If an object which is neither a function nor a method is included in the
C{offendingFunctions} list, C{flushWarnings} raises L{ValueError}.  Such
a call flushes no warnings.
úoh noNr!   )r   r   ÚassertRaisesÚ
ValueErrorr$   r"   r#   r   s    r   Útest_invalidFilterÚ%FlushWarningsTests.test_invalidFilter  sH   € ô 	�Š�gÔØ×Ñœ* d×&8Ñ&8¸4¸&ÔAØ×Ñœ˜T×/Ñ/Ó1Ó2°AÕ6r   c                óˆ  • [        U R                  5       R                  S5      5      R                  S5      nUR	                  5         UR                  S5      R                  S5        UR                  S5      R                  S5        UR                  5       R                  R                  S5      n[        R                  R                  SU5        U R                  [        R                  R                  U5        SSKJn  U R                  [        R                  R                   S	5        U R                  [        R                  R                   UR"                  5        UR                  S5      R                  5         UR%                  5         U R'                  [)        U R+                  UR$                  /5      5      S
5        g)z`
Warnings emitted by a function the source code of which is not
available can still be flushed.
úutf-8ó   twisted_private_helperó   __init__.pyr   s   missingsourcefile.pyó7   
import warnings
def foo():
    warnings.warn("oh no")
r   )ÚmissingsourcefileÚtwisted_private_helperr!   N)r	   ÚmktempÚencodeÚchildÚmakedirsÚ
setContentÚparentÚpathÚdecoders   ÚinsertÚ
addCleanupÚremover¸   r·   ÚmodulesÚpopr+   Úfoor"   r#   r$   )r   ÚpackageÚ	pathEntryr·   s       r   Útest_missingSourceÚ%FlushWarningsTests.test_missingSource!  s=  € ô
 ˜4Ÿ;™;›=×/Ñ/°Ó8Ó9×?Ñ?Ø%ó
ˆð 	×ÑÔØ�‰�nÓ%×0Ñ0°Ô5Ø�‰Ð-Ó.×9Ñ9ðô	
ð —N‘NÓ$×)Ñ)×0Ñ0°Ó9ˆ	Ü�‰�‰˜˜9Ô%Ø�‰œŸ™Ÿ™¨Ô3õ
	
ð 	�‰œŸ™Ÿ™Ð)AÔBØ�‰œŸ™Ÿ™Ð):×)CÑ)CÔDØ�‰Ð-Ó.×5Ñ5Ô7à×ÑÔØ×Ñœ˜T×/Ñ/Ð1B×1FÑ1FÐ0GÓHÓIÈ1ÕMr   c                ó*  • [        U R                  5       R                  S5      5      R                  S5      nUR	                  5         UR                  S5      R                  S5        UR                  S5      R                  S5        UR                  5       R                  R                  S5      n[        R                  R                  SU5        U R                  [        R                  R                  U5        SSKJn  [        R                  S		 [        R                  UR                   	  SS
KJn  U" 5         UR)                  UR+                  S5      5        SSKJn  U R                  [        R                  R.                  S5        U R                  [        R                  R.                  UR                   5        UR1                  5         U R3                  [5        U R7                  UR0                  /5      5      S5        g! [&         a     NÖf = f)aÊ  
Warnings emitted by a function defined in a file which has been renamed
since it was initially compiled can still be flushed.

This is testing the code which specifically supports working around the
unfortunate behavior of CPython to write a .py source file name into
the .pyc files it generates and then trust that it is correct in
various places.  If source files are renamed, .pyc files may not be
regenerated, but they will contain incorrect filenames.
r³   r´   rµ   r   s	   module.pyr¶   r   )Úmoduler¸   )Úinvalidate_cachess   twisted_renamed_helperÚtwisted_renamed_helperr!   N)r	   r¹   rº   r»   r¼   r½   r¾   r¿   rÀ   rs   rÁ   rÂ   rÃ   r¸   rÌ   rÄ   r+   Ú	importlibrÍ   ÚImportErrorÚmoveToÚsiblingrÎ   rÅ   rÆ   r"   r#   r$   )r   rÇ   rÈ   rÌ   rÍ   s        r   Útest_renamedSourceÚ%FlushWarningsTests.test_renamedSourceD  s~  € ô ˜4Ÿ;™;›=×/Ñ/°Ó8Ó9×?Ñ?Ø%ó
ˆð 	×ÑÔØ�‰�nÓ%×0Ñ0°Ô5Ø�‰�lÓ#×.Ñ.ðô	
ð —N‘NÓ$×)Ñ)×0Ñ0°Ó9ˆ	Ü�‰�‰˜˜9Ô%Ø�‰œŸ™Ÿ™¨Ô3õ 	2ô �K‰KÐ0Ð1Ü�K‰K˜Ÿ™Ð(ð
	 Ý3ñ Ôð 	�‰�w—‘Ð'@ÓAÔBõ 	2à�‰œŸ™Ÿ™Ð)AÔBØ�‰œŸ™Ÿ™¨¯©Ô9ð 	�
‰
Œð 	×Ñœ˜T×/Ñ/°·±°Ó=Ó>ÀÕBøô% ó 	Ùð	ús   Ä.H È
HÈHc                óv   • SSS jjnU" 5         U R                  [        U R                  U/5      5      S5        g)ap  
In Python 3.6 the dis.findlinestarts documented behaviour
was changed such that the reported lines might not be sorted ascending.
In Python 3.10 PEP 626 introduced byte-code change such that the last
line of a function wasn't always associated with the last byte-code.
In the past flushWarning was not detecting that such a function was
associated with any warnings.
r!   c                óP   • U (       a  U(       a  [         R                  " S5        g g g )Nr­   rš   )rE   rF   s     r   rÆ   ÚCFlushWarningsTests.test_offendingFunctions_deep_branch.<locals>.fooŠ  s   € ÞÞÜ—M’M 'Õ*àð	 r   N)r!   r!   )rE   ÚintrF   rØ   r)   r*   r©   )r   rÆ   s     r   Ú#test_offendingFunctions_deep_branchÚ6FlushWarningsTests.test_offendingFunctions_deep_branch€  s2   € ö	ñ 	Œð 	×Ñœ˜T×/Ñ/°°Ó6Ó7¸Õ;r   r'   N)r;   úMapping[_K, _V]r<   rÛ   r)   r*   )rC   úSequence[Mapping[_K, _V]]rD   rÜ   r)   r*   r(   )r+   r,   r-   r.   r/   r?   rG   rJ   rT   r[   r^   r   r%   r‹   r‘   r”   r¢   rª   r°   rÉ   rÓ   rÙ   r2   r'   r   r   r7   r7   8   sy   † ñô
(ð
(Ø-ð
(Ø8Qð
(à	ô
(ô3ô
ô*
ô3ô0ô.0ô3ô<3ô,7ô
ô<Rô7ô!NôF:C÷x<r   r7   c                  ó   • \ rS rSrSrg)ÚFakeWarningi˜  r'   Nr}   r'   r   r   rÞ   rÞ   ˜  s   † Úr   rÞ   c                  óT   • \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS jr
S	rg
)ÚCollectWarningsTestsiœ  z 
Tests for L{_collectWarnings}.
c                ór  ^^^^• SmTSSS2   m[        SSS5      m/ mSUUUU4S jjn[        TR                  U5        U R                  TS   S	5        [	        TS   [
        5      (       d   eU R                  TS   R                  T5        [	        TS   [
        5      (       d   eU R                  TS   R                  T5        [	        TS   [
        5      (       d   eU R                  TS   R                  [        T5      5        U R                  TS
   S5        U R                  [        T5      S5        g)zC
L{_collectWarnings} calls the observer with each emitted warning.
zdummy calls observer warningNr�   r!   rX   r¨   c                 óÎ   >• T R                  S5        [        R                  " T5        [        R                  " T5        [        R                  " T5        T R                  S5        g )NÚcallÚ	returning)Úappendr   r   )ÚeventsrP   rR   ÚthirdMessages   €€€€r   ÚfÚ2CollectWarningsTests.test_callsObserver.<locals>.fª  s?   ø€ Ø�M‰M˜&Ô!Ü�MŠM˜,Ô'Ü�MŠM˜-Ô(Ü�MŠM˜,Ô'Ø�M‰M˜+Õ&r   r   rã   ra   rä   é   r(   )	r‚   r
   rå   r"   Ú
isinstancer   r   Ústrr#   )r   rè   ræ   rP   rR   rç   s     @@@@r   Útest_callsObserverÚ'CollectWarningsTests.test_callsObserver¡  s  û€ ð 6ˆØ$¡T r TÑ*ˆÜ˜q ! QÓ'ˆØ')ˆ÷	'ò 	'ô 	˜Ÿ™¨Ô*à×Ñ˜ ™ FÔ+Ü˜& ™)¤X×.Ñ.Ð.Ð.Ø×Ñ˜ ™×*Ñ*¨LÔ9Ü˜& ™)¤X×.Ñ.Ð.Ð.Ø×Ñ˜ ™×*Ñ*¨MÔ:Ü˜& ™)¤X×.Ñ.Ð.Ð.Ø×Ñ˜ ™×*Ñ*¬C°Ó,=Ô>Ø×Ñ˜ ™ KÔ0Ø×Ñœ˜V› aÕ(r   c                ó¾   • [        5       nU R                  [        SU5        [        S [        R
                  S5        U R                  UR                  5       S5        g)z|
Any warnings emitted by a call to a function passed to
L{_collectWarnings} are not actually emitted to the warning system.
rp   c                ó   • g ©Nr'   ©Úxs    r   Ú<lambda>Ú6CollectWarningsTests.test_suppresses.<locals>.<lambda>Ä  s   €  4r   Útextrq   N)r   rr   rs   r
   r   r   r"   ru   )r   rv   s     r   Útest_suppressesÚ$CollectWarningsTests.test_suppresses½  sB   € ô
 “ˆØ�
‰
”3˜ &Ô)Ü™¬¯©¸Ô?Ø×Ñ˜Ÿ™Ó*¨BÕ/r   c           	     ó¤   ^^• / m[        5       mS
UU4S jjn[        S USSSSS9nU R                  TSSSS.4/5        U R                  UT5        g	)zh
L{_collectWarnings} returns the result of calling the callable passed to
it with the parameters given.
c                 ó,   >• TR                  X45        T$ rñ   )rå   )ÚargsÚkwargsÚ	argumentsÚvalues     €€r   rè   Ú2CollectWarningsTests.test_callsFunction.<locals>.fÏ  s   ø€ Ø×Ñ˜d˜^Ô,ØˆLr   c                ó   • g rñ   r'   rò   s    r   rô   Ú9CollectWarningsTests.test_callsFunction.<locals>.<lambda>Ó  s   € ¨Dr   r!   rE   rX   Úd)rF   Úc)r!   rE   N)rû   Úobjectrü   r  r)   r  )r  r
   r"   re   )r   rè   rj   rý   rþ   s      @@r   Útest_callsFunctionÚ'CollectWarningsTests.test_callsFunctionÇ  s^   ù€ ð
 ˆ	Ü“ˆ÷	ð 	ô "¡.°!°Q¸¸qÀCÑHˆØ×Ñ˜ h°a¸cÑ0BÐ%CÐ$DÔEØ×Ñ˜V UÕ+r   c                ó@  • B SS jn[        R                  " S5        U" 5         / n[        UR                  U5        U R                  [        U5      S5        U R                  US   R                  S5        U R                  [        U R                  5       5      S5        g)zÌ
Subsequent emissions of a warning from a particular source site can be
collected by L{_collectWarnings}.  In particular, the per-module
emitted-warning cache should be bypassed (I{__warningregistry__}).
c                 ó0   • [         R                  " S5        g )NrÆ   rš   r'   r   r   rè   Ú>CollectWarningsTests.test_duplicateWarningCollected.<locals>.få  s   € Ü�MŠM˜%Õ r   Údefaultr!   r   rÆ   Nr(   )	Ú__warningregistry__r   r„   r
   rå   r"   r#   r   r$   )r   rè   ræ   s      r   Útest_duplicateWarningCollectedÚ3CollectWarningsTests.test_duplicateWarningCollected×  s€   € ð  ô	!ô 	×Ò˜iÔ(Ù	ŒØ!#ˆÜ˜Ÿ™¨Ô*Ø×Ñœ˜V› aÔ(Ø×Ñ˜ ™×*Ñ*¨EÔ2Ø×Ñœ˜T×/Ñ/Ó1Ó2°AÕ6r   c                ó²   • [        5       nU[        R                  U'   U R                  [        R                  R                  U5        U R                  5         g)z‘
L{_collectWarnings}'s behavior is not altered by the presence of an
object which cannot have attributes set on it as a value in
C{sys.modules}.
N)r  rs   rÄ   rÂ   rÅ   r  ©r   Úkeys     r   Útest_immutableObjectÚ)CollectWarningsTests.test_immutableObjectð  s;   € ô ‹hˆØŒ�‰�CÑØ�‰œŸ™Ÿ™¨Ô-Ø×+Ñ+Õ-r   c                ó  ^• 0 m " U4S jS5      n[        5       n[        5       nU" U5      TU'   [        5       n[        5       nU" U5      TU'   [        T5        U R                  X#XE1[        TR	                  5       5      5        g)a¡  
If the dictionary passed to L{_setWarningRegistryToNone} changes size
partway through the process, C{_setWarningRegistryToNone} continues to
set C{__warningregistry__} to L{None} on the rest of the values anyway.


This might be caused by C{sys.modules} containing something that's not
really a module and imports things on setattr.  py.test does this, as
does L{twisted.python.deprecate.deprecatedModuleAttribute}.
c                  ó0   >• \ rS rSrSS jrSU 4S jjrSrg)ÚKCollectWarningsTests.test_setWarningRegistryChangeWhileIterating.<locals>.Ai  c                ó    • XR                   S'   g )NÚ_key)Ú__dict__r  s     r   Ú__init__ÚTCollectWarningsTests.test_setWarningRegistryChangeWhileIterating.<locals>.A.__init__	  s   € Ø(+—‘˜fÒ%r   c                ó$   >• S TU R                   '   g rñ   )r  )r   rþ   Úitemr  s      €r   Ú__setattr__ÚWCollectWarningsTests.test_setWarningRegistryChangeWhileIterating.<locals>.A.__setattr__  s   ø€ Ø#��$—)‘)’r   r'   N)r  r  r)   r*   )rþ   r  r  r  r)   r*   )r+   r,   r-   r.   r  r  r2   )r  s   €r   ÚAr    s   ø† ô,÷$ò $r   r  N)r  r   r"   r;   Úkeys)r   r  Úkey1Úkey2Úkey3Úkey4r  s         @r   Ú+test_setWarningRegistryChangeWhileIteratingÚ@CollectWarningsTests.test_setWarningRegistryChangeWhileIteratingû  su   ø€ ð %'ˆ÷	$ô 	$ô ‹xˆÜ‹xˆÙ�D“'ˆˆ$‰ä‹xˆÜ‹xˆÙ�D“'ˆˆ$‰ä! !Ô$ð 	×Ñ˜$ dÐ1´3°q·v±v³x³=ÕAr   r'   Nr(   )r+   r,   r-   r.   r/   rí   r÷   r  r  r  r%  r2   r'   r   r   rà   rà   œ  s&   † ñô)ô80ô,ô 7ô2	.÷ Br   rà   )r/   Ú
__future__r   rs   r   Úior   Útypingr   r   r   Úunittestr   Útwisted.python.filepathr	   Útwisted.trial._synctestr
   r   r   Útwisted.trial.unittestr   r   r4   r5   r7   r‚   rÞ   rà   r'   r   r   Ú<module>r.     s~   ðñõ #ã 
Û Ý ß -Ñ -Ý å ,÷ñ õ
 7÷;ñ ;ñ8 ˆTƒ]€ÙˆTƒ]€ô]<Ð,ô ]<ô@	�'ô 	ôBÐ.õ Br   