This directory contains tests for the yamlfmt cross-platform functionality.
test_yamlfmt.py: Main test suite that validates yamlfmt functionality across different platforms
Run tests locally with:
python -m pytest tests/ -vOr run the test script directly:
python tests/test_yamlfmt.pyThe tests are automatically run in GitHub Actions across multiple platforms:
- Linux (Ubuntu)
- macOS
- Windows
The test suite covers:
- Platform Detection: Verifies the current platform can be detected
- Version Output: Tests that yamlfmt can output version information
- Basic Formatting: Tests basic YAML formatting functionality
- Executable Permissions: Verifies the yamlfmt executable has correct permissions
- Help Output: Tests that yamlfmt can show help information
- Module Import: Tests that the yamlfmt module can be imported correctly
- System Information: Displays system information for debugging
When adding new tests:
- Follow the existing naming convention (
test_*) - Include appropriate error handling for cross-platform compatibility
- Add descriptive docstrings
- Use appropriate assertions for validation