What problem does it solve?
This Skill addresses the complexity and inconsistency in writing pytest-based tests by providing a standardized template, promoting code reuse, and enhancing maintainability.
Core Features & Use Cases
- Test Structure: Offers a structured template for unit, integration, and golden file regression tests.
- Fixture Usage: Demonstrates effective use of fixtures for setup and teardown, with different scopes.
- Parametrization: Explains how to create tests with multiple input cases using parametrization.
- Mocking: Provides examples of mocking external dependencies to isolate tests.
- Golden File Regression: Details the process of creating and using golden files for trajectory regression testing.
- Exception Handling: Shows how to handle exceptions and edge cases in tests.
- Markers: Uses pytest markers for test categorization and execution filtering.
- ROS2 Node Testing: Offers guidance on testing ROS2 nodes using launch files and mock nodes.
- Coverage: Explains how to use coverage tools to ensure code is tested.
- CI Integration: Provides an example of integrating tests with CI pipelines.
- Common Pitfalls: Lists common mistakes in testing and how to avoid them.
Quick Start
Run the skill to learn about pytest best practices and implement them in your projects.