From e489ab910e94173efd0abe3af6c6c45b669bb2a1 Mon Sep 17 00:00:00 2001 From: Duncan McGreggor Date: Mon, 14 Mar 2011 20:30:44 -0600 Subject: Tweaked the display of test results. --- python/TODO | 5 +---- python/evemu/testing.py | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'python') 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() -- cgit v1.2.3