Skip to main content

Specification-driven development tool with test verification

Project description

spec-test

Specification-driven development tool that verifies your specs have passing tests.

Philosophy

Every claim about system behavior must be backed by a passing test.

  • If there's no test, the behavior is unverified
  • Specs are written first, then implementation, then tests
  • spec-test verify is the source of truth for project health

Installation

pip install spec-test
# or with uv
uv add spec-test

Quick Start

  1. Create a spec file anywhere in your project (must be spec-*.md):
# docs/specs/spec-auth.md

## Requirements
- **AUTH-001**: User can login with email and password
- **AUTH-002**: Invalid credentials return 401 error
  1. Write tests with the @spec decorator:
from spec_test import spec

@spec("AUTH-001", "User can login with email and password")
def test_user_login():
    response = client.post("/login", json={"email": "test@example.com", "password": "secret"})
    assert response.status_code == 200

@spec("AUTH-002", "Invalid credentials return 401 error")
def test_invalid_login():
    response = client.post("/login", json={"email": "test@example.com", "password": "wrong"})
    assert response.status_code == 401
  1. Verify all specs have passing tests:
spec-test verify

Commands

spec-test verify          # Verify all specs have passing tests
spec-test list-specs      # List all specs found
spec-test check AUTH-001  # Check a single spec
spec-test init            # Initialize spec-test in a project

Spec File Format

Spec files must:

  • Be named spec-*.md (e.g., spec-auth.md, spec-api.md)
  • Can be anywhere in the project (nested directories supported)
  • Use **ID**: description format for requirements
- **AUTH-001**: User can login with email and password
- **AUTH-002** [manual]: Requires manual verification

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

spec_test-0.1.4.tar.gz (68.8 kB view details)

Uploaded Source

Built Distribution

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

spec_test-0.1.4-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file spec_test-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for spec_test-0.1.4.tar.gz
Algorithm Hash digest
SHA256 8eafa850eff290f966c315a84237d06566e5e176c9ed371153146c7ef93fd97f
MD5 c55ceeda8bb385de074839d7fb01f9e0
BLAKE2b-256 07854d1d92cf2d3d68c26cf3642c3ecea41b915318190023e91761fa39ef1f57

See more details on using hashes here.

Provenance

The following attestation bundles were made for spec_test-0.1.4.tar.gz:

Publisher: publish.yml on Varuas37/spec-test

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

File details

Details for the file spec_test-0.1.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for spec_test-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 de867fb79873bb318741f14e0e2b69961f2b06e0dc92e93cb0046b08217b9816
MD5 ac21550a22f3e050b8e2efbbb425887f
BLAKE2b-256 159dd2017fe9f03ef5226da637bf22413f80213a4a46c10ab44ad8effe451231

See more details on using hashes here.

Provenance

The following attestation bundles were made for spec_test-0.1.4-py3-none-any.whl:

Publisher: publish.yml on Varuas37/spec-test

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