Skip to main content

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

Usage

  1. Set your Anthropic API key:
    export ANTHROPIC_API_KEY=sk-ant-...
    
  2. Run the tool on your Python app:
    python-aitest-writer /path/to/your/python/app
    
    • The tool will scan all .py files, send them to Claude, and write generated tests to a tests/ directory inside your app.
  3. Run the generated tests:
    cd /path/to/your/python/app
    pytest
    

Troubleshooting

  • ModuleNotFoundError: Run pytest from your project root. The generated test files include a sys.path patch for import safety.
  • API Errors: Ensure your ANTHROPIC_API_KEY is set and valid.
  • No tests generated: Check that your app directory contains .py files and is accessible.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_aitest_writer-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_aitest_writer-0.1.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

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

Hashes for python_aitest_writer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1297db9478e6e9baf8465b64b6ddd92cd9ebd36cdee6af8eb95419877b9de8b2
MD5 3b056955f80c1a0a6072b349ed0a793b
BLAKE2b-256 a02e4e7a37a1286d05cdca9b60562022b412e4b59c91e597e8dbb88eea9d969a

See more details on using hashes here.

File details

Details for the file python_aitest_writer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for python_aitest_writer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 66ae8d3e4593c23abd8bf8adf263e5a0993d21e0cf337dbb20b8cc4fd07dc0cb
MD5 cbd66a68369495a261cb7071e00d7bd5
BLAKE2b-256 5da0aadc74ea24c95dea4a85403cfbe79a1f759ecab61453384886aed4d2a83d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page