๐งช Testing¶
๐ Available Nox Sessions¶
List Available Sessions
Run this to list all available Nox sessions:
Example output:
Sessions defined in noxfile.py:
- develop-3.8 # Create development environment
- develop-3.9
- develop-3.10
- develop-3.11
- develop-3.12
- develop-3.13
* tests-3.8 # Run tests with coverage
* tests-3.9
* tests-3.10
* tests-3.11
* tests-3.12
* tests-3.13
- lint # Code formatting and linting
- typecheck # Type checking with mypy
* check # Run lint + typecheck
- build # Build package distributions
- changelog # Generate changelog
- docs_serve # Serve documentation locally
- docs_deploy # Deploy documentation to GitHub Pages
Sessions marked with * are selected; - are available but skipped.
โ Running Tests¶
# Verbose output
nox -s tests-3.13 -- -v
# Run tests matching a pattern
nox -s tests-3.13 -- -k test_version
# Run a specific test file
nox -s tests-3.13 -- tests/test_cli.py
# Use short traceback
nox -s tests-3.13 -- --tb=short
# Generate HTML coverage report
nox -s tests-3.13 -- --cov-report=html
# Combine multiple arguments
nox -s tests-3.13 -- -v -k test_cli --tb=short
Common pytest Arguments
๐งน Code Quality Checks¶
๐ Coverage Reports¶
Coverage Summary
Test sessions include coverage reporting:
- ๐ Terminal Output: shows % covered and missing lines
- ๐ HTML Report: viewable with
--cov-report=html - โ Minimum Required: 90%
- ๐ข Current: 100% coverage
๐ Documentation Development¶
Serve Docs Locally
- Starts a local server with live reload
- Available at: http://127.0.0.1:8000
โ๏ธ Requirements¶
Testing Requirements
- Python: 3.8 or newer (up to 3.13 supported)
- Coverage Threshold: 90% minimum
- Test Layout:
- Files:
tests/test_*.py - Classes:
Test*format
- Files: