/snap/core22/2437/usr/lib/python3.10/unittest/__pycache__
Edit: /snap/core22/2437/usr/lib/python3.10/unittest/__pycache__/runner.cpython-310.pyc (6952B)
o
p̦is ã @ sn d Z ddlZddlZddlZddlmZ ddlmZ dZG dd„ de ƒZ
G d d
„ d
ejƒZG dd„ de ƒZ
dS )
z
Running testsé Né )Úresult)ÚregisterResultTc @ s* e Zd ZdZdd„ Zdd„ Zd dd„ZdS )
Ú_WritelnDecoratorz@Used to decorate file-like objects with a handy 'writeln' methodc C s
|| _ d S ©N)Ústream)Úselfr © r ú&/usr/lib/python3.10/unittest/runner.pyÚ__init__ s
z_WritelnDecorator.__init__c C s |dv rt |ƒ‚t| j|ƒS )N)r Ú__getstate__)ÚAttributeErrorÚgetattrr )r Úattrr r r
Ú__getattr__ s z_WritelnDecorator.__getattr__Nc C s |r| |¡ | d¡ d S ©NÚ
)Úwrite)r Úargr r r
Úwriteln s
z_WritelnDecorator.writelnr )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r r r r r
r
s
r c s” e Zd ZdZdZdZ‡ fdd„Zdd„ Z‡ fdd „Z‡ fd
d„Z ‡ fdd
„Z
‡ fdd„Z‡ fdd„Z‡ fdd„Z
‡ fdd„Zdd„ Zdd„ Z‡ ZS )ÚTextTestResultzhA test result class that can print formatted text results to a stream.
Used by TextTestRunner.
zF======================================================================zF----------------------------------------------------------------------c s8 t t| ƒ |||¡ || _|dk| _|dk| _|| _d S )Nr )Úsuperr r r ÚshowAllÚdotsÚdescriptions)r r r Ú verbosity©Ú __class__r r
r % s
zTextTestResult.__init__c C s, | ¡ }| jr|rd t|ƒ|f¡S t|ƒS r )ÚshortDescriptionr ÚjoinÚstr)r ÚtestÚdoc_first_liner r r
ÚgetDescription, s
zTextTestResult.getDescriptionc sF t t| ƒ |¡ | jr!| j | |¡¡ | j d¡ | j ¡ d S d S )Nz ... )r r Ú startTestr r r r' Úflush©r r% r r r
r( 3 s ýzTextTestResult.startTestc óT t t| ƒ |¡ | jr| j d¡ | j ¡ d S | jr(| j d¡ | j ¡ d S d S )NÚokÚ.) r r Ú
addSuccessr r r r) r r r* r r r
r. : ó þzTextTestResult.addSuccessc óV t t| ƒ ||¡ | jr| j d¡ | j ¡ d S | jr)| j d¡ | j ¡ d S d S )NÚERRORÚE) r r ÚaddErrorr r r r) r r ©r r% Úerrr r r
r3 C ó þzTextTestResult.addErrorc r0 )NÚFAILÚF) r r Ú
addFailurer r r r) r r r4 r r r
r9 L r6 zTextTestResult.addFailurec s\ t t| ƒ ||¡ | jr| j d |¡¡ | j ¡ d S | jr,| j d¡ | j ¡ d S d S )Nz
skipped {0!r}Ús)
r r ÚaddSkipr r r Úformatr) r r )r r% Úreasonr r r
r; U s þzTextTestResult.addSkipc r0 )Nzexpected failureÚx) r r ÚaddExpectedFailurer r r r) r r r4 r r r
r? ^ r6 z!TextTestResult.addExpectedFailurec r+ )Nzunexpected successÚu) r r ÚaddUnexpectedSuccessr r r r) r r r* r r r
rA g r/ z#TextTestResult.addUnexpectedSuccessc C s@ | j s| jr| j ¡ | j ¡ | d| j¡ | d| j¡ d S )Nr1 r7 )r r r r r) ÚprintErrorListÚerrorsÚfailures©r r r r
ÚprintErrorsp s
zTextTestResult.printErrorsc C sb |D ],\}}| j | j¡ | j d|| |¡f ¡ | j | j¡ | j d| ¡ | j ¡ qd S )Nz%s: %sz%s)r r Ú
separator1r' Ú
separator2r) )r ÚflavourrC r% r5 r r r
rB w s ûzTextTestResult.printErrorList)r r r r rG rH r r' r( r. r3 r9 r; r? rA rF rB Ú
__classcell__r r r r
r s r c @ s8 e Zd ZdZeZ d
ddœdd„Zd d
„ Zdd„ ZdS )ÚTextTestRunnerzÉA test runner class that displays results in textual form.
It prints out the names of tests as they are run, errors as they
occur, and a summary of the results at the end of the test run.
NTr F)Ú tb_localsc C sR |du rt j}t|ƒ| _|| _|| _|| _|| _|| _|| _ |dur'|| _
dS dS )z‰Construct a TextTestRunner.
Subclasses should accept **kwargs to ensure compatibility as the
interface changes.
N)ÚsysÚstderrr r r r ÚfailfastÚbufferrL ÚwarningsÚresultclass) r r r r rO rP rR rQ rL r r r
r ˆ s
ÿzTextTestRunner.__init__c C s | | j| j| j¡S r )rR r r r rE r r r
Ú_makeResultœ s zTextTestRunner._makeResultc C s^ | ¡ }t|ƒ | j|_| j|_| j|_t ¡ V | jr/t | j¡ | jdv r/tjdt dd t
¡ }t|ddƒ}|dur@|ƒ z||ƒ W t|ddƒ}|durS|ƒ nt|ddƒ}|durb|ƒ w w t
¡ }W d ƒ n1 sqw Y || }|
¡ t|dƒrŠ| j |j¡ |j}| j d ||d
kr˜dp™d|f ¡ | j ¡ d
} }
}z
tt|j|j|jfƒ}W n ty¿ Y nw |\} }
}g }
| ¡ sï| j d¡ t|jƒt|jƒ}}|rå|
d| ¡ |rî|
d| ¡ n| j d¡ |rþ|
d| ¡ | r|
d| ¡ |
r|
d|
¡ |
r"| j dd |
¡f ¡ n| j d¡ | j ¡ |S )z&Run the given test case or test suite.)ÚdefaultÚalwaysÚmodulezPlease use assert\w+ instead.)ÚcategoryÚmessageÚstartTestRunNÚstopTestRunrH zRan %d test%s in %.3fsr r: Ú r ÚFAILEDzfailures=%dz errors=%dÚOKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (%s)z, r ) rS r rO rP rL rQ Úcatch_warningsÚsimplefilterÚfilterwarningsÚDeprecationWarningÚtimeÚperf_counterr rF Úhasattrr r rH ÚtestsRunÚmapÚlenÚexpectedFailuresÚunexpectedSuccessesÚskippedr
Ú
wasSuccessfulr rD rC Úappendr# r) )r r% r Ú startTimerY rZ ÚstopTimeÚ timeTakenÚrunÚ
expectedFailsri rj ÚresultsÚinfosÚfailedÚerroredr r r
rp Ÿ sŠ
þ
€þÿ
é
ÿ
þÿ
€
zTextTestRunner.run)NTr FFNN) r r r r r rR r rS rp r r r r
rK € s ÿþrK )r rM rb rQ r[ r Úsignalsr Ú
__unittestÚobjectr Ú
TestResultr rK r r r r
Ú
s c