Metadata-Version: 2.4
Name: allure-pytest-auto
Version: 1.0.1
Summary: Pytest plugin generating timestamped Allure reports, automating environment.properties, and auto-opening reports locally. CI/CD-ready, no more overwrites.
License: MIT
Project-URL: Homepage, https://github.com/sjvaidya/allure-pytest-auto
Project-URL: Repository, https://github.com/sjvaidya/allure-pytest-auto
Project-URL: Issues, https://github.com/sjvaidya/allure-pytest-auto/issues
Project-URL: Changelog, https://github.com/sjvaidya/allure-pytest-auto/blob/main/CHANGELOG.md
Keywords: pytest,pytest-plugin,allure,allure-pytest,allure-pytest-auto,allure-report,test-reporting,automation-testing,qa-automation,ci-cd
Classifier: Framework :: Pytest
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytest>=7.0
Requires-Dist: allure-pytest>=2.13
Dynamic: license-file

# allure-pytest-auto

**Timestamped Allure reports, automatic `environment.properties` copy-paste, and auto-open — zero boilerplate, works locally and in CI/CD.**

[![PyPI version](https://img.shields.io/pypi/v/allure-pytest-auto)](https://pypi.org/project/allure-pytest-auto/)
[![Python versions](https://img.shields.io/pypi/pyversions/allure-pytest-auto)](https://pypi.org/project/allure-pytest-auto/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/sjvaidya/allure-pytest-auto/blob/main/LICENSE)
[![Tests](https://github.com/sjvaidya/allure-pytest-auto/actions/workflows/ci.yml/badge.svg)](https://github.com/sjvaidya/allure-pytest-auto/actions/workflows/ci.yml)

**Status:** Feature-complete and actively maintained — bug reports and pytest/Allure compatibility issues are addressed promptly. See [issues](https://github.com/sjvaidya/allure-pytest-auto/issues).

---

## The problem

Allure reports overwrite the previous run by default — no history to fall back on. In addition you are stuck repeating 3 manual steps every run: hand-copying an `environment.properties` file into the results directory, running `allure generate`, and running `allure open` yourself just to see the result.

## The fix

`allure-pytest-auto` generates timestamped reports for each run locally (fixed path in CI/CD) — no wrapper scripts needed. It also handles the remaining manual steps automatically: `environment.properties` generated from config with no copy-pasting, and the report opened for you.

---

## ✨ Features

- ✅ Timestamped reports — no overwrites, full run history
- ✅ Automatic `environment.properties` from config — no manual copy-pasting
- ✅ Optional auto-open
- ✅ Same behavior locally and in CI/CD
- ✅ Zero boilerplate

## 📸 See it in action

**Without allure-pytest-auto** — 3 manual steps after every run: copying `environment.properties` in by hand, running `allure generate`, and running `allure open` yourself - with the report overwritten on every subsequent run:

![Without allure-pytest-auto](https://raw.githubusercontent.com/sjvaidya/allure-pytest-auto/refs/heads/main/screenshots/before.gif)

**With allure-pytest-auto** — just run your tests as usual: a fresh timestamped folder every time, `environment.properties` generated from your config, report opened for you, all handled automatically. In CI/CD, the same automation applies, just with a fixed path instead of a timestamped one.

![With allure-pytest-auto](https://raw.githubusercontent.com/sjvaidya/allure-pytest-auto/refs/heads/main/screenshots/after.gif)

---

## ⚙️ Requirements

**System**
- Python >= 3.8
- Allure CLI >= 2.24.0

**Python dependencies** (installed automatically)
- pytest >= 7.0
- allure-pytest >= 2.13


## 📥 Installation

```bash
pip install allure-pytest-auto
```

---

## 🚀 Quick Start

**1.** Create a config file `allure_pytest_auto.toml` at your project root (see [Configuration](https://github.com/sjvaidya/allure-pytest-auto/blob/main/allure_pytest_auto.toml)).

**2.** Run pytest with both flags:

```bash
pytest --alluredir=allure-results --allure-pytest-auto-config=allure_pytest_auto.toml
```

---

## ⚙️ Configuration

Recommended location: project root.

**`allure_pytest_auto.toml`**

```toml
# Full path to Allure CLI. If "allure" is in your PATH, just use "allure" (recommended for CI/CD).
# Defaults to "allure" if not set.
allure_cli_path = "allure"

# Base directory for timestamped allure reports.
# Defaults to "allure-report" if not set.
allure_report_dir = "allure-report"

# Title shown in the generated Allure report.
# Defaults to "Allure Report" if not set or empty.
report_title = "allure-pytest-auto demo"

# Open the report automatically after a local run (ignored in CI/CD).
open_report_by_default = true

# Written to environment.properties in the report.
[environment]
ENV = "dev"
BUILD = "223"
DESCRIPTION = "Unit tests"
```

| Config | Description | Default |
|---|---|---|
| `allure_cli_path` | Full path to the Allure CLI (e.g. `/opt/allure/bin/allure` or `C:/Allure/bin/allure.bat`). Use `"allure"` if it's on your PATH, or for CI/CD. | `allure` |
| `allure_report_dir` | Base directory in which timestamped report folders are created. | `allure-report` |
| `report_title` | Title shown in the generated report. | `Allure Report` |
| `open_report_by_default` | Auto-opens the report after a local run if `true` (ignored in CI/CD). | `True` |
| `[environment]` | Key/value pairs written to `environment.properties`. | N/A |

---

## 🧩 CLI Options

| Flag | Description |
|---|---|
| `--alluredir` | Allure results directory (required) |
| `--allure-pytest-auto-config` | Path to your `allure_pytest_auto.toml` config file (required) |

---

## ❓ FAQ

See [FAQ.md](https://github.com/sjvaidya/allure-pytest-auto/blob/main/FAQ.md) for common questions.

## 🤝 Contributing

Contributions, bug reports, and feature requests are welcome — see [CONTRIBUTING.md](https://github.com/sjvaidya/allure-pytest-auto/blob/main/CONTRIBUTING.md) to get started.

## 📜 License

MIT — see [LICENSE](https://github.com/sjvaidya/allure-pytest-auto/blob/main/LICENSE).

## ✉️ Contact

- GitHub: [@sjvaidya](https://github.com/sjvaidya)
- Issues & feature requests: [open an issue](https://github.com/sjvaidya/allure-pytest-auto/issues)

---

If this plugin saved you a wiped-out report, a manually copy-pasted environment.properties, or one too many `allure open` commands, a ⭐ on the repo helps other people find it.
