|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
14 | 14 |
|
| 15 | +import importlib.machinery |
| 16 | +import sys |
15 | 17 |
|
| 18 | +import pytest |
| 19 | + |
| 20 | + |
| 21 | +# If this is running on a Python Windows interpreter built in debug mode, skip running tests |
| 22 | +# because we do not have the debug libraries available for PyQt. It is surprisingly tricky to |
| 23 | +# discover whether the current interpreter was built in debug mode (note that this is different |
| 24 | +# than running the interpreter in debug mode, i.e. PYTHONDEBUG=1). The only non-deprecated way |
| 25 | +# we've found is to look for _d.pyd in the extension suffixes, so that is what we do here. |
| 26 | +is_windows_debug = sys.platform == 'win32' and '_d.pyd' in importlib.machinery.EXTENSION_SUFFIXES |
| 27 | + |
| 28 | + |
| 29 | +@pytest.mark.skipif(is_windows_debug, reason='Skipping test on Windows Debug') |
16 | 30 | def test_import_qtcore():
|
17 | 31 | from python_qt_binding import QtCore
|
18 | 32 | assert QtCore is not None
|
19 | 33 |
|
20 | 34 |
|
| 35 | +@pytest.mark.skipif(is_windows_debug, reason='Skipping test on Windows Debug') |
21 | 36 | def test_import_qtgui():
|
22 | 37 | from python_qt_binding import QtGui
|
23 | 38 | assert QtGui is not None
|
24 | 39 |
|
25 | 40 |
|
| 41 | +@pytest.mark.skipif(is_windows_debug, reason='Skipping test on Windows Debug') |
26 | 42 | def test_import_qtwidgets():
|
27 | 43 | from python_qt_binding import QtWidgets
|
28 | 44 | assert QtWidgets is not None
|
29 | 45 |
|
30 | 46 |
|
| 47 | +@pytest.mark.skipif(is_windows_debug, reason='Skipping test on Windows Debug') |
31 | 48 | def test_import_qtobject():
|
32 | 49 | from python_qt_binding.QtCore import QObject
|
33 | 50 | assert QObject is not None
|
0 commit comments