Tests
Testudos uses pytest for Python tests, with a built-in pytest plugin that provides fixtures to connect to the engine and (optionally) start/stop your AUT.
Prerequisites
- Testudos engine is running (headless, daemon, or GUI).
- Your AUT profile is registered in the engine (the name you pass as
testudos_aut_namemust match the engine config).
Install requirements (pytest + Testudos)
In your venv:
python -m pip install -U pip pytestpython -m pip install testudosIf you’re working from this repository, you’ll typically install the Python package from python/ (editable install) or install a built wheel from build-deploy (see the Quickstart).
Configure engine host/port
The pytest plugin reads the engine location from environment variables:
TESTUDOS_ENGINE_HOST(default:localhost)TESTUDOS_ENGINE_PORT(default:4322)
Example:
export TESTUDOS_ENGINE_HOST=127.0.0.1export TESTUDOS_ENGINE_PORT=4322python -m pytest -vWriting tests
Option A: Connect to an already-running AUT (use testudos_client)
Use testudos_client when your test only needs an engine connection (for example, unit-ish API tests, or flows where the AUT lifecycle is managed outside pytest).
Minimal example:
from testudos import wait_for_object
def test_can_find_primary_button(testudos_client): btn = wait_for_object("primaryButton") assert btn is not NoneOption B: Let pytest start/stop the AUT per test (use testudos_app)
Use testudos_app when each test should run against a fresh AUT process. This fixture:
- stops any running AUT (best-effort)
- selects the AUT profile named by
testudos_aut_name - starts the AUT before the test
- stops the AUT after the test
You must define testudos_aut_name either in your test module or in a conftest.py that applies to your tests.
Example:
import pytest
from testudos import wait_for_object
@pytest.fixture(scope="module")def testudos_aut_name(): return "ExampleTestApp"
def test_login_button_exists(testudos_app): login_btn = wait_for_object("loginButton", timeout=10.0) assert login_btn is not NoneRunning your tests
Run pytest against your test directory or file:
export TESTUDOS_ENGINE_HOST=127.0.0.1export TESTUDOS_ENGINE_PORT=4322python -m pytest <YOUR_TESTS_DIR_OR_FILE> -vNotes:
- Tests that use
testudos_client/testudos_apprequire a reachable engine; if the engine is unreachable, those tests will be skipped by the plugin.