testing-workflow

Configure pytest.ini and organize Python tests with fixtures and coverage.

2|1|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/obinopaul/agents-backend --skill testing-workflow-obinopaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-workflow
Source: https://github.com/obinopaul/agents-backend/tree/main/backend/src/sandbox/agent_infra_sandbox/deepagents_cli/modes/skill_sets/software_developer/testing-workflow
Command: npx skills add https://github.com/obinopaul/agents-backend --skill testing-workflow-obinopaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill guides you in building, organizing, and maintaining robust tests using pytest to ensure code reliability and faster feedback.

Core Features & Use Cases

  • Test Organization: Clear structure for unit, integration, and async tests.
  • Fixtures & Mocking: Reusable setup and isolated dependencies.
  • Coverage & Quality: Guidelines to improve test coverage and report results.

Quick Start

Create a pytest-based testing project with a tests/ directory, add a basic test file, and run pytest to see results.

Frequently Asked Questions about testing-workflow

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

FAQPage Schema
How do I write unit tests with pytest?

Unit tests with pytest start by creating a tests/ directory and writing test functions prefixed with test_. Use pytest fixtures for reusable setup, mocking to isolate dependencies, and parametrization to test multiple inputs. Run pytest from your project root to execute all tests and view results.

What's the best way to organize tests in a Python project?

Organize tests by mirroring your source code structure in a tests/ directory. Separate unit, integration, and async tests into distinct modules. Use pytest fixtures in conftest.py for shared setup across test files. This structure scales and makes maintenance straightforward.

How do I set up pytest fixtures and mocking for test isolation?

Fixtures are reusable setup functions decorated with @pytest.fixture that dependencies inject into test functions. Use mocking to replace external calls with controlled substitutes. Define fixtures in conftest.py for project-wide reuse, keeping tests isolated and deterministic.

Can I test async functions with pytest?

Yes, pytest supports async tests through plugins like pytest-asyncio. Mark async test functions with @pytest.mark.asyncio and define async fixtures with @pytest.fixture. This lets you test coroutines and async workflows alongside synchronous tests.

How do I measure and improve test coverage?

Use pytest with coverage.py to measure which code paths your tests exercise. Run pytest --cov to generate coverage reports identifying untested lines. Set coverage targets and iterate to close gaps, improving reliability and catching edge cases.

What's the difference between mocking and fixtures in pytest?

Fixtures provide reusable setup and teardown; mocks replace real dependencies with controlled substitutes. Use fixtures for common test state and mocks to isolate the code under test from external systems, databases, or APIs.