---
title: "get_tests"
description: "get_tests — the tests of the open project."
url: "https://docs.justcat.it/reference/python-module/get-tests/"
---
# get_tests

## Signature

```python
cat.get_tests()
```

## Parameters

None.

## What it does

Returns the tests CAT loaded when the project was opened: the ones written in the project file, the ones loaded from every test list, and the ones generated from metadata — in the order CAT loaded them. It is the way to see what a run *would* execute, and to pick test IDs for `invoke_tests(test_ids=…)`.

## Returns

A .NET collection of `TestDefinition` objects: `TestDefinitionID` (a `System.Guid` — what `test_ids` takes; new on every open), `Suite`, `Order`, `TestCase`, `Name`, `TestFullName` (`[Suite].[Order].[TestCase].[Name]`, absent parts omitted), `Description`, `FirstDataSource`, `FirstQuery`, `SecondDataSource`, `SecondQuery`, `Expectation`, `ExpectedRowCount`, `Tolerance`, `Tags` (a string array), `Timeout`, `MaximumErrorsLogged`, `Metadata`, `TestListID`, `TestTemplateID`, and the `*Raw` twins with the values as written.

## Raises

The sign-in and plan check (first call of the process) raises the `CatPortalError` family listed on the [Introduction](https://docs.justcat.it/reference/python-module/introduction/ "Introduction") page. With no open project: in the current version a bare `TypeError: exceptions must derive from BaseException` (not a readable message) — call `open_project` first.

## Examples

```python
cat.open_project("D:/Testing/DwhTests.cat.yaml")
tests = list(cat.get_tests())
print(len(tests))
for t in tests:
    print(t.TestFullName, list(t.Tags))

# run only the tests of one suite, by ID (same open project!)
ids = {t.TestDefinitionID for t in tests if t.Suite == "Departures"}
summary = cat.invoke_tests(test_ids=ids)
```

## Related

- [Introduction](https://docs.justcat.it/reference/python-module/introduction/ "Introduction") — session model, logging, .NET objects, exceptions, sign-in.
- [Tests — properties](https://docs.justcat.it/reference/tests/properties/ "Test properties").
- [`invoke_tests`](https://docs.justcat.it/reference/python-module/invoke-tests/ "invoke_tests") · [`get_test_results`](https://docs.justcat.it/reference/python-module/get-test-results/ "get_test_results").

