diff options
author | Christian Tismer <tismer@stackless.com> | 2017-02-07 20:01:55 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2017-02-08 08:07:36 +0000 |
commit | 02b853111cccc85f52caebc1ea5d1c76b05eacd8 (patch) | |
tree | 5f190795ad15a87752326dea50d5406f33696f0a | |
parent | ccfa84405957335e75bbbf3bc4243189df59957d (diff) |
Remove an error importing shiboken
A long standing error was in qstandarditemmodel_test.py when shiboken2 was
not found. This is due to quite weird path settings with are generated by ctest.
With an adapted path setting, this now works, and we can again remove
qstandarditemmodel_test.py from the blacklist.
Change-Id: Ia1c3065424a5d600512c6d8e532ac8e59453a552
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
-rw-r--r-- | tests/QtWidgets/qstandarditemmodel_test.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/QtWidgets/qstandarditemmodel_test.py b/tests/QtWidgets/qstandarditemmodel_test.py index d8daba08..9ee00726 100644 --- a/tests/QtWidgets/qstandarditemmodel_test.py +++ b/tests/QtWidgets/qstandarditemmodel_test.py @@ -31,10 +31,17 @@ import sys from PySide2.QtGui import QStandardItemModel, QStandardItem from PySide2.QtWidgets import QWidget -import shiboken2 as shiboken - +try: + # the normal call with installed PySide2 + from PySide2 import shiboken2 as shiboken +except ImportError: + # sys.path is set a bit weird during tests, so we help a little to find shiboken2. + sys.path.append("../../..") + # the special call with testrunner.py + from shiboken2.shibokenmodule import shiboken2 as shiboken from helper import UsesQApplication + class QStandardItemModelTest(UsesQApplication): def setUp(self): |