Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Python Testing

  • 97 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Write reliable pytest-asyncio tests for async Python services, including fixtures, concurrency, mocks, and timeout behavior.

About

Python testing (async-testing) is a pytest-asyncio playbook for solo builders shipping async APIs, workers, and CLI tools. It walks through marking tests with pytest.mark.asyncio, building async fixtures that yield clients or connections, exercising concurrent awaits, and mocking coroutines without flaky event-loop behavior. Sections address timeouts, exception propagation, async context managers, and async generators, plus configuration notes so CI matches local runs. The skill assumes familiarity with unit-testing and fixtures-and-mocking companion skills and targets intermediate developers who already ship Python but struggle with loop-scoped fixtures or race-prone concurrent tests. Use it while implementing FastAPI handlers, asyncio pipelines, or agent backends where I/O is async end-to-end. Deliverable is copy-paste-ready test patterns verified with pytest -v, reducing ship-phase regressions without adopting a separate test framework.

  • Covers 11 topic areas from basic @pytest.mark.asyncio tests through async generators and configuration
  • Async fixtures with AsyncGenerator setup/teardown patterns
  • Testing concurrent operations, timeouts, and async exception handling
  • Mocking async functions and async context managers
  • Documents best practices and common pytest-asyncio pitfalls

Python Testing by the numbers

  • 97 all-time installs (skills.sh)
  • Ranked #1,009 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill python-testing

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs97
repo stars325
Security audit3 / 3 scanners passed
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Write reliable pytest-asyncio tests for async Python services, including fixtures, concurrency, mocks, and timeout behavior.

Files

SKILL.mdMarkdownGitHub ↗

Python Testing Hub

Testing standards for pytest configuration, fixture management, and TDD implementation.

Table of Contents

1. Quick Start 2. When to Use 3. Modules

Quick Start

1. Dependencies: pip install pytest pytest-cov pytest-asyncio pytest-mock 2. Configuration: Add the following to pyproject.toml:

    [tool.pytest.ini_options]
    testpaths = ["tests"]
    addopts = "--cov=src"

3. Verification: Run pytest to confirm discovery of files matching test_*.py.

When To Use

  • Constructing unit and integration tests for Python 3.9+ projects.
  • Isolating external dependencies using pytest-mock or custom monkeypatching.
  • Validating asynchronous logic with pytest-asyncio markers and event loop management.
  • Configuring project-wide coverage thresholds and reporting.

When NOT To Use

  • Evaluating test

quality - use pensive:test-review instead

  • Infrastructure test

config - use leyline:pytest-config

Modules

This skill uses modular loading to manage the system prompt budget.

Core Implementation

  • See modules/unit-testing.md - AAA (Arrange-Act-Assert) pattern, basic test structure, and exception validation.
  • See modules/fixtures-and-mocking.md - Request-scoped fixtures, parameterization, and boundary mocking.
  • See modules/async-testing.md - Coroutine testing, async fixtures, and concurrency validation.

Infrastructure & Workflow

  • See modules/test-infrastructure.md - Directory standards, conftest.py management, and coverage tools.
  • See modules/testing-workflows.md - Local execution patterns and GitHub Actions integration.

Standards

  • See modules/test-quality.md - Identification of common anti-patterns like broad exception catching or shared state between tests.

Exit Criteria

  • Tests implement the AAA pattern.
  • Coverage reaches the 80% project minimum.
  • Individual tests are independent and do not rely on execution order.
  • Fixtures are scoped appropriately (function, class, or session) to prevent side effects.
  • Mocking is restricted to external system boundaries.

Troubleshooting

  • Test Discovery: Verify filenames match the test_*.py pattern. Use pytest --collect-only to debug discovery paths.
  • Import Errors: Ensure the local source directory is in the path, typically by installing in editable mode with pip install -e ..
  • Async Failures: Confirm that pytest-asyncio is installed and that async tests use the @pytest.mark.asyncio decorator or corresponding auto-mode configuration.

Related skills

FAQ

Is Python Testing safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Testing & QAtestingbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.