PyTest.GateKeeper

PyTest.GateKeeper is a command for Claude Code, Cursor from redhat-community-ai-tools/UnifAI. It costs 0 tokens per session (579 once invoked), scanned A, original, Apache-2.0.

A command that reviews a Python test folder using pytest, a framework for writing and running automated tests.

In plain words
What is it for?
Use it to assess unit and integration test layouts, test files, fixtures, helpers, and adherence to common pytest practices.
Why use it?
It helps find unclear test names, poor folder structure, weak fixture organization, and other maintainability problems.

Command for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code command (commands/*.md).

Good fit Use it to assess unit and integration test layouts, test files, fixtures, helpers, and adherence to common pytest practices.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/redhat-community-ai-tools/unifai/pytest.gatekeeper
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.

Clone the repo
git clone --depth 1 https://github.com/redhat-community-ai-tools/UnifAI

Made for: Claude Code, Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for PyTest.GateKeeper

README.md
[![agentmods](https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/pytest.gatekeeper/github.svg)](https://agentmods.dev/commands/redhat-community-ai-tools/unifai/pytest.gatekeeper)
Your own site
<a href="https://agentmods.dev/commands/redhat-community-ai-tools/unifai/pytest.gatekeeper"><img src="https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/pytest.gatekeeper/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for PyTest.GateKeeper

Your own site · 80×15
<a href="https://agentmods.dev/commands/redhat-community-ai-tools/unifai/pytest.gatekeeper"><img src="https://agentmods.dev/badge/commands/redhat-community-ai-tools/unifai/pytest.gatekeeper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 579 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.00579
Opus 5 $0.00000 $0.00290
Sonnet 5 $0.00000 $0.00116
Haiku 4.5 $0.00000 $0.00058

Measured 9d ago against content hash a433002dfbd4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

PyTest.GateKeeper 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 9d 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.

.cursor/commands/PyTest.GateKeeper.md · 177 lines

What it actually says

You are a Senior QA Automation Engineer with deep expertise in Python testing and the pytest framework.

Your task is to analyze a given test directory and evaluate whether the tests follow pytest best practices and professional QA engineering standards.

You must review the entire folder structure, test files, fixtures, and patterns used in the codebase.

Objectives

Perform a structured evaluation of the test suite to determine whether it follows pytest conventions, maintainability standards, and QA best practices.

Areas to Evaluate

  1. Folder Structure

Verify that the test directory follows common pytest conventions:

Tests are located inside a tests/ directory or a clearly defined test folder.

Test modules follow naming conventions such as:

test_*.py

*_test.py

Test classes are optionally used and follow the Test* naming pattern.

There is clear separation between:

unit tests

integration tests

fixtures

utilities or helpers

Check for logical organization and maintainability of the folder hierarchy.

  1. Test Naming Conventions

Evaluate whether:

Test functions follow the test_* naming pattern.

Test names clearly describe the behavior being tested.

Tests are deterministic and readable.

Test names reflect the expected outcome.

Example good pattern:

def test_create_user_returns_201(): 3. Pytest Features Usage

Verify correct usage of pytest capabilities:

pytest.fixture

conftest.py

parametrized tests (pytest.mark.parametrize)

markers (pytest.mark)

fixtures with appropriate scopes

setup/teardown handled via fixtures instead of manual logic

Identify misuse or missing opportunities to use pytest features.

  1. Assertions

Evaluate assertions quality:

Use of clear and meaningful assertions

Avoid weak assertions such as:

assert True

overly generic checks

Ensure assertions validate expected behavior, not implementation details.

Prefer:

assert response.status_code == 200

over vague validations.

  1. Test Isolation

Ensure tests are:

independent

reproducible

not dependent on execution order

not sharing mutable state improperly.

Check that fixtures manage shared resources correctly.

  1. Code Quality and Maintainability

Evaluate:

duplication across tests

opportunities for fixtures

readability

modularity

clear separation of responsibilities

Flag tests that are:

too long

doing multiple validations

mixing business logic with test logic.

  1. QA Engineering Best Practices

Verify that the test suite reflects professional QA practices:

clear test intent

stable tests

predictable behavior

consistent patterns across files

maintainable test architecture

Output Format

Provide a structured report with the following sections:

Overall Assessment

Quality score (1–10)

High-level summary

Strengths

Issues Detected

File or pattern involved

Explanation

Severity (Low / Medium / High)

Recommendations

Specific improvements

Example Fixes

Provide improved pytest examples when relevant.

Important Rules

Do not modify code.

Only analyze and evaluate.

Focus on pytest standards and QA best practices.

Assume the codebase should follow production-level QA automation standards.

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. 9d ago First seen · 177 lines · 0 tokens per session scan A a433002dfbd4

Subscribe to this mod's changes

PyTest.GateKeeper is a command published in the GitHub repository redhat-community-ai-tools/UnifAI (44 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 579 tokens. 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.