get_test_results_summary
Returns the summary of the last run in this process — counts, rates, duration, and the per-test results — as one object. The object to check in a script.
On this page
Signature
cat.get_test_results_summary()
Parameters
None.
What it does
Returns the summary CAT kept from the last invoke_project / invoke_tests in this process — the same object those functions returned; None before any run. This is how a script decides whether a run was good: neither invoke_* function raises for failed tests.
Returns
A TestExecutionSummary object, or None: TotalCount, PassedCount, FailedCount, ErrorCount, InconclusiveCount, SkippedCount (ints); PassRate, FailedRate, ErrorRate, InconclusiveRate (percent, System.Decimal — float(str(x)) to convert); StartedOn, FinishedOn, Duration; ExecutionGuid; Results — the same items get_test_results returns; GetShortSummary() — a small text table. Inconclusive is a test CAT could not bring to a verdict, not a failure.
Raises
The sign-in and plan check (first call of the process) raises the CatPortalError family listed on the Introduction page.
Examples
s = cat.get_test_results_summary()
if s is not None:
print(f"{s.PassedCount}/{s.TotalCount} passed, {s.PassRate} %")
print(s.GetShortSummary())
if s.FailedCount > 0 or s.ErrorCount > 0:
raise SystemExit(1) # fail the job
Related
- Introduction — session model, logging, .NET objects, exceptions, sign-in.
invoke_project·invoke_tests— return this object directly.get_test_results.