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.2.tar.gz (65.7 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.2-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: spec_test-0.1.2.tar.gz
  • Upload date:
  • Size: 65.7 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.2.tar.gz
Algorithm Hash digest
SHA256 79242923c0f7bc621d048f1efc673a4a2eb27562be07b1c4e7bde0de5a6a9b36
MD5 6d91724a91462de1f4807e79a2c14685
BLAKE2b-256 93433002143b951a8b24b3455256476a889aaf1b91c46e87fbdf5aaa8cbc2cf3

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: spec_test-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83c24176d7b6faae65735e9083a7179c0045fec6f5a489a048845864730fc104
MD5 e9605156f9c4694e2d4eb9e1ced1612d
BLAKE2b-256 960416230c7867553d867c249fdddaf23964a891a203c03e30eebbdb7be32f5c

See more details on using hashes here.

Provenance

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