Start a project with uv (recommended)¶
For a new project, we recommend uv to manage Python dependencies and run pytest in the project's environment. pip and venv remain fully supported: use the pip/venv guide if you prefer them. No uv installation is needed to use the plugin with pip.
Install uv using Astral's official installation instructions
for your operating system, then check uv --version. This guide uses the
official project workflow.
The plugin requires Python 3.12 or newer and pytest 9.1.1–9.x. The commands
below choose Python 3.12; uv may download it if it is not already installed.
Dependency installation needs network access. The case-plan command makes no Jira
requests and needs no credentials; it is not an Xray import payload.
Create the project and add test dependencies¶
The guide is verified against published 1.0.0. uv add records development
dependencies in pyproject.toml, resolves them in uv.lock, and creates the local
.venv environment. Commit pyproject.toml and uv.lock to share dependency
choices; do not commit .venv. uv run uses and synchronizes this environment,
so activation is unnecessary. Review dependency changes before updating the lock.
For an existing project with pyproject.toml, skip uv init and work in its root.
Confirm its requires-python is compatible with Python 3.12+ before adding the
dependencies. Do not install upstream pytest-jira-xray alongside this fork:
both provide pytest_xray and the xray plugin entry point. Use a clean environment
if both were installed. No repository checkout is needed.
Run two separate cases offline¶
Save test_example.py in the project root:
import pytest
@pytest.mark.parametrize('value, expected', [(1, 2), (2, 3)], ids=['one-plus-one', 'two-plus-one'])
def test_add_one(value, expected):
assert value + 1 == expected
Expect 2 passed. Explicit stable IDs distinguish the cases; do not put secrets
in IDs or share a Jira key between cases. Identity also includes the logical test
and parameter structure: see identity rules.
Save this synthetic case-config.json beside the test:
{
"project": "DEMO",
"namespace": "example-suite",
"test_issue_type": "100",
"execution_issue_type": "101",
"test_type_field": "customfield_10",
"definition_field": "customfield_11",
"extra_fields": {}
}
Expect two different opaque identities, independent PASS results, and proposed Generic Test creation fields. The plan has no Test keys and cannot be uploaded. Repeating the command preserves identities; no issue is created. Configured field IDs are placeholders, not validated server settings. Hashes are not encryption, and user-supplied extra fields may contain sensitive information.
To inspect only one case:
Expect 1 passed, 1 deselected and one identity from the full plan. Changing the
second expected value to 99 yields exit 1 and separate PASS/FAIL plan entries;
keep the explicit IDs unchanged for the same logical cases.
Continue with the shared integration guide¶
Read prerequisites,
configuration and planning, and
explicit creation and import. In those commands, replace
python -m pytest with uv run pytest, and python -m json.tool with
uv run python -m json.tool. Continue in this project; do not create another venv.
For optional parallel/retry recipes, first run
uv add --dev pytest-xdist pytest-rerunfailures.
--jira-xray can publish online when configured. Creation requires separate
explicit permission and the authoritative map/single-writer safeguards. Do not
add it to the offline plan command. Jira plus Xray Generic Tests are required for
the integration; exact live Xray 8.5.3-j10 behavior remains unverified. The uv guide
does not change authentication, privacy defaults or server compatibility.
If uv is not found, follow Astral's installation/PATH instructions. If dependency
resolution fails, inspect the project's Python requirement and package constraints;
do not disable TLS verification. uv run pytest --help should list the Xray options.
See plugin troubleshooting for other failures.