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 .
Metadata
Release files for pytest-llm-agent 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pytest_llm_agent-0.1.2.tar.gz | 13.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pytest_llm_agent-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.4 kB
Release files / pytest_llm_agent-0.1.2.tar.gz
| Download URL | pytest_llm_agent-0.1.2.tar.gz |
|---|---|
| Size | 13.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
911be1b08f8ad7eac2b2864dc85de982e0226c19d8dacd063a802ca143df7018
|
|
BLAKE2b-256 checksum How to use checksums |
5a4105791474a0114e80efef97900d788e5ba9493a7effc322620f4e770672d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|
Release files / pytest_llm_agent-0.1.2-py3-none-any.whl
| Download URL | pytest_llm_agent-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ba5199f15c093da68c0233cf241b3f35e46067fd5301acbb7044302edc91bfc
|
|
BLAKE2b-256 checksum How to use checksums |
81b8f794a526857181ccc8257bafe96740ccce52cd2042ead38a0ad5da3eb143
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.14
|