pytest-unit-testing

Automate pytest unit and API testing for Python code in the MycoAI monorepo.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/datamonsterr/mycoai_projects --skill pytest-unit-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pytest-unit-testing
Source: https://github.com/datamonsterr/mycoai_projects/tree/main/.opencode/skills/pytest-unit-testing
Command: npx skills add https://github.com/datamonsterr/mycoai_projects --skill pytest-unit-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Pytest unit testing provides focused, regression-proof coverage for Python code in the MycoAI monorepo, with an emphasis on the mycoai_retrieval_backend to prevent regressions and ensure API stability.

Core Features & Use Cases

  • Focused unit tests: Validate small, deterministic units to catch bugs early.
  • API and integration coverage: Validate backend interfaces and serialization paths.
  • Use Case: When fixing a bug in mycoai_retrieval_backend, add targeted tests that exercise the bug and regression checks.

Quick Start

Run pytest for the mycoai_retrieval_backend tests to validate changes.

Frequently Asked Questions about pytest-unit-testing

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

FAQPage Schema
How do I write pytest unit tests for Python backend code?

Pytest unit tests for Python backend code use local fixtures and mocking practices to validate small, deterministic units, ensuring API stability and regression coverage across the repository.

How do I add regression tests for a bug fix in a Python backend?

To add regression tests for a Python backend bug fix, apply targeted pytest workflows that exercise the specific bug and validate API contract behavior to prevent future regressions in the component.

How do I ensure deterministic pytest tests for API behavior changes?

Ensure deterministic pytest tests for API behavior changes by enforcing local fixtures and mocking practices, which guarantee reusable and stable test outcomes across backend repository components.

Can I use pytest fixtures to validate API serialization paths in Python?

Yes, you can use pytest local fixtures to validate API serialization paths in Python backend code, ensuring deterministic and reusable test coverage for backend interfaces across the repository.

What is the best way to structure pytest tests for a Python monorepo?

The best way to structure pytest tests for a Python monorepo is to enforce pytest-based workflows with local fixtures and mocking, ensuring focused, reusable tests across backend components like retrieval backends.

Why are my pytest unit tests failing intermittently for backend components?

Intermittent pytest unit test failures for backend components often occur when tests are not deterministic, requiring enforced local fixtures and mocking practices to isolate units and prevent state leakage across the repository.