mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
regrtest computes statistics (#108793)
test_netrc, test_pep646_syntax and test_xml_etree now return results in the test_main() function. Changes: * Rewrite TestResult as a dataclass with a new State class. * Add test.support.TestStats class and Regrtest.stats_dict attribute. * libregrtest.runtest functions now modify a TestResult instance in-place. * libregrtest summary lists the number of run tests and skipped tests, and denied resources. * Add TestResult.has_meaningful_duration() method. * Compute TestResult duration in the upper function. * Use time.perf_counter() instead of time.monotonic(). * Regrtest: rename 'resource_denieds' attribute to 'resource_denied'. * Rename CHILD_ERROR to MULTIPROCESSING_ERROR. * Use match/case syntadx to have different code depending on the test state. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
parent
e7de0c5901
commit
d4e534cbb3
10 changed files with 507 additions and 303 deletions
|
@ -309,7 +309,7 @@ class NetrcTestCase(unittest.TestCase):
|
|||
('anonymous', '', 'pass'))
|
||||
|
||||
def test_main():
|
||||
run_unittest(NetrcTestCase)
|
||||
return run_unittest(NetrcTestCase)
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue