Index of every page on this site: llms.txt
All skills
prefecthq avatar

/python-tests

@12a2db1
by Prefectprefecthq/fastmcp29k stars
2,631
Run it yourself

Write regression tests for FastMCP changes using its pytest fixtures, in-memory clients, and protocol boundaries.

Use this Skill: https://skilld.dev/gh/prefecthq/fastmcp/python-tests

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈32 tokens for metadata: the name and description. ≈544 when used: this file.

Description uses 1.6% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈128 characters, or 1.6%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

FastMCP tests

Read nearby tests, the testing guide, and the repository's validation requirements first. Extend the owning test module when it remains readable; use a focused module when the existing one is already too large.

For a bug fix, run the regression against unchanged code and confirm it fails for the reported reason, then run it with the fix. An import error or broken fixture is not a reproduced bug. To run a PR's test against main, copy it into a main worktree: pythonpath in pyproject shadows PYTHONPATH. Include supported adjacent behavior that the same branch could change, especially omitted defaults and explicit overrides.

  • Async tests need no marker: asyncio_mode = "auto" is configured globally.
  • Use Client(server) for real MCP dispatch without a network server. Use HTTP transport only when network behavior is the subject.
  • Test the default protocol mode; pin mode="legacy" only when the handshake era is the subject.
  • Mock external boundaries, not the FastMCP functions under test. For OpenAPI requests, capture the outgoing request with httpx2.MockTransport and assert its bytes, headers, or decoded parameters.
  • Keep imports at module scope. Prefer function-scoped fixtures and tmp_path for files.
  • Parameterize variations of one contract; separate unrelated behavior. For JSON, equality alone does not distinguish True from 1: check the resulting type when type preservation matters.
  • Use existing inline_snapshot conventions for complex schema assertions. Inspect generated snapshots rather than accepting them blindly.
  • The default timeout is five seconds. Use the repository's integration conventions for tests that legitimately need more time.

Run relevant tests and applicable static checks before committing. Broaden local testing when a concrete dependency or failure warrants it; leave routine full-suite and platform-matrix runs to CI. Do not repeat the full suite for each layer in a stack. Follow AGENTS.md for the local verification policy. If a failure appears unrelated, reproduce it on the unchanged base; do not call it pre-existing from the test name alone.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts21d3 checks · Risk SAFE
  • Gen Agent Trust Hub21d

    The skill provides guidelines for writing regression tests for the FastMCP library. It includes instructions on using testing tools, mocking external boundaries, and following repository conventions. No security issues were detected.

  • Socket21d

    No alerts

  • Snyk21d

    Risk: LOW · No issues

Signed by skilld at 12a2db1. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 weeks ago

README badge

README badge for prefecthq/fastmcp/python-tests