PyTestPilot
AI-powered test case generator for Python, built with Google Gemini.
Features
- Automatically generates professional
pytest test cases using Gemini AI
- Extracts all functions from your Python file automatically
- Tests edge cases like
None, zero, negative numbers, and empty strings
- Creates a
test_yourfile.py file alongside your source file
- One-click button to run generated tests directly in the terminal
- Right-click any
.py file to generate tests instantly
Setup
- Get a free Gemini API key from aistudio.google.com
- Open VSCode Settings (
Ctrl+,)
- Search for PyTestPilot
- Paste your API key in the Gemini Api Key field
Usage
Option 1 — Command Palette
- Open a Python file
- Press
Ctrl+Shift+P
- Type
PyTestPilot: Generate Tests and hit Enter
Option 2 — Right Click
- Right-click any
.py file in the Explorer or Editor
- Select PyTestPilot: Generate Tests
Running Tests
- Open the generated
test_yourfile.py file
- Click the ▶ play button in the top right of the editor toolbar
- pytest runs automatically in the terminal
Requirements
- Python installed on your system
- pytest installed (
pip install pytest)
- A free Gemini API key from aistudio.google.com
Author
Gunveer Singh
If you find PyTestPilot useful, consider leaving a ⭐ review on the marketplace!
| |