Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2397)

Unified Diff: components/test/data/autofill/automated_integration/autofill_test/runner.py

Issue 2116583004: Automated Autofill testing library + extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits, reduced preferences Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/test/data/autofill/automated_integration/autofill_test/runner.py
diff --git a/components/test/data/autofill/automated_integration/autofill_test/runner.py b/components/test/data/autofill/automated_integration/autofill_test/runner.py
new file mode 100644
index 0000000000000000000000000000000000000000..d8a870543d3d705ee6e6eb1ccf5765ed19ce99e6
--- /dev/null
+++ b/components/test/data/autofill/automated_integration/autofill_test/runner.py
@@ -0,0 +1,44 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import unittest
+
+
+class AutofillTestResult(unittest.TextTestResult):
+ """A test result class that can print formatted text results to a stream.
+
+ Used by AutofillTestRunner.
+ """
+
+ def startTest(self, test):
+ """Called when a test is started.
+ """
+ super(unittest.TextTestResult, self).startTest(test)
+ if self.showAll:
+ self.stream.write('Running ')
+ self.stream.write(self.getDescription(test))
+ self.stream.write('\n')
+ self.stream.flush()
+
+ def addFailure(self, test, err):
+ """Logs a test failure as part of the specified test.
+
+ Overloaded to not include the stack trace.
+
+ Args:
+ err: A tuple of values as returned by sys.exc_info().
+ """
+ err = (None, err[1], None)
+ # self.failures.append((test, str(exception)))
+ # self._mirrorOutput = True
+ super(AutofillTestResult, self).addFailure(test, err)
+
+
+class AutofillTestRunner(unittest.TextTestRunner):
+ """An autofill test runner class that displays results in textual form.
+
+ It prints out the names of tests as they are run, errors as they
+ occur, and a summary of the results at the end of the test run.
+ """
+ resultclass = AutofillTestResult

Powered by Google App Engine
This is Rietveld 408576698