Skip to main content

Adaptive test discovery for Python projects

Project description

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.json and 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 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 .

Use --no-cache for a fresh scan and --config path/to/config.json to supply overrides ad-hoc.

Python Example Project

See examples/python/ for a full pytest demo, custom configuration, and advanced signatures.

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

adaptive_tests_py-0.2.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adaptive_tests_py-0.2.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file adaptive_tests_py-0.2.0.tar.gz.

File metadata

  • Download URL: adaptive_tests_py-0.2.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for adaptive_tests_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7090c133d89f8f719f718782f357074e3741766e15f4b5d2801053743372dfcd
MD5 68521efe8ec0fafea53520b9928341e8
BLAKE2b-256 49992ec0892e9f31a861d129051accf03744d5b5565482d374970dea18c238f9

See more details on using hashes here.

File details

Details for the file adaptive_tests_py-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for adaptive_tests_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 357c334f0dfda2f9129072633e6b23159aa508d1bebf0f7b0d8c8be3d803f6b4
MD5 478c716b44dec5c1b3010e8c2277c2c9
BLAKE2b-256 2befff1e50cf4c4948947b507dc4606b7eabdb23fda3ff5c4189308b514e8a11

See more details on using hashes here.

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