Add your description here
Project description
Sandhittiko: self-evident and visible test case management tool.
Overview
Sandhittiko (sndtk) is a Python test case management tool that helps you maintain test coverage by tracking test specifications in JSON files. It analyzes your Python code, identifies functions that need test coverage, and generates test specifications that can be used to guide test implementation.
Features
- Function Discovery: Automatically parses Python files and extracts function definitions (including nested functions and class methods)
- Test Specification Management: Maintains test specifications in JSON files (
*_spec.json) alongside your source code - Coverage Reporting: Reports which functions have test coverage and which scenarios are missing
- Spec Generation: Automatically creates test specifications for uncovered functions
- Smart Filtering: Filters out test files, gitignored files, and configurable patterns
Installation
# Using uv (recommended)
uv sync
# Or using pip
pip install -e .
Usage
Basic Usage
Scan the project and report test coverage:
sndtk --root .
Find First Uncovered Function
Find the first function that needs test coverage:
sndtk --root . --first
Create Test Specification
Create a test specification for the first uncovered function:
sndtk --root . --create --first
Target Specific Function
Analyze a specific function:
sndtk --root . --target path/to/file.py::function_name
sndtk --root . --target path/to/file.py::ClassName::method_name
Verbose Output
Get more detailed logging:
sndtk --root . -v # INFO level
sndtk --root . -vv # DEBUG level
Project Structure
sndtk/
├── filters/ # File filtering (gitignore, patterns, config)
├── parsers/ # Python code parsing (AST-based)
├── report/ # Test coverage reporting
└── spec/ # Test specification management
Configuration
Configure file exclusions in pyproject.toml:
[tool.sndtk]
exclude = ["*_test.py", "conftest.py"]
How It Works
- Parsing: Uses Python's AST to extract all function definitions from
.pyfiles - Specification: Test specifications are stored in
*_spec.jsonfiles containing:- Function identifiers
- Test scenarios with descriptions
- Test file paths
- Reporting: Compares parsed functions against specifications and checks if test functions exist
- Filtering: Applies multiple filters to exclude test files and other unwanted files
Test Specification Format
Test specifications are stored in JSON files (e.g., module_spec.json):
{
"filepath": "path/to/module.py",
"testpath": "path/to/module_test.py",
"functions": [
{
"identifier": "function_name",
"scenarios": [
{
"testname": "test__function_name__placeholder_scenario0",
"description": "Placeholder scenario 0..."
}
]
}
]
}
Requirements
- Python >= 3.11
- pathspec >= 0.12.1
- pydantic >= 2.12.4
- tomli >= 2.0.1
Development
Install development dependencies:
uv sync --dev
Run tests:
pytest
Run type checking:
mypy sndtk
pyright sndtk
Run linting:
ruff check sndtk
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sndtk-0.2.3.tar.gz.
File metadata
- Download URL: sndtk-0.2.3.tar.gz
- Upload date:
- Size: 51.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d18c7d15f76db7eade1d29a86a7632c204ba38a6cba8a2bab61b9f44070864c
|
|
| MD5 |
f972500a886f97aab1970da0de05418f
|
|
| BLAKE2b-256 |
7086530f7f92487c659ac4c2a4038568465dc6cfccc516d8f8e6887952a3c380
|
Provenance
The following attestation bundles were made for sndtk-0.2.3.tar.gz:
Publisher:
publish.yml on ktnyt/sndtk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sndtk-0.2.3.tar.gz -
Subject digest:
7d18c7d15f76db7eade1d29a86a7632c204ba38a6cba8a2bab61b9f44070864c - Sigstore transparency entry: 723717551
- Sigstore integration time:
-
Permalink:
ktnyt/sndtk@632a57c91aaeae7e199778ed133c344b6dfe0e2c -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/ktnyt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@632a57c91aaeae7e199778ed133c344b6dfe0e2c -
Trigger Event:
release
-
Statement type:
File details
Details for the file sndtk-0.2.3-py3-none-any.whl.
File metadata
- Download URL: sndtk-0.2.3-py3-none-any.whl
- Upload date:
- Size: 39.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5348ea917eb3bfbc283206e1711b9bd537789647958575c3e9c7c668116e79c5
|
|
| MD5 |
7a820c2ed6bddd9cbda7c68f3b024e07
|
|
| BLAKE2b-256 |
e2ec3b03a220c1d3ca5c134d47b784b906879eb3810eb5e1ac97533c1957c0a9
|
Provenance
The following attestation bundles were made for sndtk-0.2.3-py3-none-any.whl:
Publisher:
publish.yml on ktnyt/sndtk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sndtk-0.2.3-py3-none-any.whl -
Subject digest:
5348ea917eb3bfbc283206e1711b9bd537789647958575c3e9c7c668116e79c5 - Sigstore transparency entry: 723717552
- Sigstore integration time:
-
Permalink:
ktnyt/sndtk@632a57c91aaeae7e199778ed133c344b6dfe0e2c -
Branch / Tag:
refs/tags/v0.2.3 - Owner: https://github.com/ktnyt
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@632a57c91aaeae7e199778ed133c344b6dfe0e2c -
Trigger Event:
release
-
Statement type: