changeset 351:62803b073d11

Add conditional qt5 test
author Windel Bouwman
date Sat, 08 Mar 2014 16:46:51 +0100
parents 2b02bd286fe9
children 899ae3aea803
files test/testhexedit.py
diffstat 1 files changed, 12 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/test/testhexedit.py	Sat Mar 08 16:29:03 2014 +0100
+++ b/test/testhexedit.py	Sat Mar 08 16:46:51 2014 +0100
@@ -1,16 +1,23 @@
 import sys
 import unittest
 
-import hexedit
-#import ide
+try:
+    import hexedit
+    #import ide
 
-from PyQt5.QtWidgets import QApplication
-from PyQt5.QtTest import QTest
-from PyQt5.QtCore import Qt
+    from PyQt5.QtWidgets import QApplication
+    from PyQt5.QtTest import QTest
+    from PyQt5.QtCore import Qt
+    skip_it = False
+except ImportError as e:
+    skip_it = True
 
 
 class HexEditorTest(unittest.TestCase):
     def setUp(self):
+        if skip_it:
+            self.skipTest('No qt5')
+            return
         self.app = QApplication(sys.argv)
         self.ui = hexedit.HexEditor()
         self.bv = self.ui.he.bv