Skip to main content

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 .

Download files

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

Source Distribution

pytest_llm_agent-0.1.2.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

pytest_llm_agent-0.1.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

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

Hashes for pytest_llm_agent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 911be1b08f8ad7eac2b2864dc85de982e0226c19d8dacd063a802ca143df7018
MD5 b2c30d0c540bdee6c8c3c8ec75b74c4f
BLAKE2b-256 5a4105791474a0114e80efef97900d788e5ba9493a7effc322620f4e770672d1

See more details on using hashes here.

File details

Details for the file pytest_llm_agent-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_llm_agent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1ba5199f15c093da68c0233cf241b3f35e46067fd5301acbb7044302edc91bfc
MD5 10828a40c72491592dded5385229df12
BLAKE2b-256 81b8f794a526857181ccc8257bafe96740ccce52cd2042ead38a0ad5da3eb143

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

Supported by

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