LLM Agent for working with pytest
Project description
pytest-llm-agent
CLI helper to work with unit tests for your codebase.
Installation
Install from PyPI with pip:
pip install pytest-llm-agent
Configuration
You can choose model and add general default prompt
[tool.pytest-llm-agent]
model = "gpt-5"
# general_prompt = "Optional extra system prompt for the agent"
Secrets can be supplied through environment variables prefixed with PYTEST_LLM_AGENT_. For example, set PYTEST_LLM_AGENT_API_KEY in your shell and the agent will receive API_KEY in its environment at runtime.
EXPORT PYTEST_LLM_AGENT_API_KEY=foo
Usage
After configuring your project, run the CLI to generate tests for a specific function, method, or class:
pytest-llm-agent target path/to/module.py:ClassName.method tests/test_module.py
You can optionally pass additional instructions to steer generation:
pytest-llm-agent target path/to/module.py::function tests/test_module.py --prompt "Focus on edge cases"
Contribution
Very welcome. Make sure you also update tests if you add some services logic.
PYTHONPATH=. uv run pytest .
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 pytest_llm_agent-0.1.2.tar.gz.
File metadata
- Download URL: pytest_llm_agent-0.1.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
911be1b08f8ad7eac2b2864dc85de982e0226c19d8dacd063a802ca143df7018
|
|
| MD5 |
b2c30d0c540bdee6c8c3c8ec75b74c4f
|
|
| BLAKE2b-256 |
5a4105791474a0114e80efef97900d788e5ba9493a7effc322620f4e770672d1
|
File details
Details for the file pytest_llm_agent-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pytest_llm_agent-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ba5199f15c093da68c0233cf241b3f35e46067fd5301acbb7044302edc91bfc
|
|
| MD5 |
10828a40c72491592dded5385229df12
|
|
| BLAKE2b-256 |
81b8f794a526857181ccc8257bafe96740ccce52cd2042ead38a0ad5da3eb143
|