Skip to main content

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

Project description

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

pip install plaintest

Or with uv:

uv add plaintest

Quick Start

  1. Initialize your test cases directory:
plaintest init
  1. Create a test case:
plaintest add "User login functionality"

This creates a Markdown file like test-cases/001/case.md:

---
title: User login functionality
tags: []
---

## Steps


## Expected

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

  1. Link a pytest test to the test case:
import pytest

@pytest.mark.tc("001")
def test_user_login():
    # Your test implementation
    assert True
  1. Generate a coverage report:
plaintest coverage

Configuration

Add configuration to your pyproject.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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plaintest-0.2.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plaintest-0.2.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file plaintest-0.2.0.tar.gz.

File metadata

  • Download URL: plaintest-0.2.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plaintest-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f42edb1d5e5c9e95042343b07d021402494e225626bd9d8595fd5c337872214d
MD5 ec86bf5fe593b20236ba406fd6d87ee1
BLAKE2b-256 7298a214d7b495fc3730ffef98c11085f37a189f90ef299beaaeaf0ff486cfc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for plaintest-0.2.0.tar.gz:

Publisher: python-publish.yml on ericgazoni/plaintest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file plaintest-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: plaintest-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for plaintest-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d8e9813c4d52336e3505f40034bf105d9072b653b486c2149c43e2e802d005b9
MD5 7dd31835463b45d58e8b8e301cad63e3
BLAKE2b-256 64f45c1e66b2288bd9a3579b41e2b8bdd7ac10bc63c6644540bf45945df46d0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for plaintest-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on ericgazoni/plaintest

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page