Generate pytest test cases for your Python app using Claude AI
Project description
python_aitest_writer
Generate comprehensive pytest test cases for your Python application using Claude AI.
Features
- Automatically generates pytest-style test cases for your Python codebase
- Uses Claude AI for high-quality, context-aware test generation
- Writes tests to a
tests/directory in your project - CLI tool for easy integration into your workflow
Installation
pip install python_aitest_writer
Requirements
- Python 3.7+
- Anthropic Claude API key
- Internet connection (for API calls)
Usage
- Set your Anthropic API key:
export ANTHROPIC_API_KEY=sk-ant-...
- Run the tool on your Python app:
python-aitest-writer /path/to/your/python/app- The tool will scan all
.pyfiles, send them to Claude, and write generated tests to atests/directory inside your app.
- The tool will scan all
- Run the generated tests:
cd /path/to/your/python/app pytest
Troubleshooting
- ModuleNotFoundError: Run
pytestfrom your project root. The generated test files include asys.pathpatch for import safety. - API Errors: Ensure your
ANTHROPIC_API_KEYis set and valid. - No tests generated: Check that your app directory contains
.pyfiles and is accessible.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_aitest_writer-0.1.0.tar.gz.
File metadata
- Download URL: python_aitest_writer-0.1.0.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1297db9478e6e9baf8465b64b6ddd92cd9ebd36cdee6af8eb95419877b9de8b2
|
|
| MD5 |
3b056955f80c1a0a6072b349ed0a793b
|
|
| BLAKE2b-256 |
a02e4e7a37a1286d05cdca9b60562022b412e4b59c91e597e8dbb88eea9d969a
|
File details
Details for the file python_aitest_writer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_aitest_writer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66ae8d3e4593c23abd8bf8adf263e5a0993d21e0cf337dbb20b8cc4fd07dc0cb
|
|
| MD5 |
cbd66a68369495a261cb7071e00d7bd5
|
|
| BLAKE2b-256 |
5da0aadc74ea24c95dea4a85403cfbe79a1f759ecab61453384886aed4d2a83d
|