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

Side by Side Diff: build/android/pylib/host_driven/python_test_caller.py

Issue 11649008: Reorganize Android's test scripts into packages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 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 """Helper module for calling python-based tests.""" 5 """Helper module for calling python-based tests."""
6 6
7 7
8 import logging 8 import logging
9 import sys 9 import sys
10 import time 10 import time
11 11
12 from test_result import TestResults 12 from pylib.test_result import TestResults
13 13
14 14
15 def CallPythonTest(test, options): 15 def CallPythonTest(test, options):
16 """Invokes a test function and translates Python exceptions into test results. 16 """Invokes a test function and translates Python exceptions into test results.
17 17
18 This method invokes SetUp()/TearDown() on the test. It is intended to be 18 This method invokes SetUp()/TearDown() on the test. It is intended to be
19 resilient to exceptions in SetUp(), the test itself, and TearDown(). Any 19 resilient to exceptions in SetUp(), the test itself, and TearDown(). Any
20 Python exception means the test is marked as failed, and the test result will 20 Python exception means the test is marked as failed, and the test result will
21 contain information about the exception. 21 contain information about the exception.
22 22
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 test.qualified_name) 75 test.qualified_name)
76 if not failed: 76 if not failed:
77 # Don't stomp the error during the test if TearDown blows up. This is a 77 # Don't stomp the error during the test if TearDown blows up. This is a
78 # trade-off: if the test fails, this will mask any problem with TearDown 78 # trade-off: if the test fails, this will mask any problem with TearDown
79 # until the test is fixed. 79 # until the test is fixed.
80 exc_info = sys.exc_info() 80 exc_info = sys.exc_info()
81 result = TestResults.FromPythonException(test.qualified_name, 81 result = TestResults.FromPythonException(test.qualified_name,
82 start_date_ms, exc_info) 82 start_date_ms, exc_info)
83 83
84 return result 84 return result
OLDNEW
« no previous file with comments | « build/android/pylib/host_driven/python_test_base.py ('k') | build/android/pylib/host_driven/python_test_sharder.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698