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. A report of more than 500 test cases (or over 5 MB) is split into parts of at most 500 (0.2.5), each a JUnit report with every case inside its own <testsuite>, sent one after another to the same project, test set and build with its own retry key (<key>-p2of10), at least 0.7 s apart; the log shows each part and a summary at the end. A failed part does not stop the others, except after a 400, 401 or 403.
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.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pytest_nexus-0.2.5.tar.gz | 20.3 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_nexus-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.4 kB
Release files / pytest_nexus-0.2.5.tar.gz
| Download URL | pytest_nexus-0.2.5.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e0de50c234c923f41f92dd86a5657b38041ee122aec2c4d2d11fb70a26a9d02
|
|
BLAKE2b-256 checksum How to use checksums |
254488c1977537a1383815a836a75c2f1734cb42a6344b37389123383d8725ce
|
| 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 11, 2026.
Transparency logRelease files / pytest_nexus-0.2.5-py3-none-any.whl
| Download URL | pytest_nexus-0.2.5-py3-none-any.whl |
|---|---|
| Size | 14.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f8e1e5a2c84c9daa5ae06470e3e5151be7b374b8d36a883059269ca7d42e424
|
|
BLAKE2b-256 checksum How to use checksums |
038658ffd10aa26c164b50a283ed17acfbb6def80530d6283b68469730b0b02e
|
| 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 11, 2026.
Transparency logSecurity for pytest-nexus 0.2.5
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.
Attestation for pytest_nexus-0.2.5.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 11, 2026.
Transparency logA 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.