Get Help

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.

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.Decimalfloat(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