Skip to main content

pytest-nexus

A pytest plugin that sends each run's results to Nexus for Jira. When the session ends it posts the JUnit XML report to your project's Nexus results URL, where each test is matched to a Test Case by its Automation Key.

Standard library only (plus pytest 7 or later). Python 3.8+.

Install

From PyPI:

pip install pytest-nexus

The same wheel and source archive are also on nexus.resync.nz/integrations, with checksums in SHA256SUMS.txt.

The plugin loads automatically. It does nothing until a Nexus URL is configured.

Configure

In Jira, open Project Settings → Nexus → CI, create an API key with the ingest scope and copy the results URL. Store both as CI secrets:

Environment variable CLI option Meaning
NEXUS_URL --nexus-url Results URL (required)
NEXUS_API_KEY --nexus-api-key API key (required; prefer the env var)
NEXUS_PROJECT --nexus-project Jira project key, e.g. NEX (required)
NEXUS_ENVIRONMENT --nexus-environment Environment label, e.g. staging
NEXUS_TEST_SET --nexus-test-set Test Set (cycle) to record into, e.g. NEX-25
NEXUS_BUILD --nexus-build Build id. Default: the CI system's build number
NEXUS_COMMIT --nexus-commit Commit. Default: the CI system's commit SHA
NEXUS_COMPONENT --nexus-component Component label, e.g. api
NEXUS_BUILD_URL --nexus-build-url CI job page (https), shown on each run as "Open CI job". Default: the CI system's own job page (0.2.3)
NEXUS_IDEMPOTENCY_KEY --nexus-idempotency-key Retry key, 16-128 of A-Z a-z 0-9 . _ : -. Default: a new random key per run (0.2.3)

Other options:

  • --nexus-fail-on-upload-error: fail the pytest run (exit code 1) when the upload fails. By default an upload problem only prints a warning and the exit code is whatever your tests produced.
  • --no-nexus: turn the plugin off for one run.

Build, commit and the CI job page are filled automatically on GitHub Actions, GitLab, Azure Pipelines, Bitbucket Pipelines and Jenkins (the job page also on CircleCI). A job page that is not https is never sent.

Name your tests with the Automation Key

Put the Test Case's Automation Key in the test name. Python names cannot contain -, so use _; Nexus reads NEX_11 as NEX-11:

def test_NEX_11_valid_user_signs_in(driver):
    ...

Results whose name carries no known key are listed as unmatched in the delivery log.

Example

export NEXUS_URL=...        # from your CI secret store
export NEXUS_API_KEY=...
pytest --nexus-project NEX --nexus-environment staging

If you already pass --junitxml=path.xml, that file is the one sent. Otherwise the plugin writes a temporary report and removes it afterwards. With pytest-xdist, only the controller sends.

Output at the end of the run:

nexus: sent results to project NEX at <your-site>.atlassian-dev.net (HTTP 202). See Project Settings > CI for the delivery log.

Nexus answers 202 with {"status":"accepted"} only after it has processed every result of the report (SEC27-H9, 28/09/2026: nothing is left running in the background behind an "accepted"); the per-test outcome (matched, unmatched, skipped) is in the delivery log on the CI page. A {"status":"partial"} answer means Nexus holds the report and what it recorded so far and finishes the rest itself; the reporter sends it again to confirm. The API key is never printed. Reports over 5 MB or 500 results must be split. A report that reaches Nexus's time limit part-way (a 202 whose body says "partial", or a 500), a 502/503/504 or a network error is sent again, up to 8 sends, until Nexus has recorded all of it; a resend never records a result twice (0.2.0, 27/09/2026). Since 0.2.3 every send of one report carries the same Idempotency-Key header, so Nexus treats a late resend as the same delivery, never as a new run.

Develop

python -m pytest        # from this folder; uses a local fake Nexus, no network

Licence

MIT. © 2026 Resync Consulting Limited. See LICENSE.

Metadata

Release files for pytest-nexus 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-nexus 0.2.4
File Size Uploaded Provenance
pytest_nexus-0.2.4.tar.gz 15.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-nexus 0.2.4
File Interpreter ABI Platform
pytest_nexus-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / pytest_nexus-0.2.4.tar.gz

Download URL pytest_nexus-0.2.4.tar.gz
Size 15.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3dd6d872be3921033086e5cde40f07601acdbaa165169dbf5498e93009729220
BLAKE2b-256 checksum
How to use checksums
bce95fe07923de90e4e78ab9316012220ee95186778f8c0f6559762857a481ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Release files / pytest_nexus-0.2.4-py3-none-any.whl

Download URL pytest_nexus-0.2.4-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa412e7836b65d81786bef40b284f5aaf0c3160e95bdc3d01081f70ffcb863b9
BLAKE2b-256 checksum
How to use checksums
b37f39151d271234ea9ee4b88eee09efacdf5f883789290d11a625da7f1902fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

Security for pytest-nexus 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pytest_nexus-0.2.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page