summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDuncan McGreggor <duncan@ubuntu.com>2011-03-14 20:30:44 -0600
committerDuncan McGreggor <duncan@ubuntu.com>2011-03-14 20:30:44 -0600
commite489ab910e94173efd0abe3af6c6c45b669bb2a1 (patch)
tree3d779d1382974aebe4e7349bbee1462310a76226 /python
parent04430a441f216f3773e1a905ceef2249a1a0b46f (diff)
Tweaked the display of test results.
Diffstat (limited to 'python')
-rw-r--r--python/TODO5
-rw-r--r--python/evemu/testing.py22
2 files changed, 16 insertions, 11 deletions
diff --git a/python/TODO b/python/TODO
index 7256d38..8764872 100644
--- a/python/TODO
+++ b/python/TODO
@@ -37,10 +37,7 @@ The script does this:
TODO
====
- * EvEmuWrapper creates a device in __init__
- - the create() method should check to see if there's a device already
- created, and then abort if so... creating one only if it's necessary
-
+ *
MIND-STATE DUMP
===============
diff --git a/python/evemu/testing.py b/python/evemu/testing.py
index 7a849e2..50536e8 100644
--- a/python/evemu/testing.py
+++ b/python/evemu/testing.py
@@ -72,21 +72,29 @@ class CustomTestResult(TextTestResult):
def __init__(self, *args, **kwds):
super(CustomTestResult, self).__init__(*args, **kwds)
- self.current_module_and_class = ""
- self.last_module_and_class = ""
+ self.current_module = ""
+ self.last_module = ""
+ self.current_class = ""
+ self.last_class = ""
def startTest(self, test):
unittest.TestResult.startTest(self, test)
if not self.showAll:
return
- self.last_module_and_class = self.current_module_and_class
+ self.last_module = self.current_module
+ self.last_class = self.current_class
method = test._testMethodName
module_and_class = test.id().rsplit(method)[0][:-1]
- self.current_module_and_class = module_and_class
- if self.last_module_and_class != self.current_module_and_class:
- heading = "\n%s.%s" % (util.get_test_module(), module_and_class)
+ this_module = ".".join(module_and_class.split(".")[:-1])
+ self.current_module = this_module
+ this_class = module_and_class.split(".")[-1]
+ self.current_class = this_class
+ if self.last_module != self.current_module:
+ heading = "\n%s.%s" % (util.get_test_module(), this_module)
self.stream.writeln(heading)
- self.stream.write("\t%s " % method.ljust(50, "."))
+ if self.last_class != self.current_class:
+ self.stream.writeln(" %s" % this_class)
+ self.stream.write(" %s " % method.ljust(50, "."))
self.stream.write(" ")
self.stream.flush()