Skip to main content

pytest-devant-cloud

pytest plugin that streams runs, results, and per-test step trees into Devant as your suite executes — the Python sibling of @devant-net/playwright-reporter.

Install

pip install pytest-devant-cloud

The plugin auto-registers via the pytest11 entry-point group. No conftest.py changes are needed.

Configure

Set env vars before invoking pytest:

Var Default Notes
DEVANT_API_URL http://localhost:32124 Your tenant's URL
DEVANT_TOKEN dev-admin-token Bearer token (CI/CD settings)
DEVANT_PROJECT_ID 1 Devant project id
DEVANT_RUN_NAME pytest — <ISO date> Display name on the run
DEVANT_RUN_ID (unset) Attach to an externally-created run instead of creating one

Or with CLI flags:

pytest \
  --devant-api-url=https://acme.devq.cloud \
  --devant-token=$DEVANT_TOKEN \
  --devant-project-id=1

To disable the plugin for one run without uninstalling:

pytest -p no:devant_cloud

How tests bind to test cases

Each pytest item resolves to a Devant test_case row in this order:

  1. @pytest.mark.devant("DEF-AB12") marker on the test — looked up via GET /v1/test-cases/by-key/DEF-AB12.
  2. Exact name match (<file>::<test> nodeid) in the project → GET /v1/test-cases?search=….
  3. Auto-createPOST /v1/test-cases. The plugin prints the new key:
    [devant] minted DEF-XYZ9 for "tests/test_auth.py::test_login"
             — add @pytest.mark.devant("DEF-XYZ9") to bind it
    

Bind the key in source once and future runs (even with renames) reuse the same case.

What gets sent

pytest hook Devant call
pytest_sessionstart POST /v1/runs (skipped if DEVANT_RUN_ID is set)
pytest_runtest_makereport (wrapper) stashes setup/call/teardown reports on the item
pytest_runtest_logreport (teardown phase) resolve test case → POST /v1/runs/:id/results with step tree
pytest_sessionfinish POST /v1/runs/:id/complete (skipped if DEVANT_RUN_ID is set)

The step tree includes one node per phase (setup / call / teardown) with status, duration, and longrepr captured as error_message.

Suites

Tests are grouped into Devant's nestable suite hierarchy. The nodeid is split into a suite chain (directories + module stem + class chain) and a leaf name (the test function plus its parametrize id):

nodeid suite_segments test case name
tests/test_x.py::test_foo ["tests", "test_x"] test_foo
tests/api/test_x.py::TestThing::test_y[a-1] ["tests", "api", "test_x", "TestThing"] test_y[a-1]

The segments are sent on both test-case resolution (POST /v1/test-cases, which find-or-creates the suite chain) and result submission (POST /v1/runs/:id/results, which stamps suite_id when still unset). Manual re-parenting in the UI is never overwritten.

CI metadata

Auto-detected for GitHub Actions, GitLab CI, CircleCI, Jenkins, and Azure DevOps, plus a generic CI=true fallback. Populates the ci_* columns on the run so the dashboard can deep-link to commits and PRs.

Download files

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

Source Distribution

pytest_devant_cloud-0.5.0.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

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

pytest_devant_cloud-0.5.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest_devant_cloud-0.5.0.tar.gz.

File metadata

  • Download URL: pytest_devant_cloud-0.5.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pytest_devant_cloud-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b33fc1067a67396e93bcadd6935f89a030dc294495e2cbf25891aeecbb7d6338
MD5 7495049cffa7a5a7fd55397cd78fdfd8
BLAKE2b-256 6f6906a262bd8d47ad648e44b81d6e49f40908e933852b04134f9dea537481c4

See more details on using hashes here.

File details

Details for the file pytest_devant_cloud-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pytest_devant_cloud-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for pytest_devant_cloud-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 13835620dbda2a65f78196402a2928be8270250521ed2acc0cb2fb4e79933ebe
MD5 84ccc02fa7472eeb8875f5c75a8f2cc6
BLAKE2b-256 90583e982d92c3d06883de6a08f8113410b2a21645a69a3c94a2cdc3f9dca99a

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 Sentry Error logging StatusPage Status page