Running Tests
All Tests
With Coverage
Quick Smoke Test
Verbose Output
Test Selection
By File
By Pattern
By Marker
Single Test
Test Markers
Registered markers:| Marker | Description |
|---|---|
@pytest.mark.unit | Fast, isolated unit tests |
@pytest.mark.integration | Tests with external dependencies |
@pytest.mark.slow | Long-running tests |
Note: Only these three markers are registered inpyproject.toml. Using unregistered markers will cause warnings with--strict-markers.
Test Structure
Directory Layout
Naming Conventions
Fixtures
Common Fixtures (conftest.py)
Fixture Scope
Writing Tests
Basic Test
Parameterized Tests
Exception Testing
Async Tests
Mock Testing
Test Data
Loading Test Data
Sample Corpus
Coverage Requirements
The project requires ≥75% code coverage:Excluding Code from Coverage
Performance Testing
Benchmarks
Running Benchmarks
CI/CD Integration
GitHub Actions Example
Troubleshooting
Tests Not Found
Fixture Not Found
Slow Tests
See Also
- Development Setup - Environment setup
- Contributing - Contribution guidelines
- Naming Conventions - Code style conventions