testing

Author and validate pytest-based unit tests for Canvas plugins.

2|1|Updated Nov 27, 2025
One-click install
npx skills add https://github.com/canvas-medical/coding-agents --skill testing-canvas-medical
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing
Source: https://github.com/canvas-medical/coding-agents/tree/main/canvas-plugin-assistant/skills/testing
Command: npx skills add https://github.com/canvas-medical/coding-agents --skill testing-canvas-medical

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a comprehensive framework for writing unit tests and enforcing coverage for Canvas plugins, reducing debugging time and ensuring reliability.

Core Features & Use Cases

  • Structured test layout mirrors plugin source directories for predictable test placement.
  • Rigorous mock verification ensures interactions are validated via strict mock_calls.
  • Coverage discipline guides teams to reach and maintain target test coverage.

Quick Start

Create tests under tests/ that mirror the plugin's source structure, then run the test suite with pytest and integrate with your CI to enforce coverage.

Frequently Asked Questions about testing

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

FAQPage Schema
How do I structure unit tests for Canvas plugins?

Structure unit tests for Canvas plugins by creating a mirrored test directory under tests/. This layout mirrors your plugin's source directories to ensure predictable test placement and straightforward module mapping.

How do I verify mocks strictly in pytest for Canvas plugins?

Verify mocks strictly in pytest using the mock_calls attribute. This approach ensures that all interactions with mocked protocol, API, and helper modules are validated accurately without missing expected method calls.

Do I need conftest fixtures to test Canvas plugins with pytest?

Yes, you need conftest fixtures to test Canvas plugins effectively. The pytest-based workflow uses conftest fixtures to provide a complete pattern for setting up test data, configuring mocks, and handling verification across your modules.

How do I exclude test code from coverage reports in pytest?

Exclude test code from coverage reports in pytest by applying coverage discipline. The framework automatically excludes test code from coverage reports while guiding teams to reach and maintain target coverage across protocol and API modules.

What is the best way to enforce test coverage for Canvas plugin development?

The best way to enforce test coverage for Canvas plugin development is integrating a pytest-based workflow with your CI. This enforces target coverage across protocol, API, and helper modules while reducing debugging time.