testing

Enforce pytest testing standards for mocks, fixtures, and Streamlit components.

1|Updated Dec 6, 2025
One-click install
npx skills add https://github.com/mnbst/job-recommender --skill testing-mnbst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/mnbst/job-recommender/tree/main/.claude/skills/testing
Command: npx skills add https://github.com/mnbst/job-recommender --skill testing-mnbst

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pytest automatic test standards guide: this skill provides a canonical reference for test creation and execution, including mocks, fixtures, and Streamlit component tests.

Core Features & Use Cases

  • Test structure: guidance for file naming (tests/test_*.py), class grouping (class TestFeature...), and descriptive docstrings.
  • Mocking & fixtures: recommended patterns using unittest.mock.patch and pytest fixtures for reusable setup.
  • Streamlit component tests: strategies for testing Streamlit components in isolation and with mock components.
  • Use case: a team adopts these standards to maintain consistent tests across services and modules.

Quick Start

Run pytest in your project root to execute all tests and verify test quality.

Frequently Asked Questions about testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize pytest test structure and naming conventions across a Python project?

Standardizing pytest test structure involves enforcing file naming like tests/test_*.py, grouping tests under class TestFeature..., and adding descriptive docstrings to ensure consistent and readable test organization across your Python project.

What is the best way to share pytest fixtures and apply mocks for reusable test setup?

The best way to share pytest fixtures and apply mocks is using unittest.mock.patch alongside pytest fixtures, which provides reusable setup patterns and ensures your unit tests remain reliable and properly isolated from external dependencies.

Can I use pytest to run Streamlit component tests in isolation?

Yes, you can use pytest to run Streamlit component tests by employing specific strategies for testing Streamlit components in isolation and utilizing mock components to verify UI logic without launching the full application server.

Does this pytest testing convention apply to integration and component tests, or only unit tests?

This pytest testing convention applies to Python projects using pytest for unit, integration, and component tests, ensuring clear naming and sharing of fixtures across all test types located within the tests/ directory.

How do I execute all standardized pytest tests and verify test quality in my project?

To execute all standardized pytest tests and verify test quality, simply run the pytest command in your project root, which will automatically discover and run all test files matching the established naming conventions.

Why should our team adopt standardized mocking patterns for pytest instead of ad-hoc setups?

Adopting standardized mocking patterns for pytest ensures reliable, isolated tests by enforcing clear conventions, which prevents inconsistent test behavior and maintains reliable test quality across different services and modules.