Catalog PyPI
Back to packageRELEASE DETAILS

0.2.5

PyPI

adaptive-tests-py

Adaptive test discovery for Python projects

Published20 Sept 2025
Direct dependencies2
Transitive dependenciesNot calculated

README

Version 0.2.5 documentation

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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 2

Native requirements
2 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest>=7.4; extra == "test"runtime
pytest-cov
Environment
{
  "extras": "",
  "marker": "extra == \"test\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest-cov>=4.1; extra == "test"runtime

Distribution files

2 collected
adaptive_tests_py-0.2.5-py3-none-any.whl

bdist_wheel · 17.96 KB · Python py3

Source file
adaptive-tests-py-0.2.5.tar.gz

sdist · 18.11 KB · Python source

Source file

Repository

PENDING
anon57396/adaptive-tests

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:c79ed89ea336594cd5f9ffd1176f003b4740f100573fdcbb1a59fa4e8253608b

Other collected versions

View all collected versions →