aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-11-03 14:08:27 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2017-11-08 13:01:22 +0000
commitfa1c97fc2a7f25fe178b0c180b56f78ac00bc4c9 (patch)
tree36f9ab6b58460e93199618489c3c71191b579d71 /sources
parent187f6caf08a015f3fad67813ca5206cdb826982e (diff)
Remove sys.path manipulations from test
The sys.path hack is no longer necessary because we pass a proper PYTHONPATH from the CMakeLists file to the test wrapper. Change-Id: Ie9ad8802e64cf7c9ffec16ae55777d5d23654662 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources')
-rw-r--r--sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py b/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py
index 2e9d260a..6ab60e73 100644
--- a/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py
+++ b/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py
@@ -32,18 +32,14 @@ import sys
from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtWidgets import QWidget
try:
- # the normal call with installed PySide2
+ # The normal import statement when PySide2 is installed.
from PySide2 import shiboken2 as shiboken
except ImportError:
- try:
- # When running make test on macOS, shiboken2 is not part of the PySide2 module,
- # so it needs to be imported as a standalone module.
- 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
+ # When running make test in shiboken build dir, or when running testrunner.py,
+ # shiboken2 is not part of the PySide2 module, so it needs to be imported as a standalone
+ # module.
+ import shiboken2 as shiboken
+
from helper import UsesQApplication