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

Unified Diff: tools/telemetry/telemetry/core/gpu_info_unittest.py

Issue 739623005: [Telemetry] Resolve errors due to new pylint checker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ready to land Created 6 years, 1 month 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: tools/telemetry/telemetry/core/gpu_info_unittest.py
diff --git a/tools/telemetry/telemetry/core/gpu_info_unittest.py b/tools/telemetry/telemetry/core/gpu_info_unittest.py
index 0a9b7372640388f42c90da589570e55d4bb1bc15..a402251e7d64fdf86379ac68a45d2a2e37c95b04 100644
--- a/tools/telemetry/telemetry/core/gpu_info_unittest.py
+++ b/tools/telemetry/telemetry/core/gpu_info_unittest.py
@@ -8,26 +8,27 @@ from telemetry.core import gpu_info
class TestGPUInfo(unittest.TestCase):
+
def testConstruction(self):
data = {
- 'devices': [
- { 'vendor_id': 1000, 'device_id': 2000,
- 'vendor_string': 'a', 'device_string': 'b' },
- { 'vendor_id': 3000, 'device_id': 4000,
- 'vendor_string': 'k', 'device_string': 'l' }
- ],
- 'aux_attributes': {
- 'optimus': False,
- 'amd_switchable': False,
- 'lenovo_dcute': False,
- 'driver_vendor': 'c',
- 'driver_version': 'd',
- 'driver_date': 'e',
- 'gl_version_string': 'g',
- 'gl_vendor': 'h',
- 'gl_renderer': 'i',
- 'gl_extensions': 'j',
- }
+ 'devices': [
+ {'vendor_id': 1000, 'device_id': 2000,
+ 'vendor_string': 'a', 'device_string': 'b'},
+ {'vendor_id': 3000, 'device_id': 4000,
+ 'vendor_string': 'k', 'device_string': 'l'}
+ ],
+ 'aux_attributes': {
+ 'optimus': False,
+ 'amd_switchable': False,
+ 'lenovo_dcute': False,
+ 'driver_vendor': 'c',
+ 'driver_version': 'd',
+ 'driver_date': 'e',
+ 'gl_version_string': 'g',
+ 'gl_vendor': 'h',
+ 'gl_renderer': 'i',
+ 'gl_extensions': 'j',
+ }
}
info = gpu_info.GPUInfo.FromDict(data)
self.assertTrue(len(info.devices) == 2)
@@ -54,8 +55,8 @@ class TestGPUInfo(unittest.TestCase):
def testMissingAttrsFromDict(self):
data = {
- 'devices': [{ 'vendor_id': 1000, 'device_id': 2000,
- 'vendor_string': 'a', 'device_string': 'b' }]
+ 'devices': [{'vendor_id': 1000, 'device_id': 2000,
+ 'vendor_string': 'a', 'device_string': 'b'}]
}
for k in data:
@@ -66,12 +67,12 @@ class TestGPUInfo(unittest.TestCase):
self.fail('Should raise exception if attribute "%s" is missing' % k)
except AssertionError:
raise
- except:
+ except KeyError:
pass
def testMissingDevices(self):
data = {
- 'devices': []
+ 'devices': []
}
try:
@@ -79,5 +80,5 @@ class TestGPUInfo(unittest.TestCase):
self.fail('Should raise exception if devices array is empty')
except AssertionError:
raise
- except:
+ except Exception:
pass
« no previous file with comments | « tools/telemetry/telemetry/core/gpu_device_unittest.py ('k') | tools/telemetry/telemetry/core/local_server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698