🧪 autotestify
autotestify is a lightweight Python CLI tool that automatically generates pytest test functions for any function decorated with @autotest.
Save time. Avoid boilerplate. Focus on your logic — we'll write the tests.
🚀 Features
- 🔍 Detects only functions decorated with
@autotest - 🧠 Adds sensible dummy values for parameters
- 🛠 Generates test stubs using
pytest - ⚡ Instantly creates a
test_<filename>.pyfile - 🐍 Pure Python, no dependencies
📦 Installation
Install from PyPI:
pip install autotestify
⚙️ Usage
autotestify your_file.py
This will generate a new file named test_your_file.py in the same directory.
✅ Example
Original file: calculator.py
from autotestify import autotest
def add(a, b):
return a + b
@autotest
def greet(name):
return f"Hello, {name}"
Generated: test_calculator.py
import pytest
from calculator import *
def test_greet():
result = greet("example")
assert result is not None
📌 @autotest Decorator
This is a no-op decorator used for marking which functions should be tested automatically.
from autotestify import autotest
@autotest
def my_function(...):
...
Functions without @autotest will be ignored.
🧩 How It Works
Parses your Python file using the ast module
Identifies functions with @autotest
Analyzes their arguments and generates dummy values
Writes pytest test functions with assert result is not None
🛠 Requirements
Python 3.7+
pytest (to run the tests, not required to generate)
📄 License
MIT © 2025 Sardor Safarov
Metadata
Release files for autotestify 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| autotestify-0.1.1.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| autotestify-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.5 kB
Release files / autotestify-0.1.1.tar.gz
| Download URL | autotestify-0.1.1.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
188c4149482bf32adc2f213f5e0e9f090ccc2de919595fd929e2bb1690115c0a
|
|
BLAKE2b-256 checksum How to use checksums |
88ca5f86ff5ae910e4c6bab7f84cfe3646d6ed63b99ed7ae722db1efc9da3207
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|
Release files / autotestify-0.1.1-py3-none-any.whl
| Download URL | autotestify-0.1.1-py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b02174e841800bacbc7391e27da9e7382f926c52d72f335a44755149ff9d85b1
|
|
BLAKE2b-256 checksum How to use checksums |
075ede619a8227f69112bbf593d33729179782d9791953c351c0e20d9c5341cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.4
|