Coverage for src/fsl_pipe/testing.py: 100%
11 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-14 13:47 +0100
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-14 13:47 +0100
1"""Helper functions for testing."""
2import os
3from .job import JobList
4from rich.console import Console
5import io
8def touch(path):
9 """Create a new dummy file at path."""
10 with open(path, 'a'):
11 os.utime(path, None)
14def rich_report(jobs: JobList):
15 """Get the rich jobs report as a string."""
16 console = Console(file=io.StringIO(), width=800)
17 jobs.report(console)
18 return console.file.getvalue()