Skip to content

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:

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:

  1. Create a new test file following the naming convention test_*.py
  2. Import the module you want to test
  3. Write test functions that verify specific behavior
  4. Use pytest fixtures for setup/teardown
  5. Use mocking to isolate units under test
  6. Add appropriate markers (e.g., @pytest.mark.slow for slow tests)