Skip to main content

pytest-devant-cloud

PyPI version Python versions License

pytest plugin that streams runs, results, and per-test step trees into Devant.net while your suite runs.

Requirements

Python 3.10 or newer, and pytest 7 or newer.

Quick start

Install the plugin:

pip install pytest-devant-cloud

Point it at your project. Copy the token and project id from your Devant CI/CD settings:

export DEVANT_API_URL=https://acme.devant.net
export DEVANT_TOKEN=your-ci-token
export DEVANT_PROJECT_ID=42

Run pytest as you normally would:

pytest

Results show up in Devant while the suite is still running. There is nothing to add to conftest.py; the plugin registers itself through pytest's pytest11 entry-point group.

Configuration

Configure with environment variables:

Variable Default Notes
DEVANT_API_URL http://localhost:32124 Your tenant URL. The default targets a local dev instance.
DEVANT_TOKEN dev-admin-token Bearer token from your CI/CD settings.
DEVANT_PROJECT_ID 1 The Devant project to report into.
DEVANT_RUN_NAME pytest — <ISO date> Name shown on the run.
DEVANT_RUN_ID (unset) Attach to an existing run instead of creating one.

The same settings work as CLI flags, which win over the environment:

pytest \
  --devant-api-url=https://acme.devant.net \
  --devant-token=$DEVANT_TOKEN \
  --devant-project-id=42

Turn the plugin off for a single run without uninstalling it:

pytest -p no:devant_cloud

Binding tests to cases

Each test maps to one case in Devant. The plugin chooses the case in this order:

  1. The @pytest.mark.devant("DEF-AB12") marker on the test, if present.
  2. An existing case whose name matches the test.
  3. A new case, created on the spot, with a key like DEF-XYZ9.

An auto-created case is tied to the test's name and its place in the suite tree, so renaming or moving the test starts a fresh case. To keep a test's history across renames, copy its key from your Devant dashboard and pin it in source:

@pytest.mark.devant("DEF-XYZ9")
def test_login(): ...

Suites

The plugin turns each test's location into a nested suite tree, built from the directories, module, and class around it. The leaf is the test function plus any parametrize id.

Test Suite path 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]

If you re-parent a suite by hand in the dashboard, the plugin leaves your change alone on later runs.

CI metadata

On GitHub Actions, GitLab CI, CircleCI, Jenkins, and Azure DevOps (or any runner that sets CI=true), the plugin attaches the commit, branch, and pull request to each run, so Devant can link a run back to the code that triggered it.

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.6.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.6.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pytest_devant_cloud-0.6.0.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for pytest_devant_cloud-0.6.0.tar.gz
Algorithm Hash digest
SHA256 9776495a144a8132b3ad104689d32c0ba712b749a928b97add1aa3fadca73c24
MD5 a22fa7aeb028d08594600c06be40f0a6
BLAKE2b-256 882b81ebfe7bc76d996d2e140e4aa82a027bec4e06bff86fbb8c54503e59b926

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pytest_devant_cloud-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8b8e1c839ebfd9a8edad19bfc4889537a63ee613ffe099ae1e5b72174f6c15e2
MD5 eba71c9b425522312abe002f43b4e28d
BLAKE2b-256 d91b5f2c610cd257d2d4e152cbdc3f63880a3e8218ebaee706a44894b79bdfda

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