diff options
author | Lauro Neto <lauro.neto@openbossa.org> | 2009-12-14 20:20:07 -0300 |
---|---|---|
committer | Lauro Neto <lauro.neto@openbossa.org> | 2009-12-16 21:14:24 -0300 |
commit | d345245c9d61815829242951e1c5282d4d335919 (patch) | |
tree | cef22fa6d0e2b8f6ec0a8ca09768f90594147239 /tests/util | |
parent | 62bea2811a6673e6e5836269bd0cf4a8e997cfd7 (diff) |
Add empty classes when QtGui's not available
Also, for tests using the UsesQApplication will raise
an NoQtGuiError when QtGui is not available.
Diffstat (limited to 'tests/util')
-rw-r--r-- | tests/util/helper.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/util/helper.py b/tests/util/helper.py index e27ee1ed9..a010934ae 100644 --- a/tests/util/helper.py +++ b/tests/util/helper.py @@ -19,6 +19,10 @@ def adjust_filename(filename, orig_mod_filename): dirpath = os.path.dirname(os.path.abspath(orig_mod_filename)) return os.path.join(dirpath, filename) +class NoQtGuiError(Exception): + def __init__(self): + Exception.__init__(self, 'No QtGui found') + class BasicPySlotCase(object): '''Base class that tests python slots and signal emissions. @@ -71,6 +75,7 @@ if has_gui: del self.app super(UsesQApplication, self).tearDown() + class TimedQApplication(unittest.TestCase): '''Helper class with timed QApplication exec loop''' @@ -88,6 +93,14 @@ if has_gui: def tearDown(self): '''Delete resources''' del self.app +else: + class UsesQApplication(unittest.TestCase): + def setUp(self): + raise NoQtGuiError() + class TimedQapplication(unittest.TestCase): + def setUp(self): + raise NoQtGuiError() + _core_instance = None |