Test Phase (P4)
Steps
- •Read
.workflow/specs/tasks-v{VERSION}.mdfor changed files - •For each changed module, write/update tests:
- •Success path
- •Failure path (CalledProcessError, FileNotFoundError)
- •Edge cases
- •Run full suite
- •Fix failures or report if implementation issue
Run Tests
bash
PYTHONPATH=loofi-fedora-tweaks python -m pytest tests/ -v --tb=short --cov=loofi-fedora-tweaks --cov-report=term-missing --cov-fail-under=80
Testing Rules
- •
@patchdecorators only (no context managers) - •Mock:
subprocess.run,subprocess.check_output,shutil.which,os.path.exists,builtins.open - •No root required
- •Use existing
tests/conftest.pyfixtures - •Minimum 80% coverage on changed files
- •Reference
.github/workflow/prompts/test.mdfor full prompt