Bug 879683 - Allow MarionetteTestResult and MarionetteTextTestRunner to be subclassed. r=jgriffin

This commit is contained in:
Dave Hunt 2013-06-14 13:21:29 -04:00
parent 6d1dd5e546
commit 139b1a2fbe
2 changed files with 8 additions and 3 deletions

View File

@ -6,5 +6,7 @@ from gestures import *
from marionette import Marionette, HTMLElement, Actions, MultiActions
from marionette_test import MarionetteTestCase, CommonTestCase
from emulator import Emulator
from runtests import MarionetteTestResult
from runtests import MarionetteTestRunner
from runtests import MarionetteTestOptions
from runtests import MarionetteTextTestRunner

View File

@ -71,7 +71,8 @@ class MarionetteTestResult(unittest._TextTestResult):
self.stream.writeln('END LOG:')
def printErrorList(self, flavour, errors):
for test, err in errors:
for error in errors:
test, err = error[:2]
self.stream.writeln(self.separator1)
self.stream.writeln("%s: %s" % (flavour, self.getDescription(test)))
self.stream.writeln(self.separator2)
@ -169,6 +170,8 @@ class MarionetteTextTestRunner(unittest.TextTestRunner):
class MarionetteTestRunner(object):
textrunnerclass = MarionetteTextTestRunner
def __init__(self, address=None, emulator=None, emulatorBinary=None,
emulatorImg=None, emulator_res='480x800', homedir=None,
app=None, bin=None, profile=None, autolog=False, revision=None,
@ -440,8 +443,8 @@ class MarionetteTestRunner(object):
break
if suite.countTestCases():
runner = MarionetteTextTestRunner(verbosity=3,
marionette=self.marionette)
runner = self.textrunnerclass(verbosity=3,
marionette=self.marionette)
results = runner.run(suite)
self.results.append(results)