2 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt |
2 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt |
3 |
3 |
4 """Simple value objects for tracking what to do with files.""" |
4 """Simple value objects for tracking what to do with files.""" |
5 |
5 |
6 |
6 |
7 class FileDisposition(object): |
7 class FileDisposition: |
8 """A simple value type for recording what to do with a file.""" |
8 """A simple value type for recording what to do with a file.""" |
9 pass |
9 pass |
10 |
10 |
11 |
11 |
12 # FileDisposition "methods": FileDisposition is a pure value object, so it can |
12 # FileDisposition "methods": FileDisposition is a pure value object, so it can |
27 |
27 |
28 |
28 |
29 def disposition_debug_msg(disp): |
29 def disposition_debug_msg(disp): |
30 """Make a nice debug message of what the FileDisposition is doing.""" |
30 """Make a nice debug message of what the FileDisposition is doing.""" |
31 if disp.trace: |
31 if disp.trace: |
32 msg = "Tracing %r" % (disp.original_filename,) |
32 msg = f"Tracing {disp.original_filename!r}" |
|
33 if disp.original_filename != disp.source_filename: |
|
34 msg += f" as {disp.source_filename!r}" |
33 if disp.file_tracer: |
35 if disp.file_tracer: |
34 msg += ": will be traced by %r" % disp.file_tracer |
36 msg += ": will be traced by %r" % disp.file_tracer |
35 else: |
37 else: |
36 msg = "Not tracing %r: %s" % (disp.original_filename, disp.reason) |
38 msg = f"Not tracing {disp.original_filename!r}: {disp.reason}" |
37 return msg |
39 return msg |