Skip to main content

autopytest

PyPI version Python versions Build Status Maintainability Codacy Badge Test Coverage

An implementation of autotest for Python inspired by autotest and guard.

autopytest observes file change events and whenever you save a file it runs the appropriate tests with pytest.

Features

autopytest observes file modified events and will perform the following:

  • source files
    • will find and run the associated individual test file
    • upon success, will run the entire suite
    • if we can't find a matching test, run the entire suite
  • test files
    • will run that test file
    • upon success, will run the entire suite

Install

# pip
pip install autopytest

# poetry
poetry add autopytest

Configuration

In your pyproject.toml add the following.

[tool.autopytest]
source_directories = ["app"]
test_directory = "tests"

Usage

cd {project}
autopytest

autopytest {path}

Project Structure

  • Test naming is currently important.
  • Multiple nested directory structures are supported as long as the convention is followed.

Applications

pyproject.toml for applications

[tool.autopytest]
source_directories = ["app", "lib"]
test_directory = "tests"

Given the above configuration. You should use a directory structure like the following. e.g. If app/package/module.py is edited we will attempt to locate and run tests/app/package/test_module.py

📁 app
    📄 __init__.py
    📁 package
        📄 __init__.py
        📄 module.py
📁 lib
📁 tests
    📄 __init__.py
    📁 app
        📁 package
            📄 test_module.py
    📁 lib

Libraries

pyproject.toml for libraries

[tool.autopytest]
include_source_dir_in_test_path = false
source_directories = ["src"]
test_directory = "tests"

If you are developing library and want your folder structure like the following. e.g. If src/package/module.py is edited we will attempt to locate and run tests/package/test_module.py

📁 src
    📁 package
        📄 __init__.py
        📄 module.py
📁 tests
    📁 package
        📄 test_module.py

Metadata

Release files for autopytest 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autopytest 0.0.10
File Size Uploaded Provenance Actions
autopytest-0.0.10.tar.gz 11.9 kB Without provenance Details for autopytest-0.0.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for autopytest 0.0.10
File Interpreter ABI Platform Actions
autopytest-0.0.10-py3-none-any.whl Python 3 none any Details for autopytest-0.0.10-py3-none-any.whl

Total release size: 20.5 kB

Release files / autopytest-0.0.10.tar.gz

Download URL autopytest-0.0.10.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f6f66d6ac85cd8d92e4ad7e76cf89acec124ba50041b8b900acbc8e817bc75a8
BLAKE2b-256 checksum
How to use checksums
8e6da467b868db28830944cbfd967f0084c0d72eed3b13c6973d83a66c67c06c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / autopytest-0.0.10-py3-none-any.whl

Download URL autopytest-0.0.10-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b657cf224c5f48b80fd5d60457557bc3a7358c6cee3bc1a010ba4915b74c4030
BLAKE2b-256 checksum
How to use checksums
5b48387af9003266186fc7bf5fe8fb74cced5e97cd69daa2eb32e5bb2ef20779
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Security for autopytest 0.0.10

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page