run-tests

Run pytest tests locally with filtering and debugging options.

561|190|Updated May 16, 2024
One-click install
npx skills add https://github.com/microsoft/semantic-link-labs --skill run-tests-microsoft
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-tests
Source: https://github.com/microsoft/semantic-link-labs/tree/main/.claude/skills/run-tests
Command: npx skills add https://github.com/microsoft/semantic-link-labs --skill run-tests-microsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the process of verifying code changes by providing clear instructions and commands for running pytest tests locally, ensuring code quality before commits.

Core Features & Use Cases

  • Local Test Execution: Run all tests, specific files, or tests matching patterns.
  • Debugging Assistance: Offers options to stop on failure, enter a debugger, and view local variables.
  • Use Case: After making a modification to a function in sempy_labs, you can use this skill to run the relevant tests to confirm your change didn't break existing functionality.

Quick Start

Run all pytest tests for the project using the command pytest -s tests/.

Frequently Asked Questions about run-tests

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

FAQPage Schema
How do I run pytest tests locally to verify code changes?

Run pytest tests locally by executing the command pytest -s tests/ to verify code changes before committing. You can run all tests, target specific files, or filter by patterns to confirm modifications didn't break existing functionality.

Can I filter pytest runs to specific test files or patterns?

Yes, you can filter pytest execution by test name or specific file paths. This allows you to run only the tests relevant to your recent code modifications instead of executing the entire test suite every time.

How do I debug failing pytest tests and inspect local variables?

Debug failing pytest tests by using options to stop execution on failure and enter an interactive debugger. This allows you to inspect local variables and diagnose why specific code modifications broke existing test cases.

Does this skill support CI/CD integration with GitHub Actions?

Yes, pytest test verification supports CI/CD integration by providing GitHub Actions workflow examples. You can automate local test execution commands within your continuous integration pipelines to ensure code quality before merges.

What is the best way to ensure code quality before committing changes to sempy_labs?

The best way to ensure code quality before committing is running pytest locally. After modifying a function in sempy_labs, execute the relevant tests to confirm your change didn't break existing functionality and maintain project stability.

Why did my local pytest test execution stop on the first failure?

Pytest execution stops on failure when debugging options are enabled. This allows developers to enter an interactive debugger immediately upon failure to inspect local variables and diagnose the exact cause of the broken test.