summaryrefslogtreecommitdiff
path: root/nose/util.py
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2007-03-13 22:08:14 +0000
committerJason Pellerin <jpellerin@gmail.com>2007-03-13 22:08:14 +0000
commit34fa86b25b46e6db9164eb12137bad99bd2fe0d8 (patch)
tree5d4617e14e03f7e2432d63079fb328877573a587 /nose/util.py
parent37f6827612ca1b9231dbfed75932c5b469b6740e (diff)
downloadnose-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.py13
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