diff options
author | Jason Pellerin <jpellerin@gmail.com> | 2007-03-13 22:08:14 +0000 |
---|---|---|
committer | Jason Pellerin <jpellerin@gmail.com> | 2007-03-13 22:08:14 +0000 |
commit | 34fa86b25b46e6db9164eb12137bad99bd2fe0d8 (patch) | |
tree | 5d4617e14e03f7e2432d63079fb328877573a587 /nose/util.py | |
parent | 37f6827612ca1b9231dbfed75932c5b469b6740e (diff) | |
download | nose-34fa86b25b46e6db9164eb12137bad99bd2fe0d8.tar.gz |
Further work on integrating result proxying. Just about to start removing the context object.
Diffstat (limited to 'nose/util.py')
-rw-r--r-- | nose/util.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nose/util.py b/nose/util.py index ac44901..16721ba 100644 --- a/nose/util.py +++ b/nose/util.py @@ -176,6 +176,19 @@ def getpackage(filename): mod_parts.reverse() return '.'.join(mod_parts) +def ln(label): + """Draw a 70-char-wide divider, with label in the middle. + + >>> ln('hello there') + '---------------------------- hello there -----------------------------' + """ + label_len = len(label) + 2 + chunk = (70 - label_len) / 2 + out = '%s %s %s' % ('-' * chunk, label, '-' * chunk) + pad = 70 - len(out) + if pad > 0: + out = out + ('-' * pad) + return out def resolve_name(name, module=None): """Resolve a dotted name to a module and its parts. This is stolen |