Testing Patterns

Enforce pytest best practices and TDD workflows for Argus analysis engine tests.

1|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/lagarcess/argus --skill testing-patterns-lagarcess
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Patterns
Source: https://github.com/lagarcess/argus/tree/main/.agent/skills/testing-patterns
Command: npx skills add https://github.com/lagarcess/argus --skill testing-patterns-lagarcess

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Standardizes testing practices to reduce brittle tests and speed up delivery by enforcing pytest best practices, test organization, and TDD workflows for the Argus analysis engine.

Core Features & Use Cases

  • TDD Workflow: Guides Red-Green-Refactor iteration and mandates writing failing tests for bug fixes before implementing patches.
  • Test Organization & Naming: Recommends a clear tests/ layout, file/class/method naming conventions, and use of conftest.py for shared fixtures.
  • Assertions, Markers & Coverage: Advises using plain assert, pytest.approx for floats, markers for slow/performance tests, and enforces a 63% CI coverage threshold.
  • Numba & Performance Testing: Describes warmup_jit patterns, use of xfail for timing variability, and testing with both small correctness and large performance datasets.
  • Use Case: Validate pivot detection by writing a focused failing test, implement the minimal fix, then run the test suite with coverage checks.

Quick Start

Use the Testing Patterns skill to create a failing pytest reproducing a pivot detection bug, implement the minimal fix following TDD, and run tests to ensure coverage meets the 63% threshold.

Frequently Asked Questions about Testing Patterns

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

FAQPage Schema
How do I structure pytest tests and fixtures for a Python analysis engine?

Structure pytest tests using a clear tests/ layout with file/class/method naming conventions and conftest.py for shared fixtures. This organization standardizes testing practices to reduce brittle tests and speed up delivery for analysis modules.

What's the best way to test Numba-optimized functions with pytest?

Test Numba-optimized functions using warmup_jit patterns before execution. Use xfail markers for timing variability, and test with both small correctness datasets and large performance datasets to validate Numba-optimized functions properly.

How do I apply TDD workflows to fix bugs in pivot detection or harmonic pattern recognition?

Apply TDD workflows by writing a focused failing pytest reproducing the pivot detection or harmonic pattern recognition bug first. Then implement the minimal fix following Red-Green-Refactor iteration before running the test suite to ensure coverage meets the threshold.

How do I enforce a CI coverage threshold and organize pytest markers for performance tests?

Enforce a 63% CI coverage threshold and use pytest markers to categorize slow or performance tests. Apply plain assert statements, pytest.approx for floats, and consistent markers to maintain test quality across analysis modules.

Can I use plain assert statements and pytest.approx for testing Python analysis modules?

Yes, use plain assert statements and pytest.approx for float comparisons when testing Python analysis modules. These assertion patterns are recommended best practices to ensure test reliability and reduce brittleness in pivot detection and harmonic pattern recognition testing.

Why does my pytest coverage threshold fail in CI for analysis engine tests?

Pytest coverage fails when test coverage drops below the enforced 63% CI threshold. Ensure all pivot detection, harmonic pattern recognition, and Numba-optimized functions have corresponding tests using proper naming conventions and fixture usage to meet this requirement.