3 \G ã @ 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/lib64/python3.6/unittest/runner.pyÚ__init__ s z_WritelnDecorator.__init__c C s |dkrt |ƒ‚t| j|ƒS )Nr Ú__getstate__)r r )ÚAttributeErrorÚgetattrr )r Úattrr r r Ú__getattr__ s z_WritelnDecorator.__getattr__Nc C s |r| j |ƒ | j dƒ d S )NÚ )Úwrite)r Úargr r r Úwriteln s z_WritelnDecorator.writeln)N)Ú__name__Ú __module__Ú__qualname__Ú__doc__r r r r r r r r s r c sœ e Zd ZdZdd Zdd Z‡ fdd„Zdd„ Z‡ fd d „Z‡ fdd„Z ‡ fd d„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. ú=éF ú-c s8 t t| ƒj|||ƒ || _|dk| _|dk| _|| _d S )Nr )Úsuperr r r ÚshowAllÚdotsÚdescriptions)r r r Ú verbosity)Ú __class__r r r % s zTextTestResult.__init__c C s0 |j ƒ }| jr$|r$djt|ƒ|fƒS t|ƒS d S )Nr )ZshortDescriptionr ÚjoinÚstr)r ÚtestZdoc_first_liner r r ÚgetDescription, s zTextTestResult.getDescriptionc sB t t| ƒj|ƒ | jr>| jj| j|ƒƒ | jjdƒ | jjƒ d S )Nz ... )r r Ú startTestr r r r% Úflush)r r$ )r! r r r&