Metadata-Version: 2.4
Name: autotestify
Version: 0.1.1
Summary: Auto-generate pytest tests for Python functions with @autotest decorator
Home-page: https://github.com/SafarovSardorDev/autotestify
Author: Sardor Safarov
Author-email: sardor.safarov200320@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-python
Dynamic: summary

# 🧪 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>.py` file
- 🐍 Pure Python, no dependencies

---

## 📦 Installation

Install from [PyPI](https://pypi.org/project/autotestify/):

```bash
pip install autotestify
```
## ⚙️ Usage
```bash
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
