Metadata-Version: 2.4
Name: plaintest
Version: 0.2.0
Summary: A pytest plugin and CLI tool for managing plain-text test cases with markdown documentation
Author-email: Eric Gazoni <eric@adimian.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ericgazoni/plaintest
Project-URL: Documentation, https://plaintest.readthedocs.io/
Project-URL: Repository, https://github.com/ericgazoni/plaintest
Project-URL: Issues, https://github.com/ericgazoni/plaintest/issues
Project-URL: Changelog, https://github.com/ericgazoni/plaintest/releases
Requires-Python: >=3.13
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: black>=26.1.0
Requires-Dist: click>=8.3.1
Requires-Dist: jinja2>=3.1.6
Requires-Dist: markdown>=3.10.1
Requires-Dist: pygments>=2.19.2
Requires-Dist: python-frontmatter>=1.1.0
Requires-Dist: rich>=13.0.0
Dynamic: license-file

# plaintest

A pytest plugin and CLI tool for managing plain-text test cases with Markdown documentation.

## Overview

`plaintest` helps you bridge the gap between human-readable test case documentation and automated tests. 
Write your test cases in simple Markdown files, link them to pytest tests using decorators, 
and generate HTML reports showing test coverage and results.

## Rationale
Many teams struggle with test documentation scattered across multiple systems: 
requirements in Jira, test cases in TestRail, implementation details in code comments. 
This fragmentation makes it hard to understand what's being tested and why. 
By keeping test cases as Markdown files in your repository alongside your code, 
you maintain a single source of truth that's version-controlled, code-review friendly, 
and easily accessible to both humans and LLMs. 

Changes to test specifications go through the same PR process as code changes, ensuring consistency and traceability.

## Installation

```bash
pip install plaintest
```

Or with uv:
```bash
uv add plaintest
```

## Quick Start

1. **Initialize your test cases directory**:
```bash
plaintest init
```

2. **Create a test case**:
```bash
plaintest add "User login functionality"
```

This creates a Markdown file like `test-cases/001/case.md`:
```markdown
---
title: User login functionality
tags: []
---

## Steps


## Expected

```

   *Tip: Create a `.template` file in your test cases directory to customize the template using Jinja2 syntax.*

3. **Link a pytest test to the test case**:
```python
import pytest

@pytest.mark.tc("001")
def test_user_login():
    # Your test implementation
    assert True
```

4. **Generate a coverage report**:
```bash
plaintest coverage
```

## Configuration

Add configuration to your `pyproject.toml`:

```toml
[tool.plaintest]
test_cases_dir = "test-cases"
```

## Commands

- `plaintest init` - Initialize test cases directory
- `plaintest add [TITLE]` - Interactively add new test case(s)
- `plaintest coverage` - Generate terminal-based coverage report
- `plaintest report` - Generate side-by-side HTML report

## License

MIT

