| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 from contextlib import contextmanager | 5 from contextlib import contextmanager |
| 6 import copy | 6 import copy |
| 7 import inspect | 7 import inspect |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import sys | |
| 11 | 10 |
| 12 from collections import namedtuple | 11 from collections import namedtuple |
| 13 | 12 |
| 14 # These have to do with deriving classes from namedtuple return values. | 13 # These have to do with deriving classes from namedtuple return values. |
| 15 # Pylint can't tell that namedtuple returns a new-style type() object. | 14 # Pylint can't tell that namedtuple returns a new-style type() object. |
| 16 # | 15 # |
| 17 # "no __init__ method" pylint: disable=W0232 | 16 # "no __init__ method" pylint: disable=W0232 |
| 18 # "use of super on an old style class" pylint: disable=E1002 | 17 # "use of super on an old style class" pylint: disable=E1002 |
| 19 | 18 |
| 20 UnknownError = namedtuple('UnknownError', 'message') | 19 UnknownError = namedtuple('UnknownError', 'message') |
| 21 NoMatchingTestsError = namedtuple('NoMatchingTestsError', '') | 20 NoMatchingTestsError = namedtuple('NoMatchingTestsError', '') |
| 22 Result = namedtuple('Result', 'data') | 21 Result = namedtuple('Result', 'data') |
| 23 MultiResult = namedtuple('MultiResult', 'results') | 22 MultiResult = namedtuple('MultiResult', 'results') |
| 24 | 23 |
| 24 |
| 25 class ResultStageAbort(Exception): | 25 class ResultStageAbort(Exception): |
| 26 pass | 26 pass |
| 27 | 27 |
| 28 | 28 |
| 29 class Failure(object): | 29 class Failure(object): |
| 30 pass | 30 pass |
| 31 | 31 |
| 32 | 32 |
| 33 class TestError(namedtuple('TestError', 'test message log_lines')): | 33 class TestError(namedtuple('TestError', 'test message log_lines')): |
| 34 def __new__(cls, test, message, log_lines=()): | 34 def __new__(cls, test, message, log_lines=()): |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 print 'UNHANDLED:', obj | 518 print 'UNHANDLED:', obj |
| 519 return Failure() | 519 return Failure() |
| 520 | 520 |
| 521 def finalize(self, aborted): | 521 def finalize(self, aborted): |
| 522 """Called after __call__() has been called for all results. | 522 """Called after __call__() has been called for all results. |
| 523 | 523 |
| 524 @param aborted: True if the user aborted the run. | 524 @param aborted: True if the user aborted the run. |
| 525 @type aborted: bool | 525 @type aborted: bool |
| 526 """ | 526 """ |
| 527 pass | 527 pass |
| OLD | NEW |