Skip to content

7. Diagnose a failing case

Continue from 6. Choose audit report contents. Use the same xray-demo folder and activated environment.

Replace the file with this version. Only the second expected value has changed, from 3 to 99:

import pytest


@pytest.mark.xray("DEMO-1")
@pytest.mark.parametrize(
    "value, expected",
    [(1, 2), (2, 99)],
    ids=["one-plus-one", "two-plus-one"],
)
def test_add_one(value, expected):
    assert value + 1 == expected
python -m pytest -q test_example.py --xray-case-report=cases.json

Expected summary:

1 failed, 1 passed

This is an intentional failure. Pytest exits with code 1, rather than 0 for success. The report is still written. one-plus-one remains passed; two-plus-one is failed. Neither case disappears because another case has a different result.

Checkpoint: the audit report retains both input cases behind the Jira Test. This diagnostic run has not updated Jira. Restore passing inputs before the next recipe, and repeat the preview/upload workflow when you intend to update Xray.