
u~Mc           @   sv  d  Z  d d l Z d d l Z d d l Z d d l 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 m Z m Z m Z m Z d d l m Z d d	 l m Z d d
 l m Z m Z m Z d d l m Z d e f d     YZ d e j f d     YZ  d e j f d     YZ! d e! f d     YZ" d e  f d     YZ# d e# f d     YZ$ d e j f d     YZ% d e  f d     YZ& d e j f d     YZ' d e j f d     YZ( d  e j f d!     YZ) d" e j f d#     YZ* d$ e* f d%     YZ+ d& e j f d'     YZ, d( e, f d)     YZ- d* dB d+     YZ. d, e j f d-     YZ/ d. e j f d/     YZ0 d0 e0 f d1     YZ1 d2 e j f d3     YZ2 d4 e0 f d5     YZ3 d6 e j f d7     YZ4 d8 e1 f d9     YZ5 d: e j6 f d;     YZ7 d< e j f d=     YZ8 d> e f d?     YZ9 d@ e j f dA     YZ: d S(C   s&   
Tests for L{twisted.trial.reporter}.
iN(   t   getmro(   t   suppressWarnings(   t   log(   t   Failure(   t   itrialt   unittestt   runnert   reportert   util(   t   UncleanWarningsReporterWrapper(   t	   erroneous(   t   makeTodot   SkipTestt   Todo(   t   samplet   BrokenStreamc           B   s5   e  Z d  Z e Z e Z d   Z d   Z d   Z RS(   s   
    Stream-ish object that raises a signal interrupt error. We use this to make
    sure that Trial still manages to write what it needs to write.
    c         C   s   | |  _  d  S(   N(   t   fObj(   t   selfR   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   __init__    s    c         C   s8   |  j  r |  j j |  St |  _  t t j d   d  S(   Ns   Interrupted write(   t   writtenR   t   writet   Truet   IOErrort   errnot   EINTR(   R   t   s(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   #   s    		c         C   s5   |  j  r |  j j   St |  _  t t j d   d  S(   Ns   Interrupted flush(   t   flushedR   t   flushR   R   R   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   )   s    		(	   t   __name__t
   __module__t   __doc__t   FalseR   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR      s   		t
   StringTestc           B   s   e  Z d    Z RS(   c         C   s  t  d  |  } |  j t |  t |  k d t |  t |  f  t t j d   } x t t | |   D] \ } \ } } | d  k r qr qr t	 | t
  r |  j | | d | | | f  qr t	 | |  r|  j | j |  d | | j | f  qr t d | f   qr Wd  S(   Ns2   Must have more observed than expectedlines %d < %dt    s   Line %d: %r not in %rs#   Line %d: %r did not match string %rs$   don't know what to do with object %r(   t   filtert   Nonet
   failUnlesst   lent   typet   ret   compilet	   enumeratet   zipt
   isinstancet   strt   assertSubstringt   matcht   patternt	   TypeError(   R   t   expectt   outputt   REGEX_PATTERN_TYPEt   line_numbert   expt   out(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   stringComparison1   s"    ((   R   R   R7   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR    0   s   t   TestTestResultc           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s   t  j   |  _ d  S(   N(   R   t
   TestResultt   result(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   setUpG   s    c         C   s}   y t  d   Wn, t  k
 r> } |  j j |  t j    n X|  j j d d } |  j | | j  |  j t  | j  d  S(   Nt   fooi    i   (	   t   RuntimeErrorR:   t   addErrort   syst   exc_infot   errorst   assertEqualt   valueR&   (   R   t   excValuet   failure(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_pyunitAddErrorJ   s    c         C   s   y |  j  d   Wn/ |  j  k
 rD } |  j j |  t j    n X|  j j d d } |  j | | j  |  j |  j  | j  d  S(   NR<   i    i   (	   t   failureExceptionR:   t
   addFailureR?   R@   t   failuresRB   RC   R&   (   R   RD   RE   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_pyunitAddFailureT   s    (   R   R   R;   RF   RJ   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR8   F   s   		
t   TestReporterRealtimec           B   s   e  Z d    Z RS(   c         C   s(   t  j    } t j | d t |  _ d  S(   Nt   realtime(   t   StringIOR   t   ReporterR   R:   (   R   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;   `   s    (   R   R   R;   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRK   _   s   t   TestErrorReportingc           B   sV   e  Z e j d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z RS(   s   ^=+$c         C   s7   t  j   |  _ t j   |  _ t j |  j  |  _ d  S(   N(   R   t
   TestLoadert   loaderRM   R2   R   RN   R:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;   h   s    c         C   s&   |  j  |  } | j   |  j j   S(   N(   t	   getResultt   doneR2   t   getvalue(   R   t   suiteR:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   getOutputm   s    
c         C   s   | j  |  j  |  j S(   N(   t   runR:   (   R   RU   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRR   r   s    c         C   sn   |  j  j t j  } |  j |  j   } |  j d d t j d  t j d  d d g } |  j	 | |  d S(   s   
        A test method which runs and has an error recorded against it is
        reported in the output stream with the I{ERROR} tag along with a summary
        of what error was reported and the ID of the test.
        s   [ERROR]s"   Traceback (most recent call last):s.   ^\s+File .*erroneous\.py., line \d+, in setUp$s5   ^\s+raise FoolishError, .I am a broken setUp method.$sE   twisted.trial.test.erroneous.FoolishError: I am a broken setUp methods9   twisted.trial.test.erroneous.TestFailureInSetUp.test_noopN(
   RQ   t	   loadClassR
   t   TestFailureInSetUpRV   t
   splitlinest   doubleSeparatorR'   R(   R7   (   R   RU   R2   R.   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_formatErroredMethodv   s    	c         C   sq   |  j  j t j j  } |  j |  j   } |  j d d t j	 d  t j	 d  d d g } |  j
 | |  d S(   s   
        A test method which runs and has a failure recorded against it is
        reported in the output stream with the I{FAIL} tag along with a summary
        of what failure was reported and the ID of the test.
        s   [FAIL]s"   Traceback (most recent call last):s2   ^\s+File .*erroneous\.py., line \d+, in test_fail$s   ^\s+self\.fail\("I fail"\)$s'   twisted.trial.unittest.FailTest: I fails6   twisted.trial.test.erroneous.TestRegularFail.test_failN(   RQ   t
   loadMethodR
   t   TestRegularFailt	   test_failRV   RZ   R[   R'   R(   R7   (   R   RU   R2   R.   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_formatFailedMethod   s    	c         C   s   d d l  m } t j |  j j |  t j  } |  j |  } d } x* d d d | g D] } |  j	 | |  qY W|  j
 t j d |  d  |  j t j d	  g } |  j | | j    d
 S(   s   
        A problem encountered while running a doctest is reported in the output
        stream with a I{FAIL} or I{ERROR} tag along with a summary of what
        problem was encountered and the ID of the test.
        i(   R
   s0   twisted.trial.test.erroneous.unexpectedExceptions   1/0t   ZeroDivisionErrors   Exception raised:s   Fail(ed|ure in) example:s;   Couldn't match 'Failure in example: ' or 'Failed example: 's   \[(ERROR|FAIL)\]N(   t   twisted.trial.testR
   R   t   decorateRQ   t   loadDoctestsR   t	   ITestCaseRV   R-   R$   R'   t   searchR[   R(   R7   RZ   (   R   R
   RU   R2   t   patht	   substringR1   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_doctestError   s    	c         C   s   t  j d  } |  j |  j   } |  j d d t j d  t j d  d d |  j d d t j d	  t j d
  t j d  t j d  d d g } |  j | |  d S(   s-  
        Check that errors in C{DelayedCall}s get reported, even if the
        test already has a failure.

        Only really necessary for testing the deprecated style of tests that
        use iterate() directly. See
        L{erroneous.DelayedCall.testHiddenException} for more details.
        t   testHiddenExceptions   [FAIL]s"   Traceback (most recent call last):s<   ^\s+File .*erroneous\.py., line \d+, in testHiddenException$sD   ^\s+self\.fail\("Deliberate failure to mask the hidden exception"\)$sP   twisted.trial.unittest.FailTest: Deliberate failure to mask the hidden exceptions<   twisted.trial.test.erroneous.DelayedCall.testHiddenExceptions   [ERROR]s   ^\s+File .* in runUntilCurrents   ^\s+.*s*   ^\s+File .*erroneous\.py", line \d+, in gos1   ^\s+raise RuntimeError\(self.hiddenExceptionMsg\)s*   exceptions.RuntimeError: something blew upN(   R
   t   DelayedCallRV   RZ   R[   R'   R(   R7   (   R   t   testR2   R.   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_hiddenException   s&    		(   R   R   R'   R(   R[   R;   RV   RR   R\   R`   Ri   Rm   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRO   e   s   						t'   TestUncleanWarningWrapperErrorReportingc           B   s   e  Z d  Z d   Z RS(   s   
    Tests that the L{UncleanWarningsReporterWrapper} can sufficiently proxy
    IReporter failure and error reporting methods to a L{reporter.Reporter}.
    c         C   s=   t  j   |  _ t j   |  _ t t j |  j   |  _ d  S(   N(	   R   RP   RQ   RM   R2   R	   R   RN   R:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;      s    (   R   R   R   R;   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRn      s   t   TracebackHandlingc           B   sG   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s   t  j    } t j |  } | j |  | j | j } t |  d k sP t  | d d | k sj t  | j | d d j	  S(   Ni   i    (
   RM   R   RN   RW   RI   RA   R%   t   AssertionErrort   _trimFramest   frames(   R   Rl   t   streamR:   t   bads(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   getErrorFrames   s    c         C   s   x t  | |  D]x \ } } |  j | d | d  t j j | d  d j t j  } | d j d  } |  j | t |  |  q W|  j t |  t |   d  S(   Ni    i   t   /(   R*   RB   t   osRg   t   splitextt   splitt   sepR%   (   R   t   observedFramest   expectedFramest   observedt   expectedt   observedSegst   expectedSegs(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   checkFrames   s    &c         C   s5   t  j d  } |  j |  } |  j | d g  d  S(   NR_   s   twisted/trial/test/erroneous(   s	   test_fails   twisted/trial/test/erroneous(   R
   R^   Ru   R   (   R   Rl   Rr   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt
   test_basic   s    	c         C   s8   t  j d  } |  j |  } |  j | d d g  d  S(   Nt   test_subfails   twisted/trial/test/erroneoust
   subroutine(   R   s   twisted/trial/test/erroneous(   R   s   twisted/trial/test/erroneous(   R
   R^   Ru   R   (   R   Rl   Rr   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_subroutine   s
    	c         C   s5   t  j d  } |  j |  } |  j | d g  d  S(   NR_   t   _laters   twisted/trial/test/erroneous(   R   s   twisted/trial/test/erroneous(   R
   t   TestFailureInDeferredChainRu   R   (   R   Rl   Rr   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_deferred  s    	c         C   s,   t  j d   } |  j g  | j g    d  S(   N(   R   RN   R#   RB   Rq   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_noFrames  s    c         C   s2   t  j d   } |  j d g | j d g   d  S(   Ns
   fake frame(   R   RN   R#   RB   Rq   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_oneFrame  s    (	   R   R   Ru   R   R   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRo      s   								t   FormatFailuresc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   s   y t  d   Wn t  k
 r/ t   |  _ n Xd d d d g d g g d d d d g d g g g |  j _ t j   |  _ t j |  j  |  _ d  S(   NR<   s
   foo/bar.pyi   t   xt   yt   oranget   quxi
   t   at   twot   bt   MCMXCIX(   R   i   (   R   R   (   R   R   (   R   R   (	   R=   R   t   fRr   RM   Rs   R   RN   R:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    $c         C   sS   |  j  j |  j  } |  j d d t j d  d t j d  d g | j    d  S(   Ns"   Traceback (most recent call last):s#     File "foo/bar.py", line 5, in foos   ^\s*$s$     File "foo/bar.py", line 10, in quxs   RuntimeError: foo(   R:   t   _formatFailureTracebackR   R7   R'   R(   RZ   (   R   t   tb(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_formatDefault"  s    c         C   s2   d } d } |  j  j |  } |  j | |  d  S(   Ns   
  File "twisted/trial/unittest.py", line 256, in failUnlessSubstring
    return self.failUnlessIn(substring, astring, msg)
exceptions.TypeError: iterable argument required

s   
  File "twisted/trial/unittest.py", line 256, in failUnlessSubstring
    return self.failUnlessIn(substring, astring, msg)
exceptions.TypeError: iterable argument required
(   R:   R   RB   (   R   R   R~   t	   formatted(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_formatString,  s    c         C   s:   |  j  j } |  j j |  j   |  j |  j  j |  d  S(   N(   R   Rr   R:   R   RB   (   R   Rr   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_mutation;  s    (   R   R   R;   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s   		
	t   PyunitTestNamesc           B   sG   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C   s%   t  j    |  _ t j d  |  _ d  S(   Nt   test_foo(   RM   Rs   R   t
   PyunitTestRl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;   C  s    c         C   sE   t  j |  j  } | j |  j  |  j j   } |  j | d  d  S(   Ns2   twisted.trial.test.sample.PyunitTest.test_foo ... (   R   t   VerboseTextReporterRs   t	   startTestRl   RT   t   failUnlessEqual(   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_verboseReporterG  s
    c         C   sk   t  j |  j  } | j |  j  |  j j   } | j   d j   } |  j | | j	 |  j  d  d  S(   Nis    ...(
   R   t   TreeReporterRs   R   Rl   RT   RZ   t   stripR   t   getDescription(   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_treeReporterN  s
    c         C   s8   t  j |  j  } | j |  j  } |  j | d  d  S(   NR   (   R   R   Rs   R   Rl   R   (   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_getDescriptionU  s    c         C   sq   t  j |  j  } |  j j |  | j   |  j j   j   j d  } |  j	 | d d d d d d g  d S(   s  
        The summary of L{reporter.MinimalReporter} is a simple list of numbers,
        indicating how many tests ran, how many failed etc.

        The numbers represents:
         * the run time of the tests
         * the number of tests run, printed 2 times for legacy reasons
         * the number of errors
         * the number of failures
         * the number of skips
        t    i   t   1t   0N(
   R   t   MinimalReporterRs   Rl   RW   t   _printSummaryRT   R   Ry   R   (   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_minimalReporter[  s
    
c            s   d d d d g   t  j |  j  }   f d   | _ |  j j |  | j   |  j j   j   j	 d  } | d } |  j
 | d  d	 S(
   st   
        L{reporter.MinimalReporter} reports the time to run the tests as first
        data in its output.
        g      ?g333333?g      ?gffffff?c              s     j  d  S(   Ni    (   t   pop(    (   t   times(    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   <lambda>u  s    R   i    s   0.7N(   R   R   Rs   t   _getTimeRl   RW   R   RT   R   Ry   t   assertEquals(   R   R:   R2   t   timer(    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_minimalReporterTimen  s    

c         C   s`   t  j |  j  } | j   |  j j   j   j d  } |  j | d d d d d d g  d S(   sv   
        The summary of L{reporter.MinimalReporter} is a list of zeroes when no
        test is actually run.
        R   R   N(   R   R   Rs   R   RT   R   Ry   R   (   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_emptyMinimalReporter}  s    
(	   R   R   R;   R   R   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   B  s   						t   TestDirtyReactorc           B   s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s   
    The trial script has an option to treat L{DirtyReactorAggregateError}s as
    warnings, as a migration tool for test authors. It causes a wrapper to be
    placed around reporters that replaces L{DirtyReactorAggregatErrors} with
    warnings.
    c         C   sC   t  t j d g d g   |  _ t j   |  _ t d  |  _ d  S(   NR<   t   bart   test_errorByDefault(   R   R   t   DirtyReactorAggregateErrort
   dirtyErrorRM   R2   R   Rl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   sf   t  j d |  j  } | j |  j |  j  |  j t | j  d  |  j | j d d |  j  d S(   sj   
        L{DirtyReactorAggregateError}s are reported as errors with the default
        Reporter.
        Rs   i   i    N(	   R   RN   R2   R>   Rl   R   RB   R%   RA   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   sP   t  t j d |  j   } |  j t |  j j   t j | j	 |  j
 |  j  d S(   s   
        L{DirtyReactorAggregateError}s are reported as warnings when using
        the L{UncleanWarningsReporterWrapper}.
        Rs   N(   R	   R   RN   R2   t   assertWarnst   UserWarningR   t   getErrorMessaget   __file__R>   Rl   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_warningsEnabled  s
    c         C   sf   t  t j d |  j   } |  j t |  j j   t j | j	 |  j
 |  j  |  j | j j g   d S(   s   
        L{DirtyReactorAggregateError}s are I{not} reported as errors if the
        L{UncleanWarningsReporterWrapper} is used.
        Rs   N(   R	   R   RN   R2   R   R   R   R   R   R>   Rl   R   t   _originalReporterRA   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_warningsMaskErrors  s    c         C   s   t  t j d |  j   } | j |  j |  j j |  j j d f  |  j
 t | j j  d  |  j | j j d d j |  j j  |  j | j j d d j |  j j  d S(   s  
        Some annoying stuff can pass three-tuples to addError instead of
        Failures (like PyUnit). The wrapper, of course, handles this case,
        since it is a part of L{twisted.trial.itrial.IReporter}! But it does
        not convert L{DirtyReactorAggregateError} to warnings in this case,
        because nobody should be passing those in the form of three-tuples.
        Rs   i   i    N(   R	   R   RN   R2   R>   Rl   R   R&   RC   R#   RB   R%   R   RA   R   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_dealsWithThreeTuples  s    (   R   R   R   R;   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s   				t   TrialTestNamesc           B   s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C   s%   t  j    |  _ t j d  |  _ d  S(   NR   (   RM   Rs   R   t   FooTestRl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   sR   t  j |  j  } | j |  j  |  j j   } |  j | |  j j   d  d  S(   Ns    ... (   R   R   Rs   R   Rl   RT   R   t   id(   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   sk   t  j |  j  } | j |  j  |  j j   } | j   d j   } |  j | | j	 |  j  d  d  S(   Nis    ...(
   R   R   Rs   R   Rl   RT   RZ   R   R   R   (   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s
    c         C   s/   t  j |  j  } |  j | j |   d  d S(   s   A docstringt   test_treeReporterWithDocstringsN(   R   R   Rs   RB   R   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s8   t  j |  j  } | j |  j  } |  j | d  d  S(   NR   (   R   R   Rs   R   Rl   R   (   R   R:   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    (   R   R   R;   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s
   				t   TestSkipc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   s=   
    Tests for L{reporter.Reporter}'s handling of skips.
    c         C   s:   t  j    |  _ t j |  j  |  _ t j d  |  _ d  S(   NR   (   RM   Rs   R   RN   R:   R   R   Rl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   s   t  | j  S(   sF   
        Get the number of skips that happened to a reporter.
        (   R%   t   skips(   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   _getSkips  s    c         C   s6   |  j  j |  j d  |  j |  j |  j   d  d  S(   Ns   some reasoni   (   R:   t   addSkipRl   RB   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_accumulation  s    c         C   s3   |  j  j |  j d  |  j t |  j  j    d  S(   Ns   some reason(   R:   R   Rl   R   R   t   wasSuccessful(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_success  s    c         C   s|   |  j  j |  j d  |  j  j   |  j j   j   d } d } |  j | j |   |  j	 | t
 |  j   d  d S(   s   
        The summary of a successful run with skips indicates that the test
        suite passed and includes the number of skips.
        s   some reasonis   PASSED s	   (skips=1)N(   R:   R   Rl   RS   Rs   RT   RZ   R$   t
   startswithR   R%   R   (   R   R2   t   prefix(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_summary  s    c         C   sV   |  j  j |  j d  |  j  j   |  j j   j   d } |  j | j   d  d S(   sw   
        The output at the end of a test run with skips includes the reasons
        for skipping those tests.
        s   some reasoni   N(	   R:   R   Rl   RS   Rs   RT   RZ   R   R   (   R   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_basicErrors  s    c         C   sP   |  j  j |  j t  |  j  j   |  j j   j   d } |  j | d  d S(   s   
        Tests can be skipped without specifying a reason by setting the 'skip'
        attribute to True. When this happens, the test output includes 'True'
        as the reason.
        i   R   N(	   R:   R   Rl   R   RS   Rs   RT   RZ   R   (   R   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_booleanSkip  s    c         C   s   y d d Wn t  k
 r' } | } n X|  j j |  j |  |  j j   d j |  j j   j   d d ! j	   } |  j
 | t |   d S(   s   
        Skips can be raised as errors. When this happens, the error is
        included in the summary at the end of the test suite.
        i   i    s   
i   i   N(   t	   ExceptionR:   R   Rl   RS   t   joinRs   RT   RZ   R   R   R,   (   R   t   et   errorR2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_exceptionSkip+  s    
+(   R   R   R   R;   R   R   R   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s   							t   UncleanWarningSkipTestc           B   s    e  Z d  Z d   Z d   Z RS(   sh   
    Tests for skips on a L{reporter.Reporter} wrapped by an
    L{UncleanWarningsReporterWrapper}.
    c         C   s#   t  j |   t |  j  |  _ d  S(   N(   R   R;   R	   R:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;   ?  s    c         C   s   t  | j j  S(   s}   
        Get the number of skips that happened to a reporter inside of an
        unclean warnings reporter wrapper.
        (   R%   R   R   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   C  s    (   R   R   R   R;   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   :  s   	t   TodoTestc           B   sh   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z RS(   s=   
    Tests for L{reporter.Reporter}'s handling of todos.
    c         C   s:   t  j    |  _ t j |  j  |  _ t j d  |  _ d  S(   NR   (   RM   Rs   R   RN   R:   R   R   Rl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;   Q  s    c         C   s   t  | j  S(   sF   
        Get the number of todos that happened to a reporter.
        (   R%   t   expectedFailures(   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   _getTodosW  s    c         C   s   t  | j  S(   sU   
        Get the number of unexpected successes that happened to a reporter.
        (   R%   t   unexpectedSuccesses(   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   _getUnexpectedSuccesses^  s    c         C   sH   |  j  j |  j t t    t d   |  j |  j |  j   d  d S(   sh   
        L{reporter.Reporter} accumulates the expected failures that it
        is notified of.
        s   todo!i   N(   R:   t   addExpectedFailureRl   R   R   R   RB   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   e  s    c         C   sE   |  j  j |  j t t    t d   |  j t |  j  j    d S(   sU   
        A test run is still successful even if there are expected failures.
        s   todo!N(	   R:   R   Rl   R   R   R   RB   R   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   o  s    c         C   sU   |  j  j |  j t d   |  j t |  j  j    |  j |  j |  j   d  d S(   s   
        A test which is marked as todo but succeeds will have an unexpected
        success reported to its result. A test run is still successful even
        when this happens.
        s   Heya!i   N(   R:   t   addUnexpectedSuccessRl   R   RB   R   R   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_unexpectedSuccessx  s    c         C   s   |  j  j |  j t t    t d   |  j  j   |  j j   j	   d } d } |  j
 | j |   |  j | t |  j   d  d S(   sz   
        The reporter's C{printSummary} method should print the number of
        expected failures that occured.
        s   some reasonis   PASSED s   (expectedFailures=1)N(   R:   R   Rl   R   R   R   RS   Rs   RT   RZ   R$   R   RB   R%   R   (   R   R2   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   sh   |  j  j |  j t t    t d   |  j  j   |  j j   j	   d j
   } |  j | d  d S(   sd   
        The reporter's L{printErrors} method should include the value of the
        Todo.
        s   some reasoni   s   Reason: 'some reason'N(   R:   R   Rl   R   R   R   RS   Rs   RT   RZ   R   RB   (   R   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s
    c         C   sB   |  j  j |  j t t    t t   |  j t |  j  j  d S(   s   
        Booleans CAN'T be used as the value of a todo. Maybe this sucks. This
        is a test for current behavior, not a requirement.
        N(	   R:   R   Rl   R   R   R   R   t   assertRaisesRS   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_booleanTodo  s    c         C   s   y d d Wn t  k
 r' } | } n X|  j j |  j t |  t d   |  j j   d j |  j j	   j
   d  j   } |  j t |  | k  d S(   sk   
        The exception for expected failures should be shown in the
        C{printErrors} output.
        i   i    s   todo!s   
i   N(   R   R:   R   Rl   R   R   RS   R   Rs   RT   RZ   R   t
   assertTrueR,   (   R   R   R   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_exceptionTodo  s    
((   R   R   R   R;   R   R   R   R   R   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   L  s   				
						
t   UncleanWarningTodoTestc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sJ   
    Tests for L{UncleanWarningsReporterWrapper}'s handling of todos.
    c         C   s#   t  j |   t |  j  |  _ d  S(   N(   R   R;   R	   R:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   s   t  | j j  S(   s}   
        Get the number of todos that happened to a reporter inside of an
        unclean warnings reporter wrapper.
        (   R%   R   R   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   t  | j j  S(   s   
        Get the number of unexpected successes that happened to a reporter
        inside of an unclean warnings reporter wrapper.
        (   R%   R   R   (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    (   R   R   R   R;   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s   		t   MockColorizerc           B   s    e  Z d  Z d   Z d   Z RS(   sQ   
    Used by TestTreeReporter to make sure that output is colored correctly.
    c         C   s   g  |  _  d  S(   N(   R   (   R   Rs   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   |  j  j | | f  d  S(   N(   R   t   append(   R   t   textt   color(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    (   R   R   R   R   R   (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s   	t   TestTreeReporterc           B   s   e  Z d    Z d   Z d   Z e e e j d e j	  e j d e
   Z d   Z e e e j d e
 d d   Z d   Z d   Z d	   Z d
   Z d   Z RS(   c         C   sa   t  j d  |  _ t j   |  _ t j |  j  |  _ t |  j  |  j _	 |  j j	 j
 |  _
 d  S(   NR   (   R   R   Rl   RM   Rs   R   R   R:   R   t
   _colorizerR   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s
    c         C   s-   y d d Wn t  k
 r( t   } n X| S(   Ni   i    (   Ra   R   (   R   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   makeError  s
    c         C   s   |  j    } |  j j |  |  j d \ } } |  j | j   |  j j  |  j | j   d  |  j d \ } } |  j | j   |  j j  |  j | j   d  d S(   sh   
        Run cleanupErrors and check that the output is correct, and colored
        correctly.
        i    s   cleanup errorsi   s   [ERROR]N(   R   R:   t   cleanupErrorsR   RB   R   t   ERROR(   R   R   R   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_cleanupError  s    t   categoryc         C   sb   |  j  j d d d t  |  j d \ } } |  j | j   |  j  j  |  j | j   d  d S(   se   
        Run upDownError and check that the output is correct and colored
        correctly.
        t   methodi    N(   R:   t   upDownErrorR#   R   R   RB   R   R   (   R   R   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_upDownError  s    t   messages)   upDownError is deprecated in Twisted 8.0.c         C   sp   |  j  j |  j  |  j  j   |  j |  j d |  j  j d f  |  j |  j j   j	   d j
   d  d S(   sw   
        The summary in case of success should have a good count of successes
        and be colored properly.
        i   t   PASSEDis   (successes=1)N(   R:   t
   addSuccessRl   RS   R   R   t   SUCCESSRs   RT   RZ   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_summaryColoredSuccess  s
    #c         C   s   y t  d   Wn* t  k
 r< |  j j |  t j    n X|  j j   |  j |  j d |  j j d f  |  j |  j	 j
   j   d j   d  d S(   st   
        The summary in case of failure should have a good count of errors
        and be colored properly.
        R<   i   t   FAILEDis
   (errors=1)N(   R=   R:   R>   R?   R@   RS   R   R   t   FAILURERs   RT   RZ   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_summaryColoredFailure  s    #c         C   s   |  j  d d g |  j j d   |  j  d d g |  j j d   |  j  d g |  j j d   |  j  g  |  j j d   d S(   s   
        The tree needs to get the segments of the test ID that correspond
        to the module and class that it belongs to.
        s   foo.bart   bazs   foo.bar.baz.quxR<   R   s   foo.bar.bazN(   RB   R:   t   _getPreludeSegments(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_getPrelude.  s    		c         C   s  y t  d   WnF t  k
 rX |  j j |  t j    |  j j |  j t j    n Xy t  d   Wn9 t  k
 r t j d  } |  j j | t j    n X|  j j   |  j j	 |  j j
 |  j j  } |  j | d d |  |  j g  |  j | d d | g  d S(   s   
        If two different tests have the same error, L{Reporter._groupResults}
        includes them together in one of the tuples in the list it returns.
        R<   R   t   test_bari    i   N(   R=   R:   R>   R?   R@   Rl   R   R   RS   t   _groupResultsRA   R   R   (   R   t   extrat   grouped(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_groupResults?  s     	!c         C   s   d   } t  j d  } t  j d  } t  j d  } |  j j d | d f | d f | d f g |  |  j |  j j   d i |  j j d 6| j	   d	 6| j	   d
 6| j	   d 6 d S(   s   
        L{Reporter._printResults} uses the results list and formatter callable
        passed to it to produce groups of results to write to its output stream.
        c         S   s   t  |   d S(   Ns   
(   R,   (   t   n(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   formatterZ  s    R   R   t   FOOi   i   sW   %(double separator)s
FOO
1

%(first)s
%(second)s
%(double separator)s
FOO
2

%(third)s
s   double separatort   firstt   secondt   thirdN(
   R   R   R   R:   t   _printResultsR   Rs   RT   t   _doubleSeparatorR   (   R   R  R  R  R  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_printResultsU  s    		(
(   R   R   R;   R   R   R   R   t   suppressR   t   BrokenTestCaseWarningt   DeprecationWarningR   R   R   R   R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s"   									t   TestReporterInterfacec           B   sV   e  Z d  Z e j Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z RS(   ss  
    Tests for the bare interface of a trial reporter.

    Subclass this test case and provide a different 'resultFactory' to test
    that a particular reporter implementation will work with the rest of
    Trial.

    @cvar resultFactory: A callable that returns a reporter to be tested. The
        callable must take the same parameters as L{reporter.Reporter}.
    c         C   sR   t  j d  |  _ t j   |  _ t j   |  _ |  j |  j d |  j |  _	 d  S(   NR   t	   publisher(
   R   R   Rl   RM   Rs   R   t   LogPublisherR  t   resultFactoryR:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   s   |  j  t |  j j  d S(   s4   
        shouldStop is False to begin with.
        N(   R   R   R:   t
   shouldStop(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_shouldStopInitiallyFalse  s    c         C   s'   |  j  j   |  j t |  j  j  d S(   sG   
        shouldStop becomes True soon as someone calls stop().
        N(   R:   t   stopR   R   R  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_shouldStopTrueAfterStop  s    c         C   s   |  j  t |  j j    d S(   sS   
        wasSuccessful() is True when there have been no results reported.
        N(   R   R   R:   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_wasSuccessfulInitiallyTrue  s    c         C   s0   |  j  j |  j  |  j t |  j  j    d S(   sg   
        wasSuccessful() is True when there have been only successes, False
        otherwise.
        N(   R:   R   Rl   R   R   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt$   test_wasSuccessfulTrueAfterSuccesses  s    c         C   sY   y d d Wn- t  k
 r; |  j j |  j t j    n X|  j t |  j j    d S(   sP   
        wasSuccessful() becomes False after errors have been reported.
        i   i    N(	   Ra   R:   R>   Rl   R?   R@   R   R   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt"   test_wasSuccessfulFalseAfterErrors  s
     c         C   sa   y |  j  d  Wn0 |  j k
 rC |  j j |  j t j    n X|  j t |  j j	    d S(   sR   
        wasSuccessful() becomes False after failures have been reported.
        R<   N(
   t   failRG   R:   RH   Rl   R?   R@   R   R   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt$   test_wasSuccessfulFalseAfterFailures  s
     (   R   R   R   R   RN   R  R;   R  R  R  R  R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  v  s   
								t   TestReporterc           B   s   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z RS(   s8   
    Tests for the base L{reporter.Reporter} class.
    c         C   s)   t  j |   d |  _ |  j |  j _ d  S(   Ni    (   R  R;   t   _timerR   R:   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    	c         C   s   |  j  d 7_  |  j  S(   Ni   (   R  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   sr   |  j  j |  j  |  j  j |  j  |  j |  j  j d k  |  j |  j  j d  |  j |  j  j   t	  d  S(   Ni    i   (
   R:   R   Rl   t   stopTestR   t	   _lastTimeRB   t   testsRunR   R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_startStop  s
    c         C   s~   |  j  d t |  j   } | j d  |  j |  j j   d  |  j j d  | j d d  |  j |  j j   d  d S(	   sE   
        Test that the reporter safely writes to its stream.
        Rs   t   Hellos   Hello
i    s	   Hello %s!t   Worlds   Hello World!
N(   R  R   Rs   t   _writelnRB   RT   t   truncate(   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_brokenStream  s    c            s)     f d   }   j  t d t |  d S(   sI   
        L{IReporter.printErrors} was deprecated in Twisted 8.0.
        c              s     j  j   d  S(   N(   R:   t   printErrors(    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    s)   printErrors is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_printErrorsDeprecated  s    c            s)     f d   }   j  t d t |  d S(   sJ   
        L{IReporter.printSummary} was deprecated in Twisted 8.0.
        c              s     j  j   d  S(   N(   R:   t   printSummary(    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    s*   printSummary is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_printSummaryDeprecated  s    c            s)     f d   }   j  t d t |  d S(   sC   
        L{IReporter.write} was deprecated in Twisted 8.0.
        c              s     j  j d  d  S(   NR!   (   R:   R   (    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    s#   write is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_writeDeprecated  s    c            s)     f d   }   j  t d t |  d S(   sE   
        L{IReporter.writeln} was deprecated in Twisted 8.0.
        c              s     j  j d  d  S(   NR!   (   R:   t   writeln(    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   
  s    s%   writeln is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_writelnDeprecated  s    c            s)     f d   }   j  t d t |  d S(   sG   
        L{IReporter.separator} was deprecated in Twisted 8.0.
        c              s
     j  j S(   N(   R:   t	   separator(    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    s'   separator is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_separatorDeprecated  s    c            s)     f d   }   j  t d t |  d S(   sD   
        L{IReporter.stream} was deprecated in Twisted 8.0.
        c              s
     j  j S(   N(   R:   Rs   (    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR      s    s$   stream is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_streamDeprecated  s    c            s)     f d   }   j  t d t |  d S(   sI   
        L{IReporter.upDownError} was deprecated in Twisted 8.0.
        c              s     j  j d  d  d  d   d  S(   N(   R:   R   R#   (    (   R   (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   +  s    s)   upDownError is deprecated in Twisted 8.0.N(   R   R  R   (   R   R   (    (   R   sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_upDownErrorDeprecated'  s    c      	   C   s}   t  d  } d } d } d } |  j j d | d | d | d |  |  j |  j j   d	 | | | j d
  d | f  d S(   s   
        L{reporter.Reporter} observes warnings emitted by the Twisted log
        system and writes them to its output stream.
        s   some warning texts   exceptions.RuntimeWarnings   path/to/some/file.pyiG   t   warningR   t   filenamet   linenos   %s:%d: %s: %s
t   .iN(   t   RuntimeWarningR  t   msgRB   Rs   RT   Ry   (   R   R   R   R3  R4  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_warning2  s    c         C   s   |  j    |  j    d S(   sj   
        A warning emitted twice within a single test is only written to the
        stream once.
        N(   R8  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_duplicateWarningSuppressedD  s    
c         C   s   |  j  d  } |  j j |  |  j j d  |  j j   |  j   |  j j d  |  j j   |  j j |  |  j j |  |  j j d  |  j j   |  j   d S(   sn   
        A warning emitted again after a new test has started is written to the
        stream again.
        t   test_warningEmittedForNewTesti    N(   t	   __class__R:   R   Rs   t   seekR%  R8  R  (   R   Rl   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR:  P  s    
c      	   C   sr   |  j  j   |  j j d  |  j j   |  j j d t d  d d d d d d	  |  j |  j j	   d
  d S(   sl   
        L{reporter.Reporter} stops observing log events when its C{done} method
        is called.
        i    R2  s   some messageR   s   exceptions.RuntimeWarningR3  s   file/name.pyR4  i   R!   N(
   R:   RS   Rs   R<  R%  R  R7  R6  RB   RT   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_stopObservingq  s    (   R   R   R   R;   R   R!  R&  R(  R*  R+  R-  R/  R0  R1  R8  R9  R:  R=  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR    s    														!t   TestSafeStreamc           B   s   e  Z d    Z RS(   c         C   sN   t  j    } t |  } t j |  } | j d  |  j | j   d  d S(   s   
        Test that L{reporter.SafeStream} successfully write to its original
        stream even if an interrupt happens during the write.
        R"  N(   RM   R   R   t
   SafeStreamR   RB   RT   (   R   Rs   t   brokent   safe(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   test_safe  s
    (   R   R   RB  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR>    s   t   TestSubunitReporterc           B   s   e  Z d  Z e j Z d   Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z RS(   sx   
    Tests for the subunit reporter.

    This just tests that the subunit reporter implements the basic interface.
    c         C   s/   t  j d  k r t d   n  t j |   d  S(   Ns2   Subunit not installed, cannot test SubunitReporter(   R   t   TestProtocolClientR#   R   R  R;   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c   	      O   s   t  j    } t j |  } t | |  | |   } | j   } t |  j |  | |   } |  j | |  |  j | |  j j    d S(   s  
        Assert that 'methodName' on L{SubunitReporter} forwards to the
        equivalent method on subunit.

        Checks that the return value from subunit is returned from the
        L{SubunitReporter} and that the reporter writes the same data to its
        stream as subunit does to its own.

        Assumes that the method on subunit has the same name as the method on
        L{SubunitReporter}.
        N(   RM   R   RD  t   getattrRT   R:   R   Rs   (	   R   t
   methodNamet   argst   kwargsRs   t   subunitClientt   subunitReturnt   subunitOutputt   reporterReturn(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   assertForwardsToSubunit  s    c         C   s   t  | | d  } | d k r" d SxV t |  D]H } y t | |  Wn t t f k
 r` Pq/ X|  j t | | |  q/ Wd S(   s  
        Remove 'methodName' from 'klass'.

        If 'klass' does not have a method named 'methodName', then
        'removeMethod' succeeds silently.

        If 'klass' does have a method named 'methodName', then it is removed
        using delattr. Also, methods of the same name are removed from all
        base classes of 'klass', thus removing the method entirely.

        @param klass: The class to remove the method from.
        @param methodName: The name of the method to remove.
        N(   RE  R#   R    t   delattrt   AttributeErrorR0   t
   addCleanupt   setattr(   R   t   klassRF  R   t   base(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   removeMethod  s    c         C   s   |  j  t j d  y d d Wn0 t k
 rQ |  j j |  j t j   d  n X|  j	 j
   } |  j	 j d  |  j j |  j  |  j	 j
   } |  j | |  d S(   s   
        Some versions of subunit don't have "addExpectedFailure". For these
        versions, we report expected failures as successes.
        R   i   i    t   todoN(   RT  R   RD  Ra   R:   R   Rl   R?   R@   Rs   RT   R%  R   R   (   R   t   expectedFailureOutputt   successOutput(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt.   test_subunitWithoutAddExpectedFailureInstalled  s    #c         C   s~   |  j  t j d  |  j j |  j d  |  j j   } |  j j d  |  j j	 |  j  |  j j   } |  j
 | |  d S(   sz   
        Some versions of subunit don't have "addSkip". For these versions, we
        report skips as successes.
        R   t   reasoni    N(   RT  R   RD  R:   R   Rl   Rs   RT   R%  R   R   (   R   t
   skipOutputRW  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt#   test_subunitWithoutAddSkipInstalled  s    c            s   g      f d   } | |  j  j _ y d d Wn6 t k
 rh t j   } |  j  j |  j | d  n X|  j   |  j | f g  d S(   s   
        Some versions of subunit have "addExpectedFailure". For these
        versions, when we call 'addExpectedFailure' on the test result, we
        pass the error and test through to the subunit client.
        c            s     j  |  | f  d  S(   N(   R   (   Rl   R   (   t   addExpectedFailureCalls(    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    i   i    RU  N(   R:   t   _subunitR   Ra   R?   R@   Rl   R   (   R   R   R@   (    (   R\  sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt$   test_addExpectedFailurePassedThrough  s    c            sZ   g      f d   } | |  j  j _ |  j  j |  j d  |  j   |  j d f g  d S(   s   
        Some versions of subunit have "addSkip". For these versions, when we
        call 'addSkip' on the test result, we pass the test and reason through
        to the subunit client.
        c            s     j  |  | f  d  S(   N(   R   (   Rl   RY  (   t   addSkipCalls(    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   
  s    RY  N(   R:   R]  R   Rl   R   (   R   R   (    (   R_  sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_addSkipSendsSubunitAddSkip  s
    c         C   s*   |  j  j   |  j d |  j j    d S(   s   
        The subunit reporter doesn't need to print out a summary -- the stream
        of results is everything. Thus, done() does nothing.
        R!   N(   R:   RS   R   Rs   RT   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_doneDoesNothing  s    c         C   s   |  j  d |  j  d S(   sT   
        SubunitReporter.startTest() sends the subunit 'startTest' message.
        R   N(   RM  Rl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt#   test_startTestSendsSubunitStartTest  s    c         C   s   |  j  d |  j  d S(   sR   
        SubunitReporter.stopTest() sends the subunit 'stopTest' message.
        R  N(   RM  Rl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt!   test_stopTestSendsSubunitStopTest$  s    c         C   s   |  j  d |  j  d S(   sV   
        SubunitReporter.addSuccess() sends the subunit 'addSuccess' message.
        R   N(   RM  Rl   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt%   test_addSuccessSendsSubunitAddSuccess+  s    c         C   sF   y d d Wn t  k
 r+ t j   } n X|  j d |  j |  d S(   sR   
        SubunitReporter.addError() sends the subunit 'addError' message.
        i   i    R>   N(   Ra   R?   R@   RM  Rl   (   R   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt!   test_addErrorSendsSubunitAddError2  s
    c         C   sN   y |  j  d  Wn  |  j k
 r3 t j   } n X|  j d |  j |  d S(   sV   
        SubunitReporter.addFailure() sends the subunit 'addFailure' message.
        t   helloRH   N(   R  RG   R?   R@   RM  Rl   (   R   RE   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt%   test_addFailureSendsSubunitAddFailure=  s
    c         C   sj   t  j    } t j |  } | j |  j  | j   } |  j j |  j d  |  j | |  j	 j    d S(   s   
        SubunitReporter.addFailure() sends the subunit 'addSuccess' message,
        since subunit doesn't model unexpected success.
        RU  N(
   RM   R   RD  R   Rl   RT   R:   R   R   Rs   (   R   Rs   RI  RK  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt/   test_addUnexpectedSuccessSendsSubunitAddSuccessH  s    c         C   sH   t  j   j d  } | j |  j  |  j j   } |  j d |  d S(   sC   
        Load-time errors are reported like normal errors.
        t   doesntexistN(   R   RP   t
   loadByNameRW   R:   Rs   RT   t   assertIn(   R   Rl   R2   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_loadTimeErrorsU  s    (   R   R   R   R   t   SubunitReporterR  R;   RM  RT  RX  R[  R^  R`  Ra  Rb  Rc  Rd  Re  Rg  Rh  Rl  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRC    s"   																t   TestSubunitReporterNotInstalledc           B   s   e  Z d  Z d   Z RS(   sD   
    Test behaviour when the subunit reporter is not installed.
    c         C   sQ   t  j    } |  j t d d  |  j t t j |  } |  j d t |   d S(   s   
        If subunit is not installed, TestProtocolClient will be None, and
        SubunitReporter will raise an error when you try to construct it.
        RD  s   Subunit not availableN(	   RM   t   patchR   R#   R   R   Rm  R   R,   (   R   Rs   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_subunitNotInstalledg  s    (   R   R   R   Rp  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRn  b  s   t   TestTimingReporterc           B   s   e  Z e j Z RS(    (   R   R   R   t   TimingTextReporterR  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRq  s  s   t   LoggingReporterc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   sJ   
    Simple reporter that stores the last test that was passed to it.
    c         O   s#   t  j j |  | |  d  |  _ d  S(   N(   R   RN   R   R#   Rl   (   R   RG  RH  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR   }  s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR>     s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   RE   RU  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   RE   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRH     s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   t   skip(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   RU  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   | |  _  d  S(   N(   Rl   (   R   Rl   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR    s    (   R   R   R   R   R>   R   RH   R   R   R   R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRs  x  s   							t   TestAdaptedReporterc           B   sz   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 d	   Z d
   Z d   Z d   Z RS(   s   
    L{reporter._AdaptedReporter} is a reporter wrapper that wraps all of the
    tests it receives before passing them on to the original reporter.
    c         C   s   |  j    |  _ d  S(   N(   t   getWrappedResultt   wrappedResult(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   s
   | j    S(   N(   R   (   R   Rl   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   _testAdapter  s    c         C   s#   |  j  | j j |  j |   d  S(   N(   RB   R   Rl   Rx  (   R   Rw  Rl   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   assertWrapped  s    c         C   s   y
 |  Wn t    SXd S(   s   
        Return a L{Failure} from raising the given exception.

        @param exceptionInstance: The exception to raise.
        @return: L{Failure}
        N(   R   (   R   t   exceptionInstance(    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt
   getFailure  s    
c         C   s   t    } t j | |  j  S(   N(   Rs  R   t   _AdaptedReporterRx  (   R   R:   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRv    s    	c         C   s6   |  j  j |  |  j t     |  j |  j  |   d S(   sG   
        C{addError} wraps its test with the provided adapter.
        N(   Rw  R>   R{  R=   Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_addError  s    c         C   s6   |  j  j |  |  j t     |  j |  j  |   d S(   sI   
        C{addFailure} wraps its test with the provided adapter.
        N(   Rw  RH   R{  Rp   Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_addFailure  s    c         C   s9   |  j  j |  |  j t d    |  j |  j  |   d S(   sF   
        C{addSkip} wraps its test with the provided adapter.
        s	   no reasonN(   Rw  R   R{  R   Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_addSkip  s    "c         C   s'   |  j  j |   |  j |  j  |   d S(   sH   
        C{startTest} wraps its test with the provided adapter.
        N(   Rw  R   Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_startTest  s    c         C   s'   |  j  j |   |  j |  j  |   d S(   sG   
        C{stopTest} wraps its test with the provided adapter.
        N(   Rw  R  Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_stopTest  s    c         C   s?   |  j  j |  |  j t    t d   |  j |  j  |   d S(   sQ   
        C{addExpectedFailure} wraps its test with the provided adapter.
        s	   no reasonN(   Rw  R   R{  R=   R   Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_addExpectedFailure  s    	c         C   s0   |  j  j |  t d   |  j |  j  |   d S(   sS   
        C{addUnexpectedSuccess} wraps its test with the provided adapter.
        s	   no reasonN(   Rw  R   R   Ry  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_addUnexpectedSuccess  s    (   R   R   R   R;   Rx  Ry  R{  Rv  R}  R~  R  R  R  R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyRu    s   												t
   FakeStreamc           B   s#   e  Z d  Z e d  Z d   Z RS(   s   
    A fake stream which C{isatty} method returns some predictable.

    @ivar tty: returned value of C{isatty}.
    @type tty: C{bool}
    c         C   s   | |  _  d  S(   N(   t   tty(   R   R  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR     s    c         C   s   |  j  S(   N(   R  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   isatty  s    (   R   R   R   R   R   R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR    s   t   AnsiColorizerTestsc           B   sV   e  Z d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(	   s/   
    Tests for L{reporter._AnsiColorizer}.
    c         C   s   t  j j   |  _ d  S(   N(   R?   t   modulest   copyt   savedModules(   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR;     s    c         C   s$   t  j j   t  j j |  j  d  S(   N(   R?   R  t   cleart   updateR  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   tearDown  s    c         C   s#   |  j  t j j t t    d S(   sq   
        L{reporter._AnsiColorizer.supported} returns C{False} if the given
        stream is not a TTY.
        N(   t   assertFalseR   t   _AnsiColorizert	   supportedR  R   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_supportedStdOutTTY  s    c         C   s-   d t j d <|  j t j j t     d S(   sw   
        L{reporter._AnsiColorizer.supported} returns C{False} if the curses
        module can't be imported.
        t   cursesN(   R#   R?   R  R  R   R  R  R  (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_supportedNoCurses  s    c         C   s|   d t  f d     Y} |   t j d <|  j t j j t     |  j t j j t     |  j t j d j	 d  d S(   s  
        L{reporter._AnsiColorizer.supported} returns C{True} if
        C{curses.tigetnum} returns more than 2 supported colors. It only tries
        to call C{curses.setupterm} if C{curses.tigetnum} previously failed
        with a C{curses.error}.
        t
   fakecursesc           B   s&   e  Z e Z d  Z d   Z d   Z RS(   i    c         S   s   |  j  d 7_  d  S(   Ni   (   R;   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt	   setupterm1  s    c         S   s   |  j  r d S|  j    d  S(   Ni   (   R;   R   (   R   RC   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   tigetnum4  s    	(   R   R   R=   R   R;   R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  -  s   	R  i   N(
   t   objectR?   R  R   R   R  R  R  R   R;   (   R   R  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_supportedSetupTerm&  s
    c         C   sF   d t  f d     Y} |   t j d <|  j t j j t     d S(   s   
        L{reporter._AnsiColorizer.supported} returns C{False} and doesn't try
        to call C{curses.setupterm} if C{curses.tigetnum} returns something
        different than C{curses.error}.
        R  c           B   s   e  Z e Z d    Z RS(   c         S   s   t     d  S(   N(   t
   ValueError(   R   RC   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  J  s    (   R   R   R=   R   R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  G  s   R  N(   R  R?   R  R  R   R  R  R  (   R   R  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt    test_supportedTigetNumWrongErrorA  s    c         C   sF   d t  f d     Y} |   t j d <|  j t j j t     d S(   s   
        L{reporter._AnsiColorizer.supported} returns C{False} if
        C{curses.tigetnum} returns less than 2 supported colors.
        R  c           B   s   e  Z e Z d    Z RS(   c         S   s   d S(   Ni   (    (   R   RC   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  Y  s    (   R   R   R=   R   R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  V  s   R  N(   R  R?   R  R  R   R  R  R  (   R   R  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt$   test_supportedTigetNumNotEnoughColorQ  s    c         C   s`   d t  f d     Y} |   t j d <|  j t j j t     |  j t j d j	 d  d S(   s   
        L{reporter._AnsiColorizer.supported} returns C{False} if
        C{curses.tigetnum} raises an error, and calls C{curses.setupterm} once.
        R  c           B   s&   e  Z e Z d  Z d   Z d   Z RS(   i    c         S   s   |  j  d 7_  d  S(   Ni   (   R;   (   R   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  i  s    c         S   s   |  j     d  S(   N(   R   (   R   RC   (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  l  s    (   R   R   R=   R   R;   R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR  e  s   	R  i   N(
   R  R?   R  R  R   R  R  R  R   R;   (   R   R  (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   test_supportedTigetNumErrors`  s    
(   R   R   R   R;   R  R  R  R  R  R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyR    s   								(    (;   R   R   R?   Rw   R'   RM   t   inspectR    t   twisted.internet.utilsR   t   twisted.pythonR   t   twisted.python.failureR   t   twisted.trialR   R   R   R   R   t   twisted.trial.reporterR	   Rb   R
   t   twisted.trial.unittestR   R   R   R   R  R   t   TestCaseR    R8   RK   RO   Rn   Ro   R   R   R   R   R   R   R   R   R   R   R  R  R>  RC  Rn  Rq  RN   Rs  Ru  R  R  (    (    (    sD   /usr/lib/python2.7/dist-packages/twisted/trial/test/test_reporter.pyt   <module>   sJ   <(t/-GGKmK ^