o
0i4 @ sz d dl Z ddlmZ ddlmZ dZdd ZG dd d eZG d
d deZG dd
d
eZ dd Z
G dd deZdS ) N )case)utilTc C s t | |dd }| d S )Nc S d S N r r r 5/opt/alt/python310/lib64/python3.10/unittest/suite.py s z!_call_if_exists..)getattr)parentattrfuncr r r _call_if_exists s
r c @ sl e Zd Z dZdddZdd Zdd Zd d
Zdd Zd
d Z dd Z
dd Zdd Zdd Z
dd ZdS )
BaseTestSuiteTr c C s g | _ d| _| | d S Nr )_tests_removed_testsaddTests)selftestsr r r __init__ s zBaseTestSuite.__init__c C s dt | jt| f S )Nz
<%s tests=%s>)r strclass __class__listr r r r __repr__ s zBaseTestSuite.__repr__c C s t || jstS t| t|kS r )
isinstancer NotImplementedr )r otherr r r __eq__ s zBaseTestSuite.__eq__c C s
t | jS r )iterr r r r r __iter__"
zBaseTestSuite.__iter__c C s$ | j }| D ]
}|r|| 7 }q|S r )r countTestCases)r casestestr r r r# % s zBaseTestSuite.countTestCasesc C sL t |s
tdt|t|trt|tjt frtd| j
| d S )Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())callable TypeErrorformatreprr type
issubclassr ZTestCase TestSuiter appendr r% r r r addTest, s zBaseTestSuite.addTestc C s* t |tr td|D ]}| | qd S )Nz0tests must be an iterable of tests, not a string)r strr' r/ )r r r% r r r r 6 s
zBaseTestSuite.addTestsc C s: t | D ]\}}|jr |S || | jr| | q|S r ) enumerate
shouldStop_cleanup_removeTestAtIndex)r resultindexr% r r r run<