File: QtTest.py

package info (click to toggle)
turing 0.11-4
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 11,560 kB
  • sloc: python: 106,582; xml: 101; makefile: 53; sh: 29
file content (24 lines) | stat: -rw-r--r-- 683 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Provides QtTest and functions

.. warning:: PySide is not supported here, that's why there is not unit tests
    running with PySide.

"""
import os
from pyqode.qt import QT_API
from pyqode.qt import PYQT5_API
from pyqode.qt import PYQT4_API
from pyqode.qt import PYSIDE_API

if os.environ[QT_API] in PYQT5_API:
    from PyQt5.QtTest import QTest
elif os.environ[QT_API] in PYQT4_API:
    from PyQt4.QtTest import QTest as OldQTest

    class QTest(OldQTest):
        @staticmethod
        def qWaitForWindowActive(QWidget):
            OldQTest.qWaitForWindowShown(QWidget)
elif os.environ[QT_API] in PYSIDE_API:
    raise ImportError('QtTest support is incomplete for PySide')