
    he                         S r SSKrSSKJr  SSKJr   " S S\R                  5      r " S S5      r " S	 S
\R                  5      r	g)z
Sample test cases defined using the standard library L{unittest.TestCase}
class which are used as data by test cases which are actually part of the
trial test suite to verify handling of handling of such cases.
    N)exc_info)Failurec                   V    \ rS rSrS rS rS r\R                  " S5      S 5       r	Sr
g)	
PyUnitTest   c                     g)z
A passing test.
N selfs    e/root/1688_scrapy/alibaba-scraper/venv/lib/python3.13/site-packages/twisted/trial/test/pyunitcases.py	test_passPyUnitTest.test_pass           c                     [        S5      e)z5
A test which raises an exception to cause an error.
zpyunit error)	Exceptionr
   s    r   
test_errorPyUnitTest.test_error   s     ''r   c                 &    U R                  S5        g)zA
A test which uses L{unittest.TestCase.fail} to cause a failure.
zpyunit failureN)failr
   s    r   	test_failPyUnitTest.test_fail   s     			"#r   zpyunit skipc                     g)zC
A test which uses the L{unittest.skip} decorator to cause a skip.
Nr	   r
   s    r   	test_skipPyUnitTest.test_skip"   r   r   r	   N)__name__
__module____qualname____firstlineno__r   r   r   unittestskipr   __static_attributes__r	   r   r   r   r      s.    
($ ]]=! "r   r   c                   &    \ rS rSrSrS\4S jrSrg)_NonStringId)   z
A class that looks a little like a TestCase, but not enough so to
actually be used as one.  This helps L{BrokenRunInfrastructure} use some
interfaces incorrectly to provoke certain failure conditions.
returnc                     [        5       $ )N)objectr
   s    r   id_NonStringId.id0   s	    xr   r	   N)r   r   r   r   __doc__r(   r)   r"   r	   r   r   r$   r$   )   s    F r   r$   c                   B    \ rS rSrSrS rS rS rS rS r	S r
S	 rS
rg)BrokenRunInfrastructure4   zi
A test suite that is broken at the level of integration between
L{TestCase.run} and the results object.
c                 8    [        X R                  5      " U5      $ )z
Override the normal C{run} behavior to pass the result object
along to the test method.  Each test method needs the result object so
that it can implement its particular kind of brokenness.
)getattr_testMethodNamer   results     r   runBrokenRunInfrastructure.run:   s     t1126::r   c                 6    UR                  [        5       5        g)z1
Violate the L{TestResult.addSuccess} interface.
N)
addSuccessr$   r2   s     r   test_addSuccess'BrokenRunInfrastructure.test_addSuccessB   s    
 	,.)r   c                      [        S5      e! [         a    [        5       n Of = fUR                  [	        5       U5        g)z/
Violate the L{TestResult.addError} interface.
test_addErrorN)r   BaseExceptionr   addErrorr$   r   r3   errs      r   r;   %BrokenRunInfrastructure.test_addErrorI   s:    	O,, 	*C	 	,    $$c                      [        S5      e! [         a    [        5       n Of = fUR                  [	        5       U5        g)z1
Violate the L{TestResult.addFailure} interface.
test_addFailureN)r   r<   r   
addFailurer$   r>   s      r   rC   'BrokenRunInfrastructure.test_addFailureT   s=    	-.. 	*C	 	,.#.rA   c                 8    UR                  [        5       S5        g)z.
Violate the L{TestResult.addSkip} interface.
test_addSkipN)addSkipr$   r2   s     r   rG   $BrokenRunInfrastructure.test_addSkip_   s     	|~~6r   c                      [        S5      e! [         a    [        5       n Of = fUR                  [	        5       U5        g)z9
Violate the L{TestResult.addExpectedFailure} interface.
test_addExpectedFailureN)r   r<   r   addExpectedFailurer$   r>   s      r   rK   /BrokenRunInfrastructure.test_addExpectedFailuree   s;    	566 	)C	!!,.#6rA   c                 6    UR                  [        5       5        g)z;
Violate the L{TestResult.addUnexpectedSuccess} interface.
N)addUnexpectedSuccessr$   r2   s     r   test_addUnexpectedSuccess1BrokenRunInfrastructure.test_addUnexpectedSuccesso   s     	##LN3r   r	   N)r   r   r   r   r+   r4   r8   r;   rC   rG   rK   rP   r"   r	   r   r   r-   r-   4   s*    
;*	-	/774r   r-   )
r+   r    sysr   twisted.python.failurer   TestCaser   r$   r-   r	   r   r   <module>rU      sC      *"" 2 ?4h// ?4r   