testing

A project-specific guide for automated tests, which are checks that verify code behaves as expected. It explains the pytest test layout, common commands, provider test patterns, and the difference between unit tests and integration tests.

In plain words
What is it for?
Use it to run all or selected tests, add tests for CLI and configuration changes, test provider behavior, and debug failing unit or integration tests.
Why use it?
It helps you find the right tests and run them in the right way instead of searching through a large test suite. It also shows how to investigate failures and test integrations with external AI providers.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/thomwebb/gac/testing
Any agent
npx skills add thomwebb/gac --skill testing
Clone the repo
git clone --depth 1 https://github.com/thomwebb/gac

Made for: Claude Code, Codex.

Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,040 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.01040
Opus 5 $0.00017 $0.00520
Sonnet 5 $0.00007 $0.00208
Haiku 4.5 $0.00003 $0.00104

Measured 2d ago against content hash bccb4f5ec4c2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

testing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.skills/testing/SKILL.md · 146 lines

How it starts

The opening of the file, as written. The whole thing — 146 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Workflows

When to Use

  • Running tests (entire suite or specific tests)
  • Writing new tests or modifying existing ones
  • Debugging test failures
  • Understanding provider test patterns

Test Structure

The suite has 151 test files mirroring src/. Key areas:

tests/
  conftest.py                 # Shared fixtures (isolate_stats_file, etc.)
  test_cli.py                 # CLI tests
  test_main.py                # Workflow orchestration
  test_config.py              # Config loading/validation
  test_ai.py                  # AI integration (registry tests)
  providers/                  # 35+ provider test files
    conftest.py               # BaseProviderTest + fixtures
    test_openai.py
    test_anthropic.py
    ...
  oauth/                      # 7 OAuth flow test files
  test_mcp_server.py          # MCP server tests
  test_grouped_*.py           # 10+ grouped commit workflow tests
  test_stats_*.py             # 15+ stats tests (core, cli, charts, migration, etc.)
  test_interactive_mode_*.py  # Interactive mode tests

This is not exhaustive. Use ls tests/ to explore.

Commands

uv run -- pytest              # All tests (excludes integration)
uv run -- pytest -x           # Stop on first failure
uv run -- pytest -v           # Verbose output
uv run -- pytest tests/test_cli.py              # Single file
uv run -- pytest -k "test_parse_response"       # By name pattern
uv run -- pytest --pdb                          # Debugger on failure
uv run -- pytest -s                             # Show print statements

Integration tests (need API keys):

make test-integration         # or: uv run -- pytest -m integration

Provider Test Structure

Each provider has three test types. See tests/providers/conftest.py for BaseProviderTest.

1. Unit Tests — no external dependencies

class TestOpenAIImports:
    def test_import_module(self):
        from gac.providers import openai
        assert openai is not None

    def test_provider_in_registry(self):
        from gac.providers import PROVIDER_REGISTRY
        assert "openai" in PROVIDER_REGISTRY

Read the full file on GitHub · 146 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 146 lines · 35 tokens per session scan A bccb4f5ec4c2

Subscribe to this mod's changes

testing is a skill published in the GitHub repository thomwebb/gac (318 stars, last pushed 5d ago), licensed MIT. It adds 35 tokens to every session and 1,040 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.