
    Vh                     ^    d Z ddlZddlmZmZmZmZ ddlmZ  G d dej                        Z
y)z!
Test Twisted's doctest support.
    N)itrialreporterrunnerunittest)mockdoctestc                   ^    e Zd ZdZddZddZdej                  ddfdZdde	ddfd	Z
dd
Zy)RunnersTestsz.
    Tests for Twisted's doctest support.
    returnNc                     t        j                         }|j                  t              }d}|j                  D ]5  }| j                  |t        j                  |      j                                7 y)zq
        Check that the id() of the doctests' case object contains the FQPN of
        the actual tests.
        z&twisted.trial.test.mockdoctest.CounterN)	r   
TestLoaderloadDoctestsr   _testsassertInr   	ITestCaseid)selfloadersuiteidPrefixtests        O/home/dcms/DCMS/lib/python3.12/site-packages/twisted/trial/test/test_doctest.pytest_idzRunnersTests.test_id   s^    
 ""$##K0;LL 	ADMM(F$4$4T$:$=$=$?@	A    c                     t        j                         }|j                  t              }| j	                  d|j                                y)zP
        L{loadDoctests} loads all of the doctests in the given module.
           N)r   r   r   r   assertEqualcountTestCases)r   r   r   s      r   test_basicTrialIntegrationz'RunnersTests.test_basicTrialIntegration   s;     ""$##K0E0023r   r   c                     t        j                         }|j                  |       | j                  d|j                         | j                  dt        |j                               y)z4
        Run C{suite} and check the result.
              N)r   
TestResultrunr   	successeslenfailures)r   r   results      r   _testRunzRunnersTests._testRun%   sM     $$&		&F,,-C01r   countc                 t    t        j                         j                  t              }| j	                  |       y)zL
        Trial can correctly run doctests with its xUnit test APIs.
        Nr   r   r   r   r(   )r   r)   r   s      r   test_expectedResultsz!RunnersTests.test_expectedResults.   s)     !!#00=er   c                     t        j                         j                  t              }| j	                  |       | j	                  |       y)z9
        Doctests should be runnable repeatably.
        Nr+   )r   r   s     r   test_repeatablezRunnersTests.test_repeatable5   s5     !!#00=eer   )r
   N)   )__name__
__module____qualname____doc__r   r   pyunit	TestSuiter(   intr,   r.    r   r   r	   r	      sC    	A42f.. 24 2# d r   r	   )r3   r   r4   twisted.trialr   r   r   twisted.trial.testr   SynchronousTestCaser	   r7   r   r   <module>r;      s*     < < *.8// .r   