diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-13 09:43:03 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-02-19 21:09:26 +0100 |
commit | 5b868dae533e37b13be7890840191263a2caaa23 (patch) | |
tree | 2de89f87e11aa94a007c45e8452b171caf867ba5 /sources/pyside2/tests/signals | |
parent | 5899fa54279b9d7bfbdda8a8d2a1e60a3c7b264a (diff) |
Make PySide2 tests using the helper modules from 'util' self-contained
Add the relative import path to locate the modules "helper"
and "py3kcompat". The tests can then be launched from the
command line without the ctest environment.
Change-Id: Ia50663d7381b52cb248de3e4d23002a195ca9139
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/tests/signals')
18 files changed, 81 insertions, 4 deletions
diff --git a/sources/pyside2/tests/signals/bug_189.py b/sources/pyside2/tests/signals/bug_189.py index 51810b66c..113cb2485 100644 --- a/sources/pyside2/tests/signals/bug_189.py +++ b/sources/pyside2/tests/signals/bug_189.py @@ -26,8 +26,12 @@ ## ############################################################################# +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2 import QtCore, QtWidgets from helper import UsesQApplication diff --git a/sources/pyside2/tests/signals/bug_311.py b/sources/pyside2/tests/signals/bug_311.py index 2f77bb973..9f5e84dbf 100644 --- a/sources/pyside2/tests/signals/bug_311.py +++ b/sources/pyside2/tests/signals/bug_311.py @@ -29,7 +29,12 @@ ## ############################################################################# +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2 import QtCore from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/bug_319.py b/sources/pyside2/tests/signals/bug_319.py index 7210af072..7e8728e7a 100644 --- a/sources/pyside2/tests/signals/bug_319.py +++ b/sources/pyside2/tests/signals/bug_319.py @@ -29,7 +29,12 @@ ## ############################################################################# +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2 import QtCore from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/lambda_gui_test.py b/sources/pyside2/tests/signals/lambda_gui_test.py index f6eb7b364..0a0db9514 100644 --- a/sources/pyside2/tests/signals/lambda_gui_test.py +++ b/sources/pyside2/tests/signals/lambda_gui_test.py @@ -28,8 +28,12 @@ '''Connecting lambda to gui signals''' +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, SIGNAL try: diff --git a/sources/pyside2/tests/signals/lambda_test.py b/sources/pyside2/tests/signals/lambda_test.py index c22674fcc..97d0c90fc 100644 --- a/sources/pyside2/tests/signals/lambda_test.py +++ b/sources/pyside2/tests/signals/lambda_test.py @@ -30,9 +30,12 @@ '''Connecting lambda to signals''' +import os import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, SIGNAL, QProcess from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/multiple_connections_gui_test.py b/sources/pyside2/tests/signals/multiple_connections_gui_test.py index a80f6277c..45dbb6c94 100644 --- a/sources/pyside2/tests/signals/multiple_connections_gui_test.py +++ b/sources/pyside2/tests/signals/multiple_connections_gui_test.py @@ -26,9 +26,13 @@ ## ############################################################################# -import unittest -import random from functools import partial +import os +import random +import sys +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) from PySide2.QtCore import QObject, SIGNAL diff --git a/sources/pyside2/tests/signals/multiple_connections_test.py b/sources/pyside2/tests/signals/multiple_connections_test.py index 2ce780e4e..9c7e7c9da 100644 --- a/sources/pyside2/tests/signals/multiple_connections_test.py +++ b/sources/pyside2/tests/signals/multiple_connections_test.py @@ -26,9 +26,12 @@ ## ############################################################################# +from functools import partial +import os import sys import unittest -from functools import partial + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) from PySide2.QtCore import QObject, SIGNAL, QProcess diff --git a/sources/pyside2/tests/signals/pysignal_test.py b/sources/pyside2/tests/signals/pysignal_test.py index a5f2d8c5e..51d4f8368 100644 --- a/sources/pyside2/tests/signals/pysignal_test.py +++ b/sources/pyside2/tests/signals/pysignal_test.py @@ -26,7 +26,12 @@ ## ############################################################################# +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, SIGNAL, SLOT, Qt try: diff --git a/sources/pyside2/tests/signals/qobject_sender_test.py b/sources/pyside2/tests/signals/qobject_sender_test.py index 432450bb8..7aa98ced8 100644 --- a/sources/pyside2/tests/signals/qobject_sender_test.py +++ b/sources/pyside2/tests/signals/qobject_sender_test.py @@ -31,7 +31,12 @@ '''Test cases for QObject.sender()''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import * from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/ref02_test.py b/sources/pyside2/tests/signals/ref02_test.py index 5449d6afa..ddd82e3c4 100644 --- a/sources/pyside2/tests/signals/ref02_test.py +++ b/sources/pyside2/tests/signals/ref02_test.py @@ -29,7 +29,12 @@ ## ############################################################################# +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QCoreApplication, QTimeLine from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/ref05_test.py b/sources/pyside2/tests/signals/ref05_test.py index 9bc299332..173027a88 100644 --- a/sources/pyside2/tests/signals/ref05_test.py +++ b/sources/pyside2/tests/signals/ref05_test.py @@ -29,7 +29,12 @@ ## ############################################################################# +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, QCoreApplication, QTimeLine, Slot from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/ref06_test.py b/sources/pyside2/tests/signals/ref06_test.py index a5b26b393..689dd8113 100644 --- a/sources/pyside2/tests/signals/ref06_test.py +++ b/sources/pyside2/tests/signals/ref06_test.py @@ -29,7 +29,12 @@ ## ############################################################################# +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, QCoreApplication, QTimeLine, Signal, Slot from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/self_connect_test.py b/sources/pyside2/tests/signals/self_connect_test.py index ee84a75c5..8620c10d6 100644 --- a/sources/pyside2/tests/signals/self_connect_test.py +++ b/sources/pyside2/tests/signals/self_connect_test.py @@ -30,8 +30,12 @@ '''Using self.connect(signal, method)''' +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, SIGNAL, SLOT from PySide2.QtWidgets import QPushButton, QWidget diff --git a/sources/pyside2/tests/signals/signal_emission_gui_test.py b/sources/pyside2/tests/signals/signal_emission_gui_test.py index a357b1536..0a6255f8a 100644 --- a/sources/pyside2/tests/signals/signal_emission_gui_test.py +++ b/sources/pyside2/tests/signals/signal_emission_gui_test.py @@ -30,8 +30,12 @@ """Tests covering signal emission and receiving to python slots""" +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, SIGNAL, SLOT try: diff --git a/sources/pyside2/tests/signals/signal_emission_test.py b/sources/pyside2/tests/signals/signal_emission_test.py index d4f17700b..844bccc21 100644 --- a/sources/pyside2/tests/signals/signal_emission_test.py +++ b/sources/pyside2/tests/signals/signal_emission_test.py @@ -30,9 +30,12 @@ """Tests covering signal emission and receiving to python slots""" +import functools +import os import sys import unittest -import functools + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) from PySide2.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine diff --git a/sources/pyside2/tests/signals/signal_object_test.py b/sources/pyside2/tests/signals/signal_object_test.py index ab9522b13..75115b37c 100644 --- a/sources/pyside2/tests/signals/signal_object_test.py +++ b/sources/pyside2/tests/signals/signal_object_test.py @@ -28,8 +28,12 @@ ## ############################################################################# +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QTimer, Signal, QObject, Slot, Qt from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/signal_signature_test.py b/sources/pyside2/tests/signals/signal_signature_test.py index 191f209a8..0cce9c2f1 100644 --- a/sources/pyside2/tests/signals/signal_signature_test.py +++ b/sources/pyside2/tests/signals/signal_signature_test.py @@ -30,7 +30,12 @@ '''Test case for signal signature received by QObject::connectNotify().''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import * from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/signals/static_metaobject_test.py b/sources/pyside2/tests/signals/static_metaobject_test.py index b66610f38..2b76e6874 100644 --- a/sources/pyside2/tests/signals/static_metaobject_test.py +++ b/sources/pyside2/tests/signals/static_metaobject_test.py @@ -30,8 +30,12 @@ """Tests covering signal emission and receiving to python slots""" +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, SIGNAL, Slot from helper import UsesQCoreApplication |