adaptive-tests-py
Python port of the adaptive discovery engine. It mirrors the JavaScript API so polyglot teams can keep their testing strategy consistent across stacks while preserving the zero-runtime guarantees of static analysis.
Installation
pip install adaptive-tests-py
Usage
from adaptive_tests_py import DiscoveryEngine, Signature
engine = DiscoveryEngine(root=".")
result = engine.discover(
Signature(name="TodoService", methods=["add", "complete", "list"]),
load=False,
)
print(result.module, result.methods)
TodoService = result.load() # module imported on demand
service = TodoService()
service.add("Ship adaptive tests")
Use engine.discover_all(signature) to inspect every ranked match when tuning signatures or debugging coverage. The engine now mirrors the JavaScript implementation more closely:
- Configurable scoring – drop an
adaptive-tests.config.json(or pass inline overrides) to tweak path/file/method weighting. - Persistent cache – results are stored in
.adaptive-tests-cache.jsonand re-used on future runs when the target file is unchanged. - Lens explanations – call
engine.explain(signature)to retrieve top candidates with per-factor score breakdowns.
CLI
The package ships with a lightweight CLI so you can run discovery diagnostics and scaffold pytest stubs without writing code:
adaptive-tests-py why '{"name": "TodoService"}' --root examples/python/src --limit 3
adaptive-tests-py why signature.json --json
adaptive-tests-py discover '{"name": "TodoService"}' --root .
adaptive-tests-py scaffold src/services/user_service.py --tests-dir tests/adaptive
Use --no-cache for a fresh scan and --config path/to/config.json to supply overrides ad-hoc.
Configuration can also be placed in pyproject.toml under the [tool.adaptive_tests] table to match modern Python tooling conventions.
Python Example Project
See examples/python/ for a full pytest demo, custom configuration, and advanced signatures.
Metadata
Release files for adaptive-tests-py 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| adaptive-tests-py-0.2.5.tar.gz | 18.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| adaptive_tests_py-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.9 kB
Release files / adaptive-tests-py-0.2.5.tar.gz
| Download URL | adaptive-tests-py-0.2.5.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f09a2ab69cd56a62266f28cfd0ba7e43925bbd413c5dde9a8509de0b7c953c70
|
|
BLAKE2b-256 checksum How to use checksums |
247232fca7a7763b9fb51d8418f25416b3ab80146530de5b8833f674c05f74fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / adaptive_tests_py-0.2.5-py3-none-any.whl
| Download URL | adaptive_tests_py-0.2.5-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bcd04cec96d66731230a8202b213e2175a7748ad5d47e5df804dccc237042ea8
|
|
BLAKE2b-256 checksum How to use checksums |
a407d515acd9c2e4de8671fb0b353b0819021a7b746de014f57e028e0ece5184
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for adaptive-tests-py 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.