MCPcopy Index your code
hub / github.com/python/cpython / TestStats

Class TestStats

Lib/test/libregrtest/result.py:12–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11@dataclasses.dataclass(slots=True)
12class TestStats:
13 tests_run: int = 0
14 failures: int = 0
15 skipped: int = 0
16
17 @staticmethod
18 def from_unittest(result):
19 return TestStats(result.testsRun,
20 len(result.failures),
21 len(result.skipped))
22
23 @staticmethod
24 def from_doctest(results):
25 return TestStats(results.attempted,
26 results.failed,
27 results.skipped)
28
29 def accumulate(self, stats):
30 self.tests_run += stats.tests_run
31 self.failures += stats.failures
32 self.skipped += stats.skipped
33
34
35# Avoid enum.Enum to reduce the number of imports when tests are run

Callers 13

check_executed_testsMethod · 0.90
test_failing_testMethod · 0.90
test_foreverMethod · 0.90
test_rerun_failMethod · 0.90
test_rerun_successMethod · 0.90
test_doctestMethod · 0.90
test_xmlMethod · 0.90
checkMethod · 0.90
__init__Method · 0.85
from_unittestMethod · 0.85
from_doctestMethod · 0.85

Calls

no outgoing calls

Tested by 9

check_executed_testsMethod · 0.72
test_failing_testMethod · 0.72
test_foreverMethod · 0.72
test_rerun_failMethod · 0.72
test_rerun_successMethod · 0.72
test_doctestMethod · 0.72
test_xmlMethod · 0.72
checkMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…