diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2022-01-11 08:22:57 -0500 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-01-15 07:58:57 -0500 |
| commit | abd05d81522f605e8264844e10703319a9be2c7c (patch) | |
| tree | 5de291c6b7577a92bafffed2c5d3a3e5ba4bd097 | |
| parent | d723b46460dc7ffb4abf54806087ffd614b81331 (diff) | |
| download | python-coveragepy-git-abd05d81522f605e8264844e10703319a9be2c7c.tar.gz | |
test: a debug helper to show made-file contents
| -rw-r--r-- | tests/helpers.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py index 82d8b18f..29464d1c 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -87,6 +87,13 @@ def make_file(filename, text="", bytes=b"", newline=None): with open(filename, 'wb') as f: f.write(data) + # For debugging, enable this to show the contents of files created. + if 0: # pragma: debugging + print(f" ───┬──┤ {filename} ├───────────────────────") + for lineno, line in enumerate(data.splitlines(), start=1): + print(f"{lineno:6}│ {line.rstrip().decode()}") + print() + return filename |
