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

Side by Side Diff: build/android/pylib/remote/device/remote_device_instrumentation_test_run.py

Issue 1315743004: [Android] Add a custom pylintrc for build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix appurify_sanitized import-errors Created 5 years, 3 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
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 """Run specific test on specific environment.""" 5 """Run specific test on specific environment."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import tempfile 9 import tempfile
10 10
11 from devil.android import apk_helper
12 from pylib import constants
13 from pylib.base import base_test_result 11 from pylib.base import base_test_result
14 from pylib.remote.device import remote_device_test_run 12 from pylib.remote.device import remote_device_test_run
15 13
16 14
17 class RemoteDeviceInstrumentationTestRun( 15 class RemoteDeviceInstrumentationTestRun(
18 remote_device_test_run.RemoteDeviceTestRun): 16 remote_device_test_run.RemoteDeviceTestRun):
19 """Run instrumentation tests on a remote device.""" 17 """Run instrumentation tests on a remote device."""
20 18
21 #override 19 #override
22 def TestPackage(self): 20 def TestPackage(self):
23 return self._test_instance.test_package 21 return self._test_instance.test_package
24 22
25 #override 23 #override
26 def _TriggerSetUp(self): 24 def _TriggerSetUp(self):
27 """Set up the triggering of a test run.""" 25 """Set up the triggering of a test run."""
28 logging.info('Triggering test run.') 26 logging.info('Triggering test run.')
29 27
28 # pylint: disable=protected-access
30 with tempfile.NamedTemporaryFile(suffix='.txt') as test_list_file: 29 with tempfile.NamedTemporaryFile(suffix='.txt') as test_list_file:
31 tests = self._test_instance.GetTests() 30 tests = self._test_instance.GetTests()
32 logging.debug('preparing to run %d instrumentation tests remotely:', 31 logging.debug('preparing to run %d instrumentation tests remotely:',
33 len(tests)) 32 len(tests))
34 for t in tests: 33 for t in tests:
35 test_name = '%s#%s' % (t['class'], t['method']) 34 test_name = '%s#%s' % (t['class'], t['method'])
36 logging.debug(' %s', test_name) 35 logging.debug(' %s', test_name)
37 test_list_file.write('%s\n' % test_name) 36 test_list_file.write('%s\n' % test_name)
38 test_list_file.flush() 37 test_list_file.flush()
39 self._test_instance._data_deps.append( 38 self._test_instance._data_deps.append(
(...skipping 26 matching lines...) Expand all
66 65
67 if isinstance(result, base_test_result.BaseTestResult): 66 if isinstance(result, base_test_result.BaseTestResult):
68 r.AddResult(result) 67 r.AddResult(result)
69 elif isinstance(result, list): 68 elif isinstance(result, list):
70 r.AddResults(result) 69 r.AddResults(result)
71 else: 70 else:
72 raise Exception('Unexpected result type: %s' % type(result).__name__) 71 raise Exception('Unexpected result type: %s' % type(result).__name__)
73 72
74 self._DetectPlatformErrors(r) 73 self._DetectPlatformErrors(r)
75 return r 74 return r
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698