Ë
    oj  ã                  óž   — d Z ddlmZ ddlZddlmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ  ed	«      Zd
Zdd„Z G d„ dej"                  «      Zy)z*
Tests for the output generated by trial.
é    )ÚannotationsN)ÚStringIO)ÚTypeVar)Útrial)Úrunner)ÚpackagesÚ_TzNo module named 'frotz'c                 ó"  — ddl m} t        j                  «       }|j	                  | «       t        «       }t        j                  |j                  ||d   ¬«      }t        j                  |«      }|j                  |«       |j                  «       S )Nr   )Úreporterztemp-directory)ÚstreamÚworkingDirectory)Útwisted.trialr   r   ÚOptionsÚparseOptionsr   r   ÚTrialRunnerÚVerboseTextReporterÚ	_getSuiteÚrunÚgetvalue)Úargsr   ÚconfigÚoutputÚmyRunnerÚsuites         ú@/usr/lib/python3/dist-packages/twisted/trial/test/test_output.pyÚrunTrialr      ss   € Ý&ä�]‰]‹_€FØ
×Ñ˜ÔÜ‹Z€FÜ×!Ñ!Ø×$Ñ$ØØÐ 0Ñ1ô€Hô
 �O‰O˜FÓ#€EØ‡L�L�ÔØ�?‰?ÓÐó    c                  óä   ‡ — e Zd ZdZdd„ZdZdd„Zdd„Z	 	 	 	 	 	 	 	 	 	 dˆ fd„Z	 	 	 	 	 	 	 	 	 	 dˆ fd„Z	dd„Z
dd	„Zdd
„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zˆ xZS )ÚImportErrorsTestszbActually run trial as if on the command line and check that the output
    is what we expect.
    c                 ó   — y ©N© ©Úselfs    r   ÚdebugzImportErrorsTests.debug+   s   € Ør   Ú_testImportErrorsc                ó8   — t        d| j                  «       g|¢­Ž S )Nz--temp-directory)r   Úmktemp)r$   r   s     r   r   zImportErrorsTests.runTrial0   s   € ÜÐ*¨D¯K©K«MÐA¸DÒAÐAr   c                ó   — t        |«       |S r!   )Úprint)r$   Ústuffs     r   Ú_printzImportErrorsTests._print3   s   € ÜˆeŒØˆr   c                ó0   •— t        ‰| �  ||g|¢­i |¤Ž |S r!   )ÚsuperÚassertIn©r$   Ú	containerÚ	containeer   ÚkwargsÚ	__class__s        €r   r/   zImportErrorsTests.assertIn7   s$   ø€ ô 	‰Ñ˜ IÐ?°Ò?¸Ò?ØÐr   c                ó0   •— t        ‰| �  ||g|¢­i |¤Ž |S r!   )r.   ÚassertNotInr0   s        €r   r6   zImportErrorsTests.assertNotIn>   s$   ø€ ô 	‰Ñ˜I yÐB°4ÒB¸6ÒBØÐr   c                ó$   — | j                  «        y r!   )r   r#   s    r   Útest_trialRunzImportErrorsTests.test_trialRunE   s   € Ø�‰�r   c                óp   — | j                  d«      }| j                  |d«       | j                  |d«       |S )Nztwisted.doesntexistú[ERROR]©r   r/   ©r$   Úds     r   Útest_nonexistentModulez(ImportErrorsTests.test_nonexistentModuleH   s3   € Ø�M‰MÐ/Ó0ˆØ�‰�a˜Ô#Ø�‰�aÐ.Ô/Øˆr   c                ó”   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       |S )NÚdoesntexistÚModuleNotFoundr:   r;   r<   s     r   Útest_nonexistentPackagez)ImportErrorsTests.test_nonexistentPackageN   s@   € Ø�M‰M˜-Ó(ˆØ�‰�a˜Ô'Ø�‰�aÐ)Ô*Ø�‰�a˜Ô#Øˆr   c                ó”   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       |S )Nzdoesntexist.barneyÚObjectNotFoundr:   r;   r<   s     r   Ú!test_nonexistentPackageWithModulez3ImportErrorsTests.test_nonexistentPackageWithModuleU   sB   € Ø�M‰MÐ.Ó/ˆØ�‰�aÐ-Ô.Ø�‰�aÐ)Ô*Ø�‰�a˜Ô#Øˆr   c                ó”   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       |S )NÚ
badpackager:   ÚIOError©r   r/   r6   r<   s     r   Útest_badpackagez!ImportErrorsTests.test_badpackage\   sA   € Ø�M‰M˜,Ó'ˆØ�‰�a˜Ô#Ø�‰�a˜Ô&Ø×Ñ˜˜IÔ&Øˆr   c                ó”   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       |S )Nzbadpackage.test_moduler:   rH   rI   r<   s     r   Útest_moduleInBadpackagez)ImportErrorsTests.test_moduleInBadpackagec   sC   € Ø�M‰MÐ2Ó3ˆØ�‰�a˜Ô#Ø�‰�aÐ1Ô2Ø×Ñ˜˜IÔ&Øˆr   c                ó¸   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       |S )Nzpackage.test_bad_moduler:   rH   ú<module rI   r<   s     r   Útest_badmodulez ImportErrorsTests.test_badmodulej   sS   € Ø�M‰MÐ3Ó4ˆØ�‰�a˜Ô#Ø�‰�aÐ2Ô3Ø×Ñ˜˜IÔ&Ø×Ñ˜˜JÔ'Øˆr   c                ó¸   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       |S )Nzpackage.test_import_moduler:   rH   rN   rI   r<   s     r   Útest_badimportz ImportErrorsTests.test_badimportr   sS   € Ø�M‰MÐ6Ó7ˆØ�‰�a˜Ô#Ø�‰�aÐ5Ô6Ø×Ñ˜˜IÔ&Ø×Ñ˜˜JÔ'Øˆr   c                óÜ   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       |S )NÚpackager:   Útest_bad_moduleÚtest_import_modulerN   rH   rI   r<   s     r   Útest_recurseImportz$ImportErrorsTests.test_recurseImportz   sa   € Ø�M‰M˜)Ó$ˆØ�‰�a˜Ô#Ø�‰�aÐ*Ô+Ø�‰�aÐ-Ô.Ø×Ñ˜˜JÔ'Ø×Ñ˜˜IÔ&Øˆr   c                ó  — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |t        «       | j                  |d«       | j                  |d«       |S )NÚpackage2r:   Útest_modulerN   rH   ©r   r/   Ú_noModuleErrorr6   r<   s     r   Útest_recurseImportErrorsz*ImportErrorsTests.test_recurseImportErrorsƒ   sm   € Ø�M‰M˜*Ó%ˆØ�‰�a˜Ô#Ø�‰�a˜Ô$Ø�‰�a˜Ô'Ø�‰�aœÔ(Ø×Ñ˜˜JÔ'Ø×Ñ˜˜IÔ&Øˆr   c                óž   — | j                  dd«      }| j                  |d«       | j                  |t        «       | j                  |d«       |S )Nz-NrX   r:   rN   rZ   r<   s     r   Útest_nonRecurseImportErrorsz-ImportErrorsTests.test_nonRecurseImportErrors�   sC   € Ø�M‰M˜$ 
Ó+ˆØ�‰�a˜Ô#Ø�‰�aœÔ(Ø×Ñ˜˜JÔ'Øˆr   c                ó¸   — | j                  d«      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       |S )Nzpackage.test_moduler:   rH   ÚOKúPASSED (successes=1))r   r6   r/   r<   s     r   Útest_regularRunz!ImportErrorsTests.test_regularRun”   sS   € Ø�M‰MÐ/Ó0ˆØ×Ñ˜˜IÔ&Ø×Ñ˜˜IÔ&Ø�‰�a˜ÔØ�‰�aÐ/Ô0Øˆr   c                ó@  — | j                  | j                  «       | j                  t        j                  j                  | j                  dd«      «      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       |S )NrS   ztest_module.pyr:   rH   r`   ra   ©	ÚmangleSysPathÚoldPathr   ÚosÚpathÚjoinÚparentr6   r/   r<   s     r   Útest_filenamezImportErrorsTests.test_filenameœ   sz   € Ø×Ñ˜4Ÿ<™<Ô(Ø�M‰Mœ"Ÿ'™'Ÿ,™, t§{¡{°IÐ?OÓPÓQˆØ×Ñ˜˜IÔ&Ø×Ñ˜˜IÔ&Ø�‰�a˜ÔØ�‰�aÐ/Ô0Øˆr   c                ó@  — | j                  | j                  «       | j                  t        j                  j                  | j                  dd«      «      }| j                  |d«       | j                  |d«       | j                  |d«       | j                  |d«       |S )NrS   ztest_dos_module.pyr:   rH   r`   ra   rd   r<   s     r   Útest_dosFilezImportErrorsTests.test_dosFile¥   sz   € à×Ñ˜4Ÿ<™<Ô(Ø�M‰Mœ"Ÿ'™'Ÿ,™, t§{¡{°IÐ?SÓTÓUˆØ×Ñ˜˜IÔ&Ø×Ñ˜˜IÔ&Ø�‰�a˜ÔØ�‰�aÐ/Ô0Øˆr   )ÚreturnÚNone©r   Ústrrn   rq   )r+   r	   rn   r	   )
r1   rq   r2   rq   r   Úobjectr3   rr   rn   rq   )rn   rq   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r%   rj   r   r,   r/   r6   r8   r>   rB   rE   rJ   rL   rO   rQ   rV   r\   r^   rb   rk   rm   Ú__classcell__)r4   s   @r   r   r   &   s¿   ø„ ñóð !€FóBóðØðØ),ðØ5;ðØGMðà	õðØðØ),ðØ5;ðØGMðà	õóóóóóóóóóóóóó÷r   r   rp   )rv   Ú
__future__r   rg   Úior   Útypingr   Útwisted.scriptsr   r   r   Útwisted.trial.testr   r	   r[   r   ÚSysPathManglingTestr   r"   r   r   ú<module>r~      sH   ðñõ #ã 	Ý Ý å !Ý  Ý 'áˆTƒ]€à*€óô G˜×4Ñ4õ Gr   