Coverage for src/fsl_pipe/testing.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.16.1, created at 2026-09-22 15:00 +0100

1"""Helper functions for testing.""" 

2 

3import os 

4from .job import JobList 

5from rich.console import Console 

6import io 

7 

8 

9def touch(path): 

10 """Create a new dummy file at path.""" 

11 with open(path, "a"): 

12 os.utime(path, None) 

13 

14 

15def rich_report(jobs: JobList): 

16 """Get the rich jobs report as a string.""" 

17 console = Console(file=io.StringIO(), width=800) 

18 jobs.report(console) 

19 return console.file.getvalue()