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.0.tar.gz (8.4 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.0-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spec_test-0.1.0.tar.gz
  • Upload date:
  • Size: 8.4 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.0.tar.gz
Algorithm Hash digest
SHA256 bd2a7289625362662572b536624ed7f3757e8a930c5f2e60e66f92a2f517d155
MD5 96af6f551367589bb088f43c451f5fc5
BLAKE2b-256 cd0cd181fc4ed0a49b7ed45c0fe33bc46e614a9f62caf56a52e9e35a0f474950

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spec_test-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a34333c26f0c91e3f095ad9b8beaa98e7e19f296d6f5fdfccb778cd9e20c4321
MD5 4cdafe3e0e4eac2e314d3111c19423d8
BLAKE2b-256 6994d098d29bbf439e7e24696993d9b106496884a930a1efba67ff0ebd6f5f5e

See more details on using hashes here.

Provenance

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