What problem does it solve?
This Skill provides clear guidelines and best practices for writing effective, maintainable, and robust tests within the FLEXT Python ecosystem, reducing bugs and improving code quality.
Core Features & Use Cases
- Test Structure: Enforces the Arrange, Act, Assert (AAA) pattern for clarity.
- FlextResult Testing: Demonstrates how to properly assert success, failure, and transformed values from
FlextResult.
- Fixtures & Parameterization: Guides on using
conftest.py for shared fixtures and pytest.mark.parametrize for efficient test case management.
- Mocking Strategy: Details how to mock external dependencies to isolate units for testing.
- Anti-Patterns: Highlights common testing mistakes to avoid.
- Use Case: When developing a new feature in
flext-core, use this Skill to ensure your unit tests follow established patterns, are easy to read, and effectively cover edge cases.
Quick Start
Use the testing-patterns skill to review the structure of a new test file for the flext-api module.