Skip to content

๐Ÿงช Testing

๐Ÿ“‹ Available Nox Sessions

List Available Sessions

Run this to list all available Nox sessions:

nox -l

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

# Run tests across all supported Python versions
nox -s tests

# Run tests on a specific Python version
nox -s tests-3.13

# Run the default sessions (tests + code checks)
nox
# 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

-v                  # Verbose output
-s                  # Show print() output
-x                  # Stop after first failure
-k EXPRESSION       # Filter tests by substring
--tb=short|long|no  # Control traceback format
--lf                # Run only last failed tests
--ff                # Run failed tests first

๐Ÿงน Code Quality Checks

# Run all linting checks
nox -s lint

# Includes:
# - ruff (formatting/linting)
# - codespell (spell checks)
# - pre-commit hooks
# Type check using mypy
nox -s typecheck

# With arguments
nox -s typecheck -- --strict
nox -s typecheck -- src/resumake/cli/
# Run both linting and type checking
nox -s check

# Run all default quality checks and tests
nox

๐Ÿ“ˆ 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

nox -s docs_serve

โš™๏ธ 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