Wan2.1/pytest.ini
Claude 67f00b6f47
test: add comprehensive pytest test suite
Implements a production-grade testing infrastructure with 100+ tests
covering all core modules and pipelines.

Test Coverage:
- Unit tests for WanModel (DiT architecture)
- Unit tests for WanVAE (3D Causal VAE)
- Unit tests for attention mechanisms
- Integration tests for pipelines (T2V, I2V, FLF2V, VACE)
- Utility function tests

Test Infrastructure:
- conftest.py with reusable fixtures for configs, devices, and dtypes
- pytest.ini with markers for different test categories
- Test markers: slow, cuda, integration, unit, requires_model
- Support for both CPU and GPU testing
- Parameterized tests for various configurations

Files Added:
- tests/conftest.py - Pytest fixtures and configuration
- tests/test_attention.py - Attention mechanism tests
- tests/test_model.py - WanModel tests
- tests/test_vae.py - VAE tests
- tests/test_utils.py - Utility function tests
- tests/test_pipelines.py - Pipeline integration tests
- pytest.ini - Pytest configuration

Test Execution:
- pytest tests/ -v              # Run all tests
- pytest tests/ -m "not cuda"   # CPU only
- pytest tests/ -m "integration" # Integration tests only
2025-11-19 04:24:33 +00:00

48 lines
1.1 KiB
INI

[pytest]
# Pytest configuration for Wan2.1
# Test discovery patterns
python_files = test_*.py
python_classes = Test*
python_functions = test_*
# Default test paths
testpaths = tests
# Output options
addopts =
-v
--strict-markers
--tb=short
--disable-warnings
-ra
# Markers for categorizing tests
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
cuda: marks tests that require CUDA (deselect with '-m "not cuda"')
integration: marks integration tests (deselect with '-m "not integration"')
unit: marks unit tests
requires_model: marks tests that require model checkpoints
requires_flash_attn: marks tests that require flash attention
# Coverage options (if using pytest-cov)
# [coverage:run]
# source = wan
# omit = tests/*
# Timeout for tests (if using pytest-timeout)
# timeout = 300
# Logging
log_cli = false
log_cli_level = INFO
log_cli_format = %(asctime)s [%(levelname)8s] %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S
# Ignore warnings from dependencies
filterwarnings =
ignore::DeprecationWarning
ignore::PendingDeprecationWarning
ignore::FutureWarning