Metadata-Version: 2.5
Name: tracera-pytest
Version: 1.1.1
Summary: Tracera Autotest adapter for pytest
Project-URL: Homepage, https://tracera.dev/docs/pytest
Project-URL: Changelog, https://github.com/tracera-dev/tracera-releases/releases?q=Adapters+%28Python%29
Project-URL: Bug-Tracker, https://github.com/tracera-dev/tracera-releases/issues
Author-email: Tracera <contact@tracera.dev>
License-Expression: Apache-2.0
License-File: LICENSE.md
Keywords: autotest,pytest,test-reporting,testops,tracera
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: tracera-core==1.1.1
Description-Content-Type: text/markdown

# tracera-pytest

Tracera Autotest adapter for pytest.

**Requires Python ≥ 3.11 and pytest ≥ 8.**

```bash
pip install tracera-pytest
```

How-to: [pytest](https://tracera.dev/docs/pytest). Shared env / run mode: [Autotest adapters](https://tracera.dev/docs/adapters).

## Setup

The package registers as a pytest plugin automatically (no `-p` flag).

```python
import pytest
from tracera_pytest import id as tracera_id
from tracera_pytest import tracera


@tracera_id(42, "e2e/login")
def test_login():
    tracera.step("open login", lambda: None)
```

## Bind

`@tracera.id(…)` (preferred) or `tracera.test_case`. Optional name may use `{param}` / `{param_id}` from pytest parametrize. If `name` is omitted → `item.name`.

## Skip

Stock `pytest.skip`. The reason becomes a result `comment`.

## Steps

`tracera.step(title, body)`, `@tracera.step("…")`, `with tracera.step("…"):`, or `async with tracera.step("…"):` (async `def` / awaitable bodies OK; decorator `{name}` / `{0}` from args). **Function-scoped** fixtures → **Setup** / **Teardown**; suite-level fixtures are not reported.

## Comments, errors, and attachments

`tracera.comment` / `tracera.error` / `tracera.attachment` — see [Autotest adapters](https://tracera.dev/docs/adapters).

## Parameterized

`@pytest.mark.parametrize` + `@tracera.id(id, "login as {login}")`. Retries: final attempt only; `PYTEST_RETRY` on Env when retry > 0.
