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.3.tar.gz (66.6 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.3-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spec_test-0.1.3.tar.gz
  • Upload date:
  • Size: 66.6 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.3.tar.gz
Algorithm Hash digest
SHA256 e86d3d6be1eca93987b52010d93075fdbde0da90caf3ba921cc22f6ac0485ec9
MD5 92345a4e17aa8ffb6097edb5ddb8c942
BLAKE2b-256 9ec6250b16a30950e44ed02c342d2d60242dc92903f45939d14d83d2ac665a65

See more details on using hashes here.

Provenance

The following attestation bundles were made for spec_test-0.1.3.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.3-py3-none-any.whl.

File metadata

  • Download URL: spec_test-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.7 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c76741960945f1a61dff5f120328ada62018019931b3398264e3e3072cffaf91
MD5 be022dded65025dd99a3536ee34e2ce7
BLAKE2b-256 5501d14ab4bbdca2379253db4f06ccea73c066564162ed19c559167bd28cd0f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for spec_test-0.1.3-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