summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-09 22:56:17 +0000
committertonyg@chromium.org <tonyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-09 22:58:03 +0000
commitd8fe858b9cad89c17e2e65bf10d614ffc7f395d7 (patch)
treef1e60fd6eb41279133bcb6e79df19c5428e01456
parent0e3ec417dad1cc8b84ff1f778d8231c6c5e50f9a (diff)
downloadchromium_src-d8fe858b9cad89c17e2e65bf10d614ffc7f395d7.zip
chromium_src-d8fe858b9cad89c17e2e65bf10d614ffc7f395d7.tar.gz
chromium_src-d8fe858b9cad89c17e2e65bf10d614ffc7f395d7.tar.bz2
[Telemetry] Use IntentionalException instead of DummyException.
IntentionalException doesn't print to the console during unittests. Keeping expected stacks out of unittest output makes the output more scannable by sheriffs and avoids considerable confusion. BUG= Review URL: https://codereview.chromium.org/448383003 Cr-Commit-Position: refs/heads/master@{#288601} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288601 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py b/tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py
index c13be46..0a763f4 100644
--- a/tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py
+++ b/tools/telemetry/telemetry/unittest/gtest_progress_reporter_unittest.py
@@ -5,16 +5,15 @@
import unittest
import sys
+from telemetry.core import exceptions
from telemetry.unittest import gtest_progress_reporter
from telemetry.unittest import simple_mock
-class DummyException(Exception):
- pass
try:
- raise DummyException('Dummy exception')
-except DummyException:
- DUMMY_EXCEPTION = sys.exc_info()
+ raise exceptions.IntentionalException()
+except exceptions.IntentionalException:
+ INTENTIONAL_EXCEPTION = sys.exc_info()
class TestFoo(unittest.TestCase):
@@ -86,7 +85,7 @@ class GTestProgressReporterTest(unittest.TestCase):
test = TestFoo(methodName='runTezt')
self._formatter.StartTest(test)
self._mock_timer.SetTime(0.042)
- self._formatter.Failure(test, DUMMY_EXCEPTION)
+ self._formatter.Failure(test, INTENTIONAL_EXCEPTION)
expected = (
'[ RUN ] gtest_progress_reporter_unittest.TestFoo.runTezt\n'
@@ -117,7 +116,7 @@ class GTestProgressReporterTest(unittest.TestCase):
test = TestFoo(methodName='runTezt')
result = TestResultWithSuccesses()
result.addSuccess(test)
- result.addFailure(test, DUMMY_EXCEPTION)
+ result.addFailure(test, INTENTIONAL_EXCEPTION)
self._formatter.StopTestRun(result)
expected = (