diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-06 17:42:53 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-02-06 17:43:26 -0500 |
commit | 7e85e782bc24fa487d77aff3356eaf04db764d21 (patch) | |
tree | d238edc7245c83ae73c2d3482507bf8423ad3710 /coverage/debug.py | |
parent | 7bd23c8ae4f219136332501ecd1767ed16ceb559 (diff) | |
download | python-coveragepy-git-7e85e782bc24fa487d77aff3356eaf04db764d21.tar.gz |
debug: pybehave is now an option on `coverage debug`
Diffstat (limited to 'coverage/debug.py')
-rw-r--r-- | coverage/debug.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/coverage/debug.py b/coverage/debug.py index e6f93aa6..8c5e3839 100644 --- a/coverage/debug.py +++ b/coverage/debug.py @@ -130,17 +130,18 @@ def info_formatter(info): yield "%*s: %s" % (label_len, label, data) -def write_formatted_info(writer, header, info): +def write_formatted_info(write, header, info): """Write a sequence of (label,data) pairs nicely. - `writer` has a .write(str) method. `header` is a string to start the - section. `info` is a sequence of (label, data) pairs, where label - is a str, and data can be a single value, or a list/set/tuple. + `write` is a function write(str) that accepts each line of output. + `header` is a string to start the section. `info` is a sequence of + (label, data) pairs, where label is a str, and data can be a single + value, or a list/set/tuple. """ - writer.write(info_header(header)) + write(info_header(header)) for line in info_formatter(info): - writer.write(" %s" % line) + write(f" {line}") def short_stack(limit=None, skip=0): |