get_test_lists
Returns the test lists of the open project — the places CAT loaded test definitions from.
On this page
Signature
cat.get_test_lists()
Parameters
None.
What it does
Returns the project’s test lists: the project file’s own implicit list and every Test list the project declares (a YAML file, a database table, an Excel sheet, …), each with its provider and connection. Use it to see where tests come from; get_tests returns the tests themselves, with TestListID pointing back here.
Returns
A .NET collection of TestList objects: TestListID, Name, Order, ProviderNameAndVersion, ConnectionString, Query, IsImplicit (the project file’s own list), FullName, Settings.
Raises
The license key and plan check (first call of the process) raises the CatPortalError family listed on the Introduction page. With no open project: RuntimeError: There is no open project. Open a CAT project file first.
Examples
cat.open_project("D:/Testing/DwhTests.cat.yaml")
lists = list(cat.get_test_lists())
tests = list(cat.get_tests())
for l in lists:
n = sum(1 for t in tests if t.TestListID == l.TestListID)
print(f"{l.Name}: {n} tests")
Related
- Introduction — session model, logging, .NET objects, exceptions, plans and the license key.
- Lists.
get_tests.