Test Suite Documentation⚓︎
The ezpz test suite provides comprehensive unit tests for all modules in the package. This documentation explains the structure, purpose, and usage of each test file.
Test Organization⚓︎
The test suite is organized into individual files, each focusing on a specific module or aspect of the ezpz package:
- Main Module Tests - Tests for the core ezpz package
- Configs Module Tests - Tests for configuration management
- Improved Configs Tests - Additional mocked coverage for configs
- Distributed Module Tests - Tests for the distributed module (
ezpz.distributed) - History Module Tests - Tests for metrics tracking and history management
- Jobs Module Tests - Tests for job management and scheduling
- Logging Module Tests - Tests for logging functionality
- Profiling Module Tests - Tests for performance profiling
- Tensor Parallel Module Tests - Tests for tensor parallel computing
- Utilities Module Tests - Tests for utility functions
- Enhanced Utilities Tests - Mock-heavy tests for utility helpers
- Launch Module Tests - Tests for the launch functionality
- Terminal Plotting Tests - Tests for terminal-based plotting
- Lazy Import Tests - Tests for lazy loading functionality
- Modules-in-Isolation Tests - Smoke tests importing modules without
ezpz.__init__ - Property-Based Utility Tests - Hypothesis-driven validation for utility helpers
- Simple ezpz Smoke Tests - Minimal import/version checks
- Simple Test Harness - Standalone script for import validation
- Comprehensive Smoke Tests - Broad mocked environment checks
- Simple Test Runner - Scripted entry point for quick smoke testing
Running Tests⚓︎
To run the test suite:
# Run all tests
python -m pytest tests/
# Run a specific test file
python -m pytest tests/test_ezpz.py
# Run tests with verbose output
python -m pytest tests/ -v
# Run tests and show coverage
python -m pytest tests/ --cov=src/ezpz
Test Structure⚓︎
Each test file follows the standard pytest structure:
- Test functions start with
test_ - Test classes start with
Test - Fixtures are used for setup/teardown
- Mocking is used to isolate units under test
Writing New Tests⚓︎
When adding new tests, follow these guidelines:
- Create a new test file following the naming convention
test_*.py - Import the module you want to test
- Write test functions that verify specific behavior
- Use pytest fixtures for setup/teardown
- Use mocking to isolate units under test
- Add appropriate markers (e.g.,
@pytest.mark.slowfor slow tests)