diff options
Diffstat (limited to 'sources/pyside2/tests/QtCore')
36 files changed, 172 insertions, 22 deletions
diff --git a/sources/pyside2/tests/QtCore/bug_1063.py b/sources/pyside2/tests/QtCore/bug_1063.py index 2560448e8..1daaaa4dd 100644 --- a/sources/pyside2/tests/QtCore/bug_1063.py +++ b/sources/pyside2/tests/QtCore/bug_1063.py @@ -28,10 +28,14 @@ ''' unit test for BUG #1063 ''' -import unittest +import os +import sys import tempfile +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2 import QtCore -import os import py3kcompat as py3k class QTextStreamTestCase(unittest.TestCase): diff --git a/sources/pyside2/tests/QtCore/bug_938.py b/sources/pyside2/tests/QtCore/bug_938.py index 98b894735..6cbf5018b 100644 --- a/sources/pyside2/tests/QtCore/bug_938.py +++ b/sources/pyside2/tests/QtCore/bug_938.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 * import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/bug_994.py b/sources/pyside2/tests/QtCore/bug_994.py index 3b0ed0fd4..53e822bfc 100644 --- a/sources/pyside2/tests/QtCore/bug_994.py +++ b/sources/pyside2/tests/QtCore/bug_994.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")) + import py3kcompat as py3k from PySide2.QtCore import QIODevice, QTextStream diff --git a/sources/pyside2/tests/QtCore/child_event_test.py b/sources/pyside2/tests/QtCore/child_event_test.py index d9c92d537..f121c975e 100644 --- a/sources/pyside2/tests/QtCore/child_event_test.py +++ b/sources/pyside2/tests/QtCore/child_event_test.py @@ -30,10 +30,13 @@ '''Test case for QObject.childEvent and QTimer.childEvent overloading''' +import os +import sys import unittest -from time import sleep -from PySide2.QtCore import QObject, QTimer, QCoreApplication +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + +from PySide2.QtCore import QObject, QTimer, QCoreApplication from helper import UsesQCoreApplication class ExtQObject(QObject): diff --git a/sources/pyside2/tests/QtCore/deepcopy_test.py b/sources/pyside2/tests/QtCore/deepcopy_test.py index a79ccbe15..87fbe7a82 100644 --- a/sources/pyside2/tests/QtCore/deepcopy_test.py +++ b/sources/pyside2/tests/QtCore/deepcopy_test.py @@ -26,8 +26,12 @@ ## ############################################################################# -import unittest from copy import deepcopy +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 QByteArray, QDate, QDateTime, QTime, QLine, QLineF from PySide2.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QDir, QPoint, QPointF diff --git a/sources/pyside2/tests/QtCore/deletelater_test.py b/sources/pyside2/tests/QtCore/deletelater_test.py index 3c4152f49..7b497f0c9 100644 --- a/sources/pyside2/tests/QtCore/deletelater_test.py +++ b/sources/pyside2/tests/QtCore/deletelater_test.py @@ -30,8 +30,12 @@ '''Test cases for QTimer.singleShot''' +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, QTimer, QCoreApplication, SIGNAL from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/QtCore/duck_punching_test.py b/sources/pyside2/tests/QtCore/duck_punching_test.py index 48d86572a..3115454b1 100644 --- a/sources/pyside2/tests/QtCore/duck_punching_test.py +++ b/sources/pyside2/tests/QtCore/duck_punching_test.py @@ -30,9 +30,13 @@ '''Test case for duck punching new implementations of C++ virtual methods into object instances.''' -import unittest -import types +import os import sys +import types +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py index 2ec6938bb..93527f9d7 100644 --- a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py +++ b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py @@ -31,10 +31,15 @@ '''Tests QByteArray implementation of Python buffer protocol''' +import os +from os.path import isdir +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k -from os.path import isdir from PySide2.QtCore import QByteArray diff --git a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py index 1728c6823..a3986278c 100644 --- a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py +++ b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py @@ -31,8 +31,12 @@ '''Test cases for QByteArray concatenation with '+' operator''' +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 QByteArray import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py index a345db514..15d870bde 100644 --- a/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py +++ b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.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.QtCore import QByteArray from helper.docmodifier import DocModifier import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py index 93140d1e0..69d016a6b 100644 --- a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py +++ b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py @@ -31,7 +31,12 @@ '''Test cases for QByteArray operators''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QByteArray diff --git a/sources/pyside2/tests/QtCore/qbytearray_test.py b/sources/pyside2/tests/QtCore/qbytearray_test.py index 4760fe20b..99813425e 100644 --- a/sources/pyside2/tests/QtCore/qbytearray_test.py +++ b/sources/pyside2/tests/QtCore/qbytearray_test.py @@ -31,9 +31,14 @@ '''Unit tests for QByteArray''' -import unittest import ctypes +import os import pickle +import sys +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QByteArray, QSettings, QObject, QDataStream, QIODevice diff --git a/sources/pyside2/tests/QtCore/qdatastream_test.py b/sources/pyside2/tests/QtCore/qdatastream_test.py index 812c2aab5..b50b1d157 100644 --- a/sources/pyside2/tests/QtCore/qdatastream_test.py +++ b/sources/pyside2/tests/QtCore/qdatastream_test.py @@ -30,7 +30,12 @@ '''Unit tests for QDataStream''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QBitArray, QByteArray, QIODevice, QDataStream, QDate, QTime, QDateTime diff --git a/sources/pyside2/tests/QtCore/qfile_test.py b/sources/pyside2/tests/QtCore/qfile_test.py index 40f861e4c..69208a49d 100644 --- a/sources/pyside2/tests/QtCore/qfile_test.py +++ b/sources/pyside2/tests/QtCore/qfile_test.py @@ -26,11 +26,13 @@ ## ############################################################################# -import unittest - import os -import tempfile import sys +import tempfile +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QDir, QFile, QIODevice, QSaveFile, QTemporaryDir diff --git a/sources/pyside2/tests/QtCore/qfileread_test.py b/sources/pyside2/tests/QtCore/qfileread_test.py index 19e1ea371..16d9082fb 100644 --- a/sources/pyside2/tests/QtCore/qfileread_test.py +++ b/sources/pyside2/tests/QtCore/qfileread_test.py @@ -26,9 +26,11 @@ ## ############################################################################# +import os +import sys import unittest -import os +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) from PySide2.QtCore import QIODevice, QTemporaryFile import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/qjsondocument_test.py b/sources/pyside2/tests/QtCore/qjsondocument_test.py index 0cd4dc5b2..65f83abe3 100644 --- a/sources/pyside2/tests/QtCore/qjsondocument_test.py +++ b/sources/pyside2/tests/QtCore/qjsondocument_test.py @@ -30,7 +30,12 @@ '''Test cases for QJsonDocument/nullptr_t''' +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 QJsonDocument import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py b/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py index 867862de5..2a63e25a2 100644 --- a/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py +++ b/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py @@ -30,8 +30,12 @@ '''Test cases for QMessageAuthenticationCode''' +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 QCryptographicHash, QMessageAuthenticationCode import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py b/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py index fdd71957b..a7774b996 100644 --- a/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py +++ b/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py @@ -30,7 +30,12 @@ ''' Test case for 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/QtCore/qobject_event_filter_test.py b/sources/pyside2/tests/QtCore/qobject_event_filter_test.py index e65757b17..15ba59f37 100644 --- a/sources/pyside2/tests/QtCore/qobject_event_filter_test.py +++ b/sources/pyside2/tests/QtCore/qobject_event_filter_test.py @@ -28,9 +28,12 @@ '''Test cases for QObject.eventFilter''' +import os +import sys import unittest import weakref -import sys + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) from PySide2.QtCore import QObject, QTimerEvent diff --git a/sources/pyside2/tests/QtCore/qobject_test.py b/sources/pyside2/tests/QtCore/qobject_test.py index 2dd767c0d..ade885e7d 100644 --- a/sources/pyside2/tests/QtCore/qobject_test.py +++ b/sources/pyside2/tests/QtCore/qobject_test.py @@ -31,7 +31,12 @@ '''Test cases for QObject methods''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QObject, Signal, Qt diff --git a/sources/pyside2/tests/QtCore/qobject_timer_event_test.py b/sources/pyside2/tests/QtCore/qobject_timer_event_test.py index 39501237e..e960cac7e 100644 --- a/sources/pyside2/tests/QtCore/qobject_timer_event_test.py +++ b/sources/pyside2/tests/QtCore/qobject_timer_event_test.py @@ -30,8 +30,12 @@ '''Test case for QObject.timerEvent overloading''' +import os +import sys import unittest -from time import sleep + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, QCoreApplication from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py b/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py index 420e39103..98ab373e4 100644 --- a/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py +++ b/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py @@ -32,7 +32,12 @@ '''Unit tests for QObject's tr static methods.''' import os +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 #from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/QtCore/qprocess_test.py b/sources/pyside2/tests/QtCore/qprocess_test.py index 23d44a21f..72b2e08cb 100644 --- a/sources/pyside2/tests/QtCore/qprocess_test.py +++ b/sources/pyside2/tests/QtCore/qprocess_test.py @@ -30,8 +30,12 @@ '''Test cases for QProcess''' -import unittest import os +import sys +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import * diff --git a/sources/pyside2/tests/QtCore/qresource_test.py b/sources/pyside2/tests/QtCore/qresource_test.py index 49c4a1049..d6d325951 100644 --- a/sources/pyside2/tests/QtCore/qresource_test.py +++ b/sources/pyside2/tests/QtCore/qresource_test.py @@ -30,7 +30,12 @@ '''Test cases for QResource usage''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from helper import adjust_filename from PySide2.QtCore import QFile, QIODevice import resources_mc diff --git a/sources/pyside2/tests/QtCore/qsettings_test.py b/sources/pyside2/tests/QtCore/qsettings_test.py index 36a4c3c62..c151a5926 100644 --- a/sources/pyside2/tests/QtCore/qsettings_test.py +++ b/sources/pyside2/tests/QtCore/qsettings_test.py @@ -28,9 +28,12 @@ '''Test cases for QDate''' +import os +import sys import unittest -import os +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from helper import adjust_filename import py3kcompat as py3k from PySide2.QtCore import QSettings diff --git a/sources/pyside2/tests/QtCore/qstatemachine_test.py b/sources/pyside2/tests/QtCore/qstatemachine_test.py index 34e107e50..d776a52a1 100644 --- a/sources/pyside2/tests/QtCore/qstatemachine_test.py +++ b/sources/pyside2/tests/QtCore/qstatemachine_test.py @@ -28,7 +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 QObject, QState, QFinalState, SIGNAL from PySide2.QtCore import QTimer, QStateMachine from PySide2.QtCore import QParallelAnimationGroup diff --git a/sources/pyside2/tests/QtCore/qstring_test.py b/sources/pyside2/tests/QtCore/qstring_test.py index e3ac812da..95900bc2f 100644 --- a/sources/pyside2/tests/QtCore/qstring_test.py +++ b/sources/pyside2/tests/QtCore/qstring_test.py @@ -31,7 +31,12 @@ '''Test cases for QString''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QObject diff --git a/sources/pyside2/tests/QtCore/qtextstream_test.py b/sources/pyside2/tests/QtCore/qtextstream_test.py index 6af7f46ba..a5a587d38 100644 --- a/sources/pyside2/tests/QtCore/qtextstream_test.py +++ b/sources/pyside2/tests/QtCore/qtextstream_test.py @@ -28,7 +28,12 @@ '''Unit tests for QTextStream''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QByteArray, QTextStream, QIODevice, QTextCodec, QFile diff --git a/sources/pyside2/tests/QtCore/qthread_test.py b/sources/pyside2/tests/QtCore/qthread_test.py index 1df2c9994..c84022dc7 100644 --- a/sources/pyside2/tests/QtCore/qthread_test.py +++ b/sources/pyside2/tests/QtCore/qthread_test.py @@ -30,7 +30,12 @@ '''Test cases for QThread''' +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 QThread, QCoreApplication, QObject, SIGNAL, QMutex, QTimer from PySide2.QtCore import QEventLoop diff --git a/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py b/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py index e25a97c3e..e74099c77 100644 --- a/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py +++ b/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py @@ -30,8 +30,12 @@ '''Test cases for QTimer.singleShot''' +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, QTimer, QCoreApplication, Signal from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/QtCore/qtimer_timeout_test.py b/sources/pyside2/tests/QtCore/qtimer_timeout_test.py index bb8caf84c..7e6c10f51 100644 --- a/sources/pyside2/tests/QtCore/qtimer_timeout_test.py +++ b/sources/pyside2/tests/QtCore/qtimer_timeout_test.py @@ -28,13 +28,16 @@ '''Test case for timeout() signals from QTimer object.''' -import unittest import os import sys -from tempfile import mkstemp +import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + from PySide2.QtCore import QObject, QTimer, SIGNAL from helper import UsesQCoreApplication + class WatchDog(QObject): '''Exits the QCoreApplication main loop after sometime.''' diff --git a/sources/pyside2/tests/QtCore/qtimezone_test.py b/sources/pyside2/tests/QtCore/qtimezone_test.py index 3d5bd1714..3b9512bea 100644 --- a/sources/pyside2/tests/QtCore/qtimezone_test.py +++ b/sources/pyside2/tests/QtCore/qtimezone_test.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.QtCore import QTimeZone import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/repr_test.py b/sources/pyside2/tests/QtCore/repr_test.py index 0c20c24ec..4bac44c2a 100644 --- a/sources/pyside2/tests/QtCore/repr_test.py +++ b/sources/pyside2/tests/QtCore/repr_test.py @@ -26,9 +26,13 @@ ## ############################################################################# -import PySide2 +import os +import sys import unittest +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + +import PySide2 from PySide2.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF from PySide2.QtCore import Qt, QSize, QSizeF, QRect, QRectF, QPoint, QPointF import py3kcompat as py3k diff --git a/sources/pyside2/tests/QtCore/thread_signals_test.py b/sources/pyside2/tests/QtCore/thread_signals_test.py index 18e289793..811d2055c 100644 --- a/sources/pyside2/tests/QtCore/thread_signals_test.py +++ b/sources/pyside2/tests/QtCore/thread_signals_test.py @@ -28,9 +28,11 @@ ''' Test case for QObject.signalsBlocked() and blockSignal()''' -import unittest import os -from tempfile import mkstemp +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, QFile, QThread, QTimer, Qt from helper import UsesQCoreApplication diff --git a/sources/pyside2/tests/QtCore/translation_test.py b/sources/pyside2/tests/QtCore/translation_test.py index 90eda0623..758c1e277 100644 --- a/sources/pyside2/tests/QtCore/translation_test.py +++ b/sources/pyside2/tests/QtCore/translation_test.py @@ -32,7 +32,11 @@ '''Unit tests to test QTranslator and translation in general.''' import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QObject, QTranslator, QCoreApplication diff --git a/sources/pyside2/tests/QtCore/unicode_test.py b/sources/pyside2/tests/QtCore/unicode_test.py index 6fa169a71..3dee24f47 100644 --- a/sources/pyside2/tests/QtCore/unicode_test.py +++ b/sources/pyside2/tests/QtCore/unicode_test.py @@ -31,7 +31,12 @@ '''Unit tests for QString conversion to/from Python Unicode''' +import os +import sys import unittest + +sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util")) + import py3kcompat as py3k from PySide2.QtCore import QObject |