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

Unified Diff: client/site_tests/factory_Keyboard/factory_Keyboard.py

Issue 2819079: Make test failure messages more verbose (and thus useful to testing operators). (Closed) Base URL: ssh://gitrw.chromium.org/autotest.git
Patch Set: Add more test fail messages Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: client/site_tests/factory_Keyboard/factory_Keyboard.py
diff --git a/client/site_tests/factory_Keyboard/factory_Keyboard.py b/client/site_tests/factory_Keyboard/factory_Keyboard.py
index b07588daa243a30b50568b557d9b213191f5e242..1f15cebb6512fee5f1f5e9c0e84b4eb57b186e4d 100644
--- a/client/site_tests/factory_Keyboard/factory_Keyboard.py
+++ b/client/site_tests/factory_Keyboard/factory_Keyboard.py
@@ -133,11 +133,20 @@ class factory_Keyboard(test.test):
factory.log('%s run_once' % self.__class__)
os.chdir(self.srcdir)
- kbd_image = cairo.ImageSurface.create_from_png('%s.png' % layout)
- image_size = (kbd_image.get_width(), kbd_image.get_height())
- with open('%s.bindings' % layout, 'r') as file:
- bindings = eval(file.read())
+ try:
+ kbd_image = cairo.ImageSurface.create_from_png('%s.png' % layout)
+ image_size = (kbd_image.get_width(), kbd_image.get_height())
+ except cairo.Error as e:
+ raise error.TestNAError('Error while opening %s.png: %s' %
+ (layout, e.message))
+
+ try:
+ with open('%s.bindings' % layout, 'r') as file:
+ bindings = eval(file.read())
+ except IOError as e:
+ raise error.TestNAError('Error while opening %s: %s [Errno %d]' %
+ (e.filename, e.strerror, e.errno))
test = KeyboardTest(kbd_image, bindings)
« no previous file with comments | « client/site_tests/factory_ExtDisplay/factory_ExtDisplay.py ('k') | client/site_tests/factory_Leds/factory_Leds.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698