Skip to main content

Python client for the Tuskr test management REST API

Project description

Tuskr Python Client

A Python client for the Tuskr test management REST API.

Installation

pip install tuskr-python-client

Or with Poetry (Python 3.12+):

poetry add tuskr-python-client

From source:

git clone https://github.com/OleksiiTaran/tuskr-python-client.git
cd tuskr-python-client
poetry install

Quick Start

You need a Tenant ID and an Access Token from Tuskr (Top Menu → API). Treat the token as a secret.

Request bodies use Pydantic models for validation and camelCase serialization:

from tuskr import (
    TuskrClient,
    ListProjectsRequest,
    CreateProjectRequest,
    AddTestCaseRequest,
    CreateTestRunRequest,
    AddTestRunResultsRequest,
)

client = TuskrClient(tenant_id="your-tenant-uuid", token="your-api-token")

# List projects
projects = client.list_projects(ListProjectsRequest())
# With filters: ListProjectsRequest(name="Acme", status="active", page=1)

# Create a project
project = client.create_project(
    CreateProjectRequest(name="My Project", team={"user@example.com": "Tester"})
)

# Add a test case
tc = client.add_test_case(
    AddTestCaseRequest(
        project="My Project",
        test_suite="Checkout",
        test_suite_section="Payment",
        name="Valid coupon code",
        test_case_type="Functional",
        estimated_time_in_minutes=15,
    )
)

# Create a test run and add results
run = client.create_test_run(
    CreateTestRunRequest(
        project="My Project",
        name="Sprint 1 Run",
        test_case_inclusion_type="ALL",
        assigned_to="user@example.com",
    )
)
client.add_test_run_results(
    AddTestRunResultsRequest(
        test_run="Sprint 1 Run",
        test_cases=["C-1", "C-2"],
        status="PASSED",
        comments="All good",
    )
)

API Coverage

  • Projects: create_project, list_projects
  • Test cases: add_test_case, upsert_test_case, import_test_plan, list_test_cases
  • Test suites: list_test_suites
  • Test runs: create_test_run, copy_test_run, list_test_runs, get_test_run_results, delete_test_runs, bulk_export_test_runs
  • Results: add_test_run_results

See the Tuskr API docs for details.

Exceptions

  • TuskrAPIError — base API error (4xx/5xx)
  • TuskrAuthError — invalid or expired token (401)
  • TuskrRateLimitError — rate limit exceeded (429)

Rate Limits

Tuskr enforces 10 requests/second and plan-specific hourly limits. Use bulk operations (e.g. import_test_plan, add_test_run_results) where possible.

Development

Requires Python 3.12+ and Poetry.

poetry install
poetry run pytest

Verifying without live API (free plan / offline)

The Tuskr API is only available on trial or paid plans; the free plan has no API access.

You can still verify the client without a live project:

  • Unit tests – request/response models, validation, HTTP error handling.
  • Contract tests – client against realistic mock responses from the API docs (list projects, create project, import plan, test runs, results, etc.):
poetry run pytest tests/test_client.py tests/test_contract.py -v

Verifying against live Tuskr (trial or paid)

You need Tenant ID, API token, and team email from Top Menu → API (trial or paid account).

Smoke script (create project → import plan → run → results → cleanup):

export TUSKR_TENANT_ID="your-tenant-uuid"
export TUSKR_TOKEN="your-api-token"
export TUSKR_TEAM_EMAIL="your@email.com"
poetry run python scripts/smoke_test.py

Integration tests (skipped if env vars are missing):

export TUSKR_TENANT_ID="..." TUSKR_TOKEN="..." TUSKR_TEAM_EMAIL="..."
poetry run pytest tests/integration -v -m integration

If you're on the free plan: start a new trial (e.g. with another email) to get API access temporarily, run the smoke or integration tests, then rely on unit + contract tests afterward.

Publishing (maintainers)

GitHub: Create a repo at https://github.com/OleksiiTaran/tuskr-python-client, then:

git remote add origin https://github.com/OleksiiTaran/tuskr-python-client.git
git push -u origin main

PyPI: Create a PyPI account and API token, then:

poetry config pypi-token.pypi YOUR_TOKEN   # or use env POETRY_HTTP_BASIC_PYPI_PASSWORD
poetry build
poetry publish

Tag releases for versions (e.g. git tag v0.1.0 && git push --tags).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuskr_python_client-0.1.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuskr_python_client-0.1.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file tuskr_python_client-0.1.0.tar.gz.

File metadata

  • Download URL: tuskr_python_client-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.17 Darwin/25.2.0

File hashes

Hashes for tuskr_python_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbb033b9926c5a435d0041dab457455f68c42ad61980662ff9807e6a5dee7242
MD5 429d4e6da805ca38f8fb21069c3a39b5
BLAKE2b-256 c96bc4e58d2543843764d56ee153fe42769b91d96546dacee412956cedb8075a

See more details on using hashes here.

File details

Details for the file tuskr_python_client-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tuskr_python_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9bf363af55b996d772075d19e134c7d0359ed85eeb794d7cb9b31552eba8e73a
MD5 b6a052eae04ddb3e28ea80f6901601dc
BLAKE2b-256 2acaf5b49a68524f934cf157f387f985209f5fc008ce7c2abbdefd58e5016817

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page