aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-03-04 08:27:14 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-03-04 08:27:14 +0100
commit98d9a82d4a94b91012c9e9cbc7f7c57ddacceac9 (patch)
tree10920682a82713a4579a94e51f54755707af805a
parent7ef372b13fb6393b76029b9b62ebcb4166fa5f70 (diff)
parentcc19c439a64ddc42bc333ee5df7b651a789d6da5 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
-rw-r--r--sources/pyside2/PySide2/QtQuick/typesystem_quick.xml2
-rw-r--r--sources/pyside2/doc/considerations.rst52
-rw-r--r--sources/pyside2/tests/CMakeLists.txt24
-rw-r--r--sources/pyside2/tests/Qt3DExtras/qt3dextras_test.py4
-rw-r--r--sources/pyside2/tests/QtCharts/qcharts_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/attr_cache_py3k.py8
-rw-r--r--sources/pyside2/tests/QtCore/blocking_signals_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/bug_1019.py7
-rw-r--r--sources/pyside2/tests/QtCore/bug_1031.py8
-rw-r--r--sources/pyside2/tests/QtCore/bug_1063.py4
-rw-r--r--sources/pyside2/tests/QtCore/bug_1069.py10
-rw-r--r--sources/pyside2/tests/QtCore/bug_278_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_332.py7
-rw-r--r--sources/pyside2/tests/QtCore/bug_408.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_428.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_462.py7
-rw-r--r--sources/pyside2/tests/QtCore/bug_505.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_515.py8
-rw-r--r--sources/pyside2/tests/QtCore/bug_606.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_656.py8
-rw-r--r--sources/pyside2/tests/QtCore/bug_686.py7
-rw-r--r--sources/pyside2/tests/QtCore/bug_699.py7
-rw-r--r--sources/pyside2/tests/QtCore/bug_706.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_820.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_826.py9
-rw-r--r--sources/pyside2/tests/QtCore/bug_829.py9
-rw-r--r--sources/pyside2/tests/QtCore/bug_835.py9
-rw-r--r--sources/pyside2/tests/QtCore/bug_920.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_927.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_931.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_938.py4
-rw-r--r--sources/pyside2/tests/QtCore/bug_953.py8
-rw-r--r--sources/pyside2/tests/QtCore/bug_987.py10
-rw-r--r--sources/pyside2/tests/QtCore/bug_994.py4
-rw-r--r--sources/pyside2/tests/QtCore/bug_PYSIDE-164.py6
-rw-r--r--sources/pyside2/tests/QtCore/bug_PYSIDE-42.py10
-rw-r--r--sources/pyside2/tests/QtCore/child_event_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/classinfo_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/deepcopy_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/deletelater_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/destroysignal_test.py9
-rw-r--r--sources/pyside2/tests/QtCore/duck_punching_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/emoji_string_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/hash_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/inherits_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/max_signals.py6
-rw-r--r--sources/pyside2/tests/QtCore/missing_symbols_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/mockclass_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/python_conversion.py7
-rw-r--r--sources/pyside2/tests/QtCore/qabs_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qabstractitemmodel_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qabstracttransition_test.py9
-rw-r--r--sources/pyside2/tests/QtCore/qanimationgroup_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qbitarray_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_operator_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qbytearray_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qcalendar_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qcbor_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qcollator_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qcommandlineparser_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qcoreapplication_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qdatastream_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qdate_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qdatetime_test.py8
-rw-r--r--sources/pyside2/tests/QtCore/qeasingcurve_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qenum_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qevent_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qfile_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qfileinfo_test.py8
-rw-r--r--sources/pyside2/tests/QtCore/qfileread_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qflags_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qhandle_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qinstallmsghandler_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qjsondocument_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qlinef_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qlocale_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qlockfile_test.py9
-rw-r--r--sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qmetaobject_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qmimedatabase_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qobject_children_segfault_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qobject_connect_notify_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qobject_destructor.py6
-rw-r--r--sources/pyside2/tests/QtCore/qobject_event_filter_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qobject_inherits_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qobject_objectproperty_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qobject_parent_test.py8
-rw-r--r--sources/pyside2/tests/QtCore/qobject_property_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qobject_protected_methods_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qobject_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qobject_timer_event_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qoperatingsystemversion_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qpoint_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qprocess_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qproperty_decorator.py8
-rw-r--r--sources/pyside2/tests/QtCore/qrandomgenerator_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qrect_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qregexp_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qregularexpression_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qresource_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qsettings_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qsize_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qslot_object_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qsocketnotifier_test.py11
-rw-r--r--sources/pyside2/tests/QtCore/qsrand_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qstandardpaths_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qstate_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qstatemachine_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qstorageinfo_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qstring_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qsysinfo_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/qtext_codec_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qtextstream_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qthread_prod_cons_test.py10
-rw-r--r--sources/pyside2/tests/QtCore/qthread_signal_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qthread_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qtimer_singleshot_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qtimer_timeout_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qtimezone_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/qtnamespace_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qurl_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qurlquery_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/quuid_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/qversionnumber_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/repr_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/setprop_on_ctor_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/staticMetaObject_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/static_method_test.py5
-rw-r--r--sources/pyside2/tests/QtCore/thread_signals_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/tr_noop_test.py7
-rw-r--r--sources/pyside2/tests/QtCore/translation_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/unaryoperator_test.py6
-rw-r--r--sources/pyside2/tests/QtCore/unicode_test.py4
-rw-r--r--sources/pyside2/tests/QtCore/versioninfo_test.py7
-rw-r--r--sources/pyside2/tests/QtDataVisualization/datavisualization_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/bug_1091.py7
-rw-r--r--sources/pyside2/tests/QtGui/bug_300_test.py10
-rw-r--r--sources/pyside2/tests/QtGui/bug_367.py4
-rw-r--r--sources/pyside2/tests/QtGui/bug_480.py6
-rw-r--r--sources/pyside2/tests/QtGui/bug_606.py6
-rw-r--r--sources/pyside2/tests/QtGui/bug_617.py10
-rw-r--r--sources/pyside2/tests/QtGui/bug_652.py9
-rw-r--r--sources/pyside2/tests/QtGui/bug_660.py4
-rw-r--r--sources/pyside2/tests/QtGui/bug_716.py8
-rw-r--r--sources/pyside2/tests/QtGui/bug_740.py4
-rw-r--r--sources/pyside2/tests/QtGui/bug_743.py6
-rw-r--r--sources/pyside2/tests/QtGui/bug_991.py7
-rw-r--r--sources/pyside2/tests/QtGui/bug_PYSIDE-344.py6
-rw-r--r--sources/pyside2/tests/QtGui/bug_PYSIDE-41.py6
-rw-r--r--sources/pyside2/tests/QtGui/deepcopy_test.py8
-rw-r--r--sources/pyside2/tests/QtGui/float_to_int_implicit_conversion_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/pyside_reload_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qcolor_reduce_test.py9
-rw-r--r--sources/pyside2/tests/QtGui/qcolor_test.py10
-rw-r--r--sources/pyside2/tests/QtGui/qcursor_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qdatastream_gui_operators_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qdesktopservices_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/qfontmetrics_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qguiapplication_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/qicon_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qitemselection_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qkeysequence_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qmatrix_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/qopenglbuffer_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qopenglwindow_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qpainter_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/qpdfwriter_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qpixelformat_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qpixmap_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qpixmapcache_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qpolygonf_test.py7
-rw-r--r--sources/pyside2/tests/QtGui/qradialgradient_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/qrasterwindow_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qregion_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qstylehints_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qtextdocument_functions.py6
-rw-r--r--sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qtextline_test.py4
-rw-r--r--sources/pyside2/tests/QtGui/qtransform_test.py7
-rw-r--r--sources/pyside2/tests/QtGui/repr_test.py6
-rw-r--r--sources/pyside2/tests/QtGui/timed_app_and_patching_test.py4
-rw-r--r--sources/pyside2/tests/QtHelp/help_test.py4
-rw-r--r--sources/pyside2/tests/QtHelp/helpsearchengine_test.py4
-rw-r--r--sources/pyside2/tests/QtLocation/location.py10
-rw-r--r--sources/pyside2/tests/QtMultimedia/audio_test.py4
-rw-r--r--sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py4
-rw-r--r--sources/pyside2/tests/QtNetwork/accessManager_test.py4
-rw-r--r--sources/pyside2/tests/QtNetwork/bug_1084.py4
-rw-r--r--sources/pyside2/tests/QtNetwork/bug_446.py4
-rw-r--r--sources/pyside2/tests/QtNetwork/dnslookup_test.py6
-rw-r--r--sources/pyside2/tests/QtNetwork/qipv6address_test.py6
-rw-r--r--sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py6
-rw-r--r--sources/pyside2/tests/QtNetwork/tcpserver_test.py6
-rw-r--r--sources/pyside2/tests/QtNetwork/udpsocket_test.py4
-rw-r--r--sources/pyside2/tests/QtOpenGL/qglbuffer_test.py4
-rw-r--r--sources/pyside2/tests/QtOpenGL/qglwidget_test.py7
-rw-r--r--sources/pyside2/tests/QtPositioning/positioning.py10
-rw-r--r--sources/pyside2/tests/QtPrintSupport/bug_500.py4
-rw-r--r--sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_1029.py8
-rw-r--r--sources/pyside2/tests/QtQml/bug_451.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_456.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_557.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_726.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_814.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_825.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_847.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_915.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_926.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_951.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_995.py4
-rw-r--r--sources/pyside2/tests/QtQml/bug_997.py4
-rw-r--r--sources/pyside2/tests/QtQml/connect_python_qml.py4
-rw-r--r--sources/pyside2/tests/QtQml/javascript_exceptions.py4
-rw-r--r--sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py4
-rw-r--r--sources/pyside2/tests/QtQml/qqmlnetwork_test.py4
-rw-r--r--sources/pyside2/tests/QtQml/qquickitem_grabToImage.py4
-rw-r--r--sources/pyside2/tests/QtQml/qquickview_test.py4
-rw-r--r--sources/pyside2/tests/QtQml/registertype.py4
-rw-r--r--sources/pyside2/tests/QtQml/signal_arguments.py4
-rw-r--r--sources/pyside2/tests/QtScript/base_test.py7
-rw-r--r--sources/pyside2/tests/QtScript/bug_1022.py6
-rw-r--r--sources/pyside2/tests/QtScript/engine_test.py6
-rw-r--r--sources/pyside2/tests/QtScript/property_test.py6
-rw-r--r--sources/pyside2/tests/QtScript/qscriptvalue_test.py4
-rw-r--r--sources/pyside2/tests/QtScriptTools/debugger_test.py4
-rw-r--r--sources/pyside2/tests/QtScxml/test_dynamic.py4
-rw-r--r--sources/pyside2/tests/QtSensors/sensors.py10
-rw-r--r--sources/pyside2/tests/QtSql/bug_1013.py10
-rw-r--r--sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py6
-rw-r--r--sources/pyside2/tests/QtSql/qvarianttype_test.py4
-rw-r--r--sources/pyside2/tests/QtSvg/qsvggenerator_test.py9
-rw-r--r--sources/pyside2/tests/QtSvg/qsvgrenderer_test.py9
-rw-r--r--sources/pyside2/tests/QtSvg/qsvgwidget_test.py9
-rw-r--r--sources/pyside2/tests/QtTest/click_test.py4
-rw-r--r--sources/pyside2/tests/QtTest/eventfilter_test.py4
-rw-r--r--sources/pyside2/tests/QtTest/qvalidator_test.py4
-rw-r--r--sources/pyside2/tests/QtTest/touchevent_test.py4
-rw-r--r--sources/pyside2/tests/QtTextToSpeech/qtexttospeech_test.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_1060.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_360.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_376.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_392.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_426.py8
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_552.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_797.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_909.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_913.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_958.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/bug_965.py7
-rw-r--r--sources/pyside2/tests/QtUiTools/ui_test.py4
-rw-r--r--sources/pyside2/tests/QtUiTools/uiloader_test.py4
-rw-r--r--sources/pyside2/tests/QtWebEngine/web_engine_initialize.py6
-rw-r--r--sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py4
-rw-r--r--sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py6
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_448.py7
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_694.py6
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_803.py7
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_899.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/bug_959.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/qml_plugin_test.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/webframe_test.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/webpage_test.py4
-rw-r--r--sources/pyside2/tests/QtWebKit/webview_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/action_clear.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/add_action_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/api2_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/application_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_1002.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_1006.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_1048.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_1077.py11
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_172.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_243.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_307.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_324.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_338.py5
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_363.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_389.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_400.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_416.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_429.py10
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_430.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_433.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_467.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_493.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_512.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_525.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_546.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_547.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_549.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_569.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_575.py10
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_576.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_585.py5
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_589.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_632.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_635.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_640.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_653.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_662.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_667.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_668.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_674.py11
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_675.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_688.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_693.py10
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_696.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_711.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_714.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_722.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_728.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_736.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_750.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_778.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_785.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_793.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_811.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_834.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_836.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_844.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_854.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_860.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_862.py9
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_871.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_879.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_919.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_921.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_941.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_964.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_967.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_972.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_979.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_988.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/bug_998.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/customproxywidget_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/event_filter_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/grandparent_method_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/hashabletype_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/keep_reference_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/missing_symbols_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/paint_event_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/parent_method_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/private_mangle_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/python_properties_test.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qaction_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qapp_issue_585.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/qapp_test.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/qapplication_exit_segfault_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/qapplication_test.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/qbrush_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qcolormap_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qdynamic_signal.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qfontdialog_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qformlayout_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qgraphicsitem_isblocked_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qgraphicsitem_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qgraphicsobjectreimpl_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qgraphicsproxywidget_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qgraphicsscene_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qimage_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qlabel_test.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/qlayout_ref_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qlayout_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qlcdnumber_test.py6
-rw-r--r--sources/pyside2/tests/QtWidgets/qlistwidget_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qmainwindow_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qmenu_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qmenuadd_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qobject_mi_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qpen_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qpicture_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qpixmap_constructor.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qpushbutton_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qshortcut_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/qsplitter_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qstyle_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtableview_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtabwidget_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtabwidgetclear_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtextedit_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtoolbar_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtoolbox_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtreeview_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qtreewidget_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qvariant_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/qwidget_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/reference_count_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/signature_test.py7
-rw-r--r--sources/pyside2/tests/QtWidgets/standardpixmap_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/test_module_template.py8
-rw-r--r--sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py4
-rw-r--r--sources/pyside2/tests/QtWidgets/wrong_return_test.py4
-rw-r--r--sources/pyside2/tests/QtXml/qdomdocument_test.py4
-rw-r--r--sources/pyside2/tests/QtXml/qxmlsimplereader_test.py7
-rw-r--r--sources/pyside2/tests/QtXmlPatterns/import_test.py4
-rw-r--r--sources/pyside2/tests/init_paths.py104
-rw-r--r--sources/pyside2/tests/mac/qmacstyle_test.py9
-rw-r--r--sources/pyside2/tests/pysidetest/all_modules_load_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/bug_1016.py10
-rw-r--r--sources/pyside2/tests/pysidetest/constructor_properties_test.py4
-rw-r--r--sources/pyside2/tests/pysidetest/decoratedslot_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py8
-rw-r--r--sources/pyside2/tests/pysidetest/embedding_test.py6
-rw-r--r--sources/pyside2/tests/pysidetest/enum_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/iterable_test.py5
-rw-r--r--sources/pyside2/tests/pysidetest/list_signal_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/modelview_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/new_inherited_functions_test.py6
-rw-r--r--sources/pyside2/tests/pysidetest/notify_id.py7
-rw-r--r--sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/qvariant_test.py6
-rw-r--r--sources/pyside2/tests/pysidetest/repr_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/signal_slot_warning.py10
-rw-r--r--sources/pyside2/tests/pysidetest/signalandnamespace_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py7
-rw-r--r--sources/pyside2/tests/pysidetest/typedef_signal_test.py6
-rw-r--r--sources/pyside2/tests/pysidetest/version_test.py7
-rw-r--r--sources/pyside2/tests/registry/existence_test.py7
-rw-r--r--sources/pyside2/tests/signals/args_dont_match_test.py7
-rw-r--r--sources/pyside2/tests/signals/bug_189.py4
-rw-r--r--sources/pyside2/tests/signals/bug_311.py4
-rw-r--r--sources/pyside2/tests/signals/bug_312.py8
-rw-r--r--sources/pyside2/tests/signals/bug_319.py4
-rw-r--r--sources/pyside2/tests/signals/bug_79.py9
-rw-r--r--sources/pyside2/tests/signals/decorators_test.py6
-rw-r--r--sources/pyside2/tests/signals/disconnect_test.py10
-rw-r--r--sources/pyside2/tests/signals/invalid_callback_test.py6
-rw-r--r--sources/pyside2/tests/signals/lambda_gui_test.py4
-rw-r--r--sources/pyside2/tests/signals/lambda_test.py4
-rw-r--r--sources/pyside2/tests/signals/leaking_signal_test.py10
-rw-r--r--sources/pyside2/tests/signals/multiple_connections_gui_test.py4
-rw-r--r--sources/pyside2/tests/signals/multiple_connections_test.py4
-rw-r--r--sources/pyside2/tests/signals/pysignal_test.py4
-rw-r--r--sources/pyside2/tests/signals/qobject_destroyed_test.py6
-rw-r--r--sources/pyside2/tests/signals/qobject_receivers_test.py7
-rw-r--r--sources/pyside2/tests/signals/qobject_sender_test.py4
-rw-r--r--sources/pyside2/tests/signals/ref01_test.py7
-rw-r--r--sources/pyside2/tests/signals/ref02_test.py4
-rw-r--r--sources/pyside2/tests/signals/ref03_test.py9
-rw-r--r--sources/pyside2/tests/signals/ref04_test.py7
-rw-r--r--sources/pyside2/tests/signals/ref05_test.py4
-rw-r--r--sources/pyside2/tests/signals/ref06_test.py4
-rw-r--r--sources/pyside2/tests/signals/segfault_proxyparent_test.py6
-rw-r--r--sources/pyside2/tests/signals/self_connect_test.py4
-rw-r--r--sources/pyside2/tests/signals/short_circuit_test.py6
-rw-r--r--sources/pyside2/tests/signals/signal2signal_connect_test.py7
-rw-r--r--sources/pyside2/tests/signals/signal_autoconnect_test.py6
-rw-r--r--sources/pyside2/tests/signals/signal_connectiontype_support_test.py6
-rw-r--r--sources/pyside2/tests/signals/signal_emission_gui_test.py4
-rw-r--r--sources/pyside2/tests/signals/signal_emission_test.py4
-rw-r--r--sources/pyside2/tests/signals/signal_func_test.py6
-rw-r--r--sources/pyside2/tests/signals/signal_manager_refcount_test.py8
-rw-r--r--sources/pyside2/tests/signals/signal_number_limit_test.py7
-rw-r--r--sources/pyside2/tests/signals/signal_object_test.py4
-rw-r--r--sources/pyside2/tests/signals/signal_signature_test.py4
-rw-r--r--sources/pyside2/tests/signals/signal_with_primitive_type_test.py7
-rw-r--r--sources/pyside2/tests/signals/slot_reference_count_test.py8
-rw-r--r--sources/pyside2/tests/signals/static_metaobject_test.py4
-rw-r--r--sources/pyside2/tests/support/voidptr_test.py7
-rw-r--r--sources/pyside2/tests/util/py2xfunctions.py46
-rw-r--r--sources/pyside2/tests/util/py3kcompat.py50
-rw-r--r--sources/pyside2/tests/util/py3xfunctions.py54
-rw-r--r--sources/shiboken2/ApiExtractor/typesystem.h3
-rw-r--r--sources/shiboken2/ApiExtractor/typesystemparser.cpp4
-rw-r--r--sources/shiboken2/doc/typesystem_specifying_types.rst5
-rw-r--r--sources/shiboken2/generator/main.cpp2
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.cpp71
-rw-r--r--sources/shiboken2/generator/shiboken2/cppgenerator.h3
-rw-r--r--sources/shiboken2/generator/shiboken2/headergenerator.cpp13
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.cpp29
-rw-r--r--sources/shiboken2/generator/shiboken2/shibokengenerator.h6
-rw-r--r--sources/shiboken2/libshiboken/bindingmanager.cpp8
-rw-r--r--sources/shiboken2/tests/py3kcompat.py38
-rw-r--r--sources/shiboken2/tests/shiboken_paths.py78
-rw-r--r--tools/create_changelog.py82
497 files changed, 2881 insertions, 509 deletions
diff --git a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml
index 223eff773..12c1ac33d 100644
--- a/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml
+++ b/sources/pyside2/PySide2/QtQuick/typesystem_quick.xml
@@ -64,7 +64,7 @@
<object-type name="QQuickImageResponse" since="5.6"/>
<object-type name="QQuickTransform"/>
- <object-type name="QQuickItem" delete-in-main-thread="true">
+ <object-type name="QQuickItem" delete-in-main-thread="true" no-override-caching="true">
<value-type name="UpdatePaintNodeData"/>
<enum-type name="Flag" flags="Flags"/>
<enum-type name="ItemChange"/>
diff --git a/sources/pyside2/doc/considerations.rst b/sources/pyside2/doc/considerations.rst
index c8d24d13d..f05d929b5 100644
--- a/sources/pyside2/doc/considerations.rst
+++ b/sources/pyside2/doc/considerations.rst
@@ -22,7 +22,7 @@ same hash.
QString
-~~~~~~~~
+~~~~~~~
Methods and functions that change the contents of a QString argument were modified to receive an
immutable Python Unicode (or str) and return another Python Unicode/str as the modified string.
@@ -83,3 +83,53 @@ its original Python object type.
When a method expects a ``QVariant::Type`` the programmer can use a string (the type name) or the
type itself.
+
+
+qApp "macro"
+~~~~~~~~~~~~
+
+The C++ API of QtWidgets provides a macro called ``qApp`` that roughly expands to
+``QtWidgets::QApplication->instance()``.
+
+In PySide, we tried to create a macro-like experience.
+For that, the ``qApp`` variable was implemented as a normal variable
+that lives in the builtins.
+After importing ``PySide2``, you can immediately use ``qApp``.
+
+As a useful shortcut for the action "create an application if it was not created", we recommend::
+
+ qApp or QtWidgets.QApplication()
+
+or if you want to check if there is one, simply use the truth value::
+
+ if qApp:
+ # do something if an application was created
+ pass
+
+Comparing to ``None`` is also possible, but slightly over-specified.
+
+
+Testing support
++++++++++++++++
+
+For testing purposes, you can also get rid of the application by calling::
+
+ qApp.shutdown()
+
+As for 5.14.2, this is currently an experimental feature that is not fully tested.
+
+
+Embedding status
+++++++++++++++++
+
+In embedded mode, application objects that are pre-created in C++ don't have a Python wrapper.
+The ``qApp`` variable is created together with a wrapped application.
+Therefore, ``qApp`` does not exist in that embedded mode.
+Please note that you always can use ``QtWidgets.QApplication.instance()`` instead.
+
+
+Abandoned Alternative
++++++++++++++++++++++
+
+We also tried an alternative implementation with a ``qApp()`` function that was more *pythonic*
+and problem free, but many people liked the ``qApp`` macro better for its brevity, so here it is.
diff --git a/sources/pyside2/tests/CMakeLists.txt b/sources/pyside2/tests/CMakeLists.txt
index 08585252c..60179d81f 100644
--- a/sources/pyside2/tests/CMakeLists.txt
+++ b/sources/pyside2/tests/CMakeLists.txt
@@ -5,23 +5,11 @@ else()
set(CTEST_TESTING_TIMEOUT 60)
endif()
- # tests/QtWidgets/qstandarditemmodel_test.py needs shiboken2
- # tests/QtWidgets/qlabel_test.py needs shiboken2
- if(WIN32)
- set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${CMAKE_BINARY_DIR}/tests/pysidetest;${SHIBOKEN_PYTHON_MODULE_DIR};$ENV{PYTHONPATH}")
- set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_SHARED_LIBRARY_DIR};$ENV{PATH}")
- set(LIBRARY_PATH_VAR "PATH")
- string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
- string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
-
- string(REPLACE ";" "\\;" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
- string(REPLACE ";" "\\;" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
- else()
- set(TEST_PYTHONPATH "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util:${CMAKE_BINARY_DIR}/tests/pysidetest:${CMAKE_BINARY_DIR}/../shiboken2/shibokenmodule:$ENV{PYTHONPATH}")
- set(TEST_LIBRARY_PATH "${libpyside_BINARY_DIR}:${pysidetest_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
- set(LIBRARY_PATH_VAR "LD_LIBRARY_PATH")
- endif()
-
+ # BUILD_DIR and QT_DIR are used by init_paths.py for setting
+ # the path to the testbinding module
+ get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY)
+ get_filename_component(BUILD_DIR "${CMAKE_BINARY_DIR}" DIRECTORY)
+ set(QT_DIR "${_qt5Core_install_prefix}")
macro(TEST_QT_MODULE var name)
if(NOT DISABLE_${name} AND ${var})
@@ -46,7 +34,7 @@ else()
set_tests_properties(${TEST_NAME} PROPERTIES
TIMEOUT ${CTEST_TESTING_TIMEOUT}
WILL_FAIL ${EXPECT_TO_FAIL}
- ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1")
+ ENVIRONMENT "BUILD_DIR=${BUILD_DIR};QT_DIR=${QT_DIR};PYSIDE_DISABLE_INTERNAL_QT_CONF=1;QT_NO_GLIB=1")
endmacro()
if (NOT DISABLE_QtCore AND NOT DISABLE_QtGui AND NOT DISABLE_QtWidgets)
diff --git a/sources/pyside2/tests/Qt3DExtras/qt3dextras_test.py b/sources/pyside2/tests/Qt3DExtras/qt3dextras_test.py
index 2f7cc21aa..97ddc8af9 100644
--- a/sources/pyside2/tests/Qt3DExtras/qt3dextras_test.py
+++ b/sources/pyside2/tests/Qt3DExtras/qt3dextras_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqguiapplication import UsesQGuiApplication
diff --git a/sources/pyside2/tests/QtCharts/qcharts_test.py b/sources/pyside2/tests/QtCharts/qcharts_test.py
index 6605c2218..dc10fceb2 100644
--- a/sources/pyside2/tests/QtCharts/qcharts_test.py
+++ b/sources/pyside2/tests/QtCharts/qcharts_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QRect, QSize, QTimer
diff --git a/sources/pyside2/tests/QtCore/attr_cache_py3k.py b/sources/pyside2/tests/QtCore/attr_cache_py3k.py
index f9761a9d3..558fe0e2b 100644
--- a/sources/pyside2/tests/QtCore/attr_cache_py3k.py
+++ b/sources/pyside2/tests/QtCore/attr_cache_py3k.py
@@ -46,6 +46,14 @@ This is the original code from the bug report
https://bugreports.qt.io/browse/PYSIDE-60
'''
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import QObject
diff --git a/sources/pyside2/tests/QtCore/blocking_signals_test.py b/sources/pyside2/tests/QtCore/blocking_signals_test.py
index 2f8b95b27..c3497c89f 100644
--- a/sources/pyside2/tests/QtCore/blocking_signals_test.py
+++ b/sources/pyside2/tests/QtCore/blocking_signals_test.py
@@ -28,9 +28,14 @@
''' Test case for QObject.signalsBlocked() and blockSignal()'''
-import unittest
import os
+import sys
from tempfile import mkstemp
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, QFile, QSignalBlocker
diff --git a/sources/pyside2/tests/QtCore/bug_1019.py b/sources/pyside2/tests/QtCore/bug_1019.py
index bc4b9b679..404e71bfc 100644
--- a/sources/pyside2/tests/QtCore/bug_1019.py
+++ b/sources/pyside2/tests/QtCore/bug_1019.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class MyTimer (QTimer):
diff --git a/sources/pyside2/tests/QtCore/bug_1031.py b/sources/pyside2/tests/QtCore/bug_1031.py
index 1fb0d6ebd..6a7f248cc 100644
--- a/sources/pyside2/tests/QtCore/bug_1031.py
+++ b/sources/pyside2/tests/QtCore/bug_1031.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import QStateMachine, QState
mach = QStateMachine()
diff --git a/sources/pyside2/tests/QtCore/bug_1063.py b/sources/pyside2/tests/QtCore/bug_1063.py
index 1daaaa4dd..73291bffc 100644
--- a/sources/pyside2/tests/QtCore/bug_1063.py
+++ b/sources/pyside2/tests/QtCore/bug_1063.py
@@ -33,7 +33,9 @@ import sys
import tempfile
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/bug_1069.py b/sources/pyside2/tests/QtCore/bug_1069.py
index d784062e3..690553e72 100644
--- a/sources/pyside2/tests/QtCore/bug_1069.py
+++ b/sources/pyside2/tests/QtCore/bug_1069.py
@@ -28,9 +28,17 @@
''' unit test for BUG #1069 '''
-from PySide2 import QtCore
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2 import QtCore
+
+
class QDataStreamOpOverloadTestCase(unittest.TestCase):
def setUp(self):
self.ba = QtCore.QByteArray()
diff --git a/sources/pyside2/tests/QtCore/bug_278_test.py b/sources/pyside2/tests/QtCore/bug_278_test.py
index e0f07d119..cc99136e7 100644
--- a/sources/pyside2/tests/QtCore/bug_278_test.py
+++ b/sources/pyside2/tests/QtCore/bug_278_test.py
@@ -28,8 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
def setValue(o):
diff --git a/sources/pyside2/tests/QtCore/bug_332.py b/sources/pyside2/tests/QtCore/bug_332.py
index 662a0f632..f49845cf9 100644
--- a/sources/pyside2/tests/QtCore/bug_332.py
+++ b/sources/pyside2/tests/QtCore/bug_332.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
class Lock(QtCore.QMutex):
diff --git a/sources/pyside2/tests/QtCore/bug_408.py b/sources/pyside2/tests/QtCore/bug_408.py
index b2f97df69..bdb7c1af5 100644
--- a/sources/pyside2/tests/QtCore/bug_408.py
+++ b/sources/pyside2/tests/QtCore/bug_408.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class MyDevice(QIODevice):
diff --git a/sources/pyside2/tests/QtCore/bug_428.py b/sources/pyside2/tests/QtCore/bug_428.py
index d1504876b..b4c8f9632 100644
--- a/sources/pyside2/tests/QtCore/bug_428.py
+++ b/sources/pyside2/tests/QtCore/bug_428.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
class MyBaseObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/bug_462.py b/sources/pyside2/tests/QtCore/bug_462.py
index 5186ac759..e929be0af 100644
--- a/sources/pyside2/tests/QtCore/bug_462.py
+++ b/sources/pyside2/tests/QtCore/bug_462.py
@@ -26,8 +26,13 @@
##
#############################################################################
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QCoreApplication, QEvent, QThread
diff --git a/sources/pyside2/tests/QtCore/bug_505.py b/sources/pyside2/tests/QtCore/bug_505.py
index c1d434c7f..4db6b801d 100644
--- a/sources/pyside2/tests/QtCore/bug_505.py
+++ b/sources/pyside2/tests/QtCore/bug_505.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
class MyBaseObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/bug_515.py b/sources/pyside2/tests/QtCore/bug_515.py
index d4ca3f463..a96a8c193 100644
--- a/sources/pyside2/tests/QtCore/bug_515.py
+++ b/sources/pyside2/tests/QtCore/bug_515.py
@@ -29,6 +29,14 @@
""" Unittest for bug #515 """
""" http://bugs.openbossa.org/show_bug.cgi?id=515 """
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2 import QtCore
callCleanup = False
diff --git a/sources/pyside2/tests/QtCore/bug_606.py b/sources/pyside2/tests/QtCore/bug_606.py
index 44126e943..423b088dc 100644
--- a/sources/pyside2/tests/QtCore/bug_606.py
+++ b/sources/pyside2/tests/QtCore/bug_606.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
from PySide2.QtCore import QPoint, QPointF
from PySide2.QtCore import QLine, QLineF
diff --git a/sources/pyside2/tests/QtCore/bug_656.py b/sources/pyside2/tests/QtCore/bug_656.py
index 1b9fe6a9c..d3cd05f28 100644
--- a/sources/pyside2/tests/QtCore/bug_656.py
+++ b/sources/pyside2/tests/QtCore/bug_656.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
class CoreApp(QCoreApplication):
diff --git a/sources/pyside2/tests/QtCore/bug_686.py b/sources/pyside2/tests/QtCore/bug_686.py
index fa8ad8d65..6e4f8994a 100644
--- a/sources/pyside2/tests/QtCore/bug_686.py
+++ b/sources/pyside2/tests/QtCore/bug_686.py
@@ -28,7 +28,14 @@
from __future__ import with_statement
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class MyWriteThread(QThread):
diff --git a/sources/pyside2/tests/QtCore/bug_699.py b/sources/pyside2/tests/QtCore/bug_699.py
index 98340f3df..c86c485f9 100644
--- a/sources/pyside2/tests/QtCore/bug_699.py
+++ b/sources/pyside2/tests/QtCore/bug_699.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class TestBug699 (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/bug_706.py b/sources/pyside2/tests/QtCore/bug_706.py
index 1984cfff9..21743bf25 100644
--- a/sources/pyside2/tests/QtCore/bug_706.py
+++ b/sources/pyside2/tests/QtCore/bug_706.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class MyModel (QAbstractListModel):
diff --git a/sources/pyside2/tests/QtCore/bug_820.py b/sources/pyside2/tests/QtCore/bug_820.py
index f55954295..5d45f682e 100644
--- a/sources/pyside2/tests/QtCore/bug_820.py
+++ b/sources/pyside2/tests/QtCore/bug_820.py
@@ -27,8 +27,14 @@
#############################################################################
import functools
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Slot, Signal, SIGNAL
def log_exception():
diff --git a/sources/pyside2/tests/QtCore/bug_826.py b/sources/pyside2/tests/QtCore/bug_826.py
index b5701fc5a..cb72e011e 100644
--- a/sources/pyside2/tests/QtCore/bug_826.py
+++ b/sources/pyside2/tests/QtCore/bug_826.py
@@ -26,10 +26,17 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QEvent, Qt
import PySide2
-import unittest
TEST_EVENT_TYPE = QEvent.Type(QEvent.registerEventType())
diff --git a/sources/pyside2/tests/QtCore/bug_829.py b/sources/pyside2/tests/QtCore/bug_829.py
index 1384c017a..237ae0406 100644
--- a/sources/pyside2/tests/QtCore/bug_829.py
+++ b/sources/pyside2/tests/QtCore/bug_829.py
@@ -29,9 +29,16 @@
# Test case for PySide bug 829
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QDir, QSettings, QTemporaryFile
-import os
+
class QVariantConversions(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/bug_835.py b/sources/pyside2/tests/QtCore/bug_835.py
index 59cb612ac..e72ce500c 100644
--- a/sources/pyside2/tests/QtCore/bug_835.py
+++ b/sources/pyside2/tests/QtCore/bug_835.py
@@ -26,9 +26,16 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
-import unittest
get_counter = 0
set_counter = 0
diff --git a/sources/pyside2/tests/QtCore/bug_920.py b/sources/pyside2/tests/QtCore/bug_920.py
index 196727668..b0cd84e6a 100644
--- a/sources/pyside2/tests/QtCore/bug_920.py
+++ b/sources/pyside2/tests/QtCore/bug_920.py
@@ -28,8 +28,14 @@
##
#############################################################################
+import os
import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2.QtCore as QtCore
class Signaller(QtCore.QObject):
diff --git a/sources/pyside2/tests/QtCore/bug_927.py b/sources/pyside2/tests/QtCore/bug_927.py
index 1a5be71f7..1883bf5e8 100644
--- a/sources/pyside2/tests/QtCore/bug_927.py
+++ b/sources/pyside2/tests/QtCore/bug_927.py
@@ -26,9 +26,15 @@
##
#############################################################################
+import os
+import sys
import time
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QTime, QRunnable, QThreadPool
class Task(QRunnable):
diff --git a/sources/pyside2/tests/QtCore/bug_931.py b/sources/pyside2/tests/QtCore/bug_931.py
index 528a0847d..8220ecaba 100644
--- a/sources/pyside2/tests/QtCore/bug_931.py
+++ b/sources/pyside2/tests/QtCore/bug_931.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Signal
o = QObject()
class MyObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/bug_938.py b/sources/pyside2/tests/QtCore/bug_938.py
index 6cbf5018b..bbac1845b 100644
--- a/sources/pyside2/tests/QtCore/bug_938.py
+++ b/sources/pyside2/tests/QtCore/bug_938.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/bug_953.py b/sources/pyside2/tests/QtCore/bug_953.py
index 2aa2b638d..a250ebe32 100644
--- a/sources/pyside2/tests/QtCore/bug_953.py
+++ b/sources/pyside2/tests/QtCore/bug_953.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
class Dispatcher(QObject):
diff --git a/sources/pyside2/tests/QtCore/bug_987.py b/sources/pyside2/tests/QtCore/bug_987.py
index e5c7f1b0b..56e5e517e 100644
--- a/sources/pyside2/tests/QtCore/bug_987.py
+++ b/sources/pyside2/tests/QtCore/bug_987.py
@@ -26,10 +26,16 @@
##
#############################################################################
-from PySide2.QtCore import QObject
-
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtCore import QObject
+
class TestBug987(unittest.TestCase):
def callback(self):
diff --git a/sources/pyside2/tests/QtCore/bug_994.py b/sources/pyside2/tests/QtCore/bug_994.py
index 53e822bfc..1a9649a10 100644
--- a/sources/pyside2/tests/QtCore/bug_994.py
+++ b/sources/pyside2/tests/QtCore/bug_994.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2.QtCore import QIODevice, QTextStream
diff --git a/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py b/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py
index 3ed10be5f..96c892fd6 100644
--- a/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py
+++ b/sources/pyside2/tests/QtCore/bug_PYSIDE-164.py
@@ -28,8 +28,14 @@
from __future__ import print_function
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCoreApplication, QEventLoop, QObject, Qt, QThread, QTimer, SIGNAL
class Emitter(QThread):
diff --git a/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py b/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py
index 9555bb419..46e3c6d11 100644
--- a/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py
+++ b/sources/pyside2/tests/QtCore/bug_PYSIDE-42.py
@@ -26,9 +26,17 @@
##
#############################################################################
-from PySide2.QtCore import *
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtCore import *
+
+
class TestBugPYSIDE42 (unittest.TestCase):
def testIt(self):
diff --git a/sources/pyside2/tests/QtCore/child_event_test.py b/sources/pyside2/tests/QtCore/child_event_test.py
index 4a6ea6793..8c600210a 100644
--- a/sources/pyside2/tests/QtCore/child_event_test.py
+++ b/sources/pyside2/tests/QtCore/child_event_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimer, QCoreApplication
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/classinfo_test.py b/sources/pyside2/tests/QtCore/classinfo_test.py
index a1890f956..634e8f350 100644
--- a/sources/pyside2/tests/QtCore/classinfo_test.py
+++ b/sources/pyside2/tests/QtCore/classinfo_test.py
@@ -27,8 +27,14 @@
#############################################################################
import sys
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, QCoreApplication, ClassInfo
class TestClassInfo(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/deepcopy_test.py b/sources/pyside2/tests/QtCore/deepcopy_test.py
index 87fbe7a82..ab17a2e14 100644
--- a/sources/pyside2/tests/QtCore/deepcopy_test.py
+++ b/sources/pyside2/tests/QtCore/deepcopy_test.py
@@ -31,7 +31,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
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 1a0fbca19..62268c1d0 100644
--- a/sources/pyside2/tests/QtCore/deletelater_test.py
+++ b/sources/pyside2/tests/QtCore/deletelater_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimer, QCoreApplication, SIGNAL
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/destroysignal_test.py b/sources/pyside2/tests/QtCore/destroysignal_test.py
index 37e78206e..1396a487b 100644
--- a/sources/pyside2/tests/QtCore/destroysignal_test.py
+++ b/sources/pyside2/tests/QtCore/destroysignal_test.py
@@ -26,10 +26,17 @@
##
#############################################################################
-from PySide2.QtCore import QTimer, QObject
+import os
import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtCore import QTimer, QObject
+
+
class TestDestroySignal(unittest.TestCase):
def onObjectDestroyed(self, timer):
self.assertTrue(isinstance(timer, QObject))
diff --git a/sources/pyside2/tests/QtCore/duck_punching_test.py b/sources/pyside2/tests/QtCore/duck_punching_test.py
index 27eaf341a..3450314dd 100644
--- a/sources/pyside2/tests/QtCore/duck_punching_test.py
+++ b/sources/pyside2/tests/QtCore/duck_punching_test.py
@@ -35,7 +35,9 @@ import sys
import types
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/emoji_string_test.py b/sources/pyside2/tests/QtCore/emoji_string_test.py
index 2e0522878..0bf088dee 100644
--- a/sources/pyside2/tests/QtCore/emoji_string_test.py
+++ b/sources/pyside2/tests/QtCore/emoji_string_test.py
@@ -50,7 +50,14 @@ source itself, utf8 encoding in line 1 and a short plausibility test to make
it safely fail.
"""
+import os
import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2 import QtCore
emoji_str = u'\U0001f632' + u' ' # "😲 "
diff --git a/sources/pyside2/tests/QtCore/hash_test.py b/sources/pyside2/tests/QtCore/hash_test.py
index 6e8a4aaad..9ef1dfe08 100644
--- a/sources/pyside2/tests/QtCore/hash_test.py
+++ b/sources/pyside2/tests/QtCore/hash_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QDate, QDateTime, QTime, QUrl
from PySide2.QtCore import QLine, QPoint, QRect, QSize
diff --git a/sources/pyside2/tests/QtCore/inherits_test.py b/sources/pyside2/tests/QtCore/inherits_test.py
index 1f5fa49e9..d8b68d816 100644
--- a/sources/pyside2/tests/QtCore/inherits_test.py
+++ b/sources/pyside2/tests/QtCore/inherits_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
class MyObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/max_signals.py b/sources/pyside2/tests/QtCore/max_signals.py
index 1f7e7f822..46fd1ba4f 100644
--- a/sources/pyside2/tests/QtCore/max_signals.py
+++ b/sources/pyside2/tests/QtCore/max_signals.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL
class MyObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/missing_symbols_test.py b/sources/pyside2/tests/QtCore/missing_symbols_test.py
index ac8828012..a69603e1a 100644
--- a/sources/pyside2/tests/QtCore/missing_symbols_test.py
+++ b/sources/pyside2/tests/QtCore/missing_symbols_test.py
@@ -28,7 +28,14 @@
'''(Very) Simple test case for missing names from QtCore'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
class MissingClasses(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/mockclass_test.py b/sources/pyside2/tests/QtCore/mockclass_test.py
index 1b730e714..9fb689e6e 100644
--- a/sources/pyside2/tests/QtCore/mockclass_test.py
+++ b/sources/pyside2/tests/QtCore/mockclass_test.py
@@ -30,7 +30,14 @@
# http://bugs.pyside.org/show_bug.cgi?id=634
# Marcus Lindblom <macke@yar.nu>; 2011-02-16
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCoreApplication
class Mock(object):
diff --git a/sources/pyside2/tests/QtCore/python_conversion.py b/sources/pyside2/tests/QtCore/python_conversion.py
index d10ecea54..a32529a17 100644
--- a/sources/pyside2/tests/QtCore/python_conversion.py
+++ b/sources/pyside2/tests/QtCore/python_conversion.py
@@ -30,7 +30,14 @@
'''Test cases for QLineF'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import datetime
from PySide2.QtCore import QTime, QDateTime, QDate
diff --git a/sources/pyside2/tests/QtCore/qabs_test.py b/sources/pyside2/tests/QtCore/qabs_test.py
index bc698d3dc..a63f37293 100644
--- a/sources/pyside2/tests/QtCore/qabs_test.py
+++ b/sources/pyside2/tests/QtCore/qabs_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
diff --git a/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py b/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
index fd8d01c99..2901f4dcc 100644
--- a/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
+++ b/sources/pyside2/tests/QtCore/qabstractitemmodel_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class MyModel (QAbstractListModel):
diff --git a/sources/pyside2/tests/QtCore/qabstracttransition_test.py b/sources/pyside2/tests/QtCore/qabstracttransition_test.py
index 247914517..063d266d2 100644
--- a/sources/pyside2/tests/QtCore/qabstracttransition_test.py
+++ b/sources/pyside2/tests/QtCore/qabstracttransition_test.py
@@ -28,8 +28,15 @@
##
#############################################################################
-import unittest
+import os
+import sys
from sys import getrefcount
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
def addStates(transition):
diff --git a/sources/pyside2/tests/QtCore/qanimationgroup_test.py b/sources/pyside2/tests/QtCore/qanimationgroup_test.py
index 08b410aae..961d1a754 100644
--- a/sources/pyside2/tests/QtCore/qanimationgroup_test.py
+++ b/sources/pyside2/tests/QtCore/qanimationgroup_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class QAnimationGroupTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qbitarray_test.py b/sources/pyside2/tests/QtCore/qbitarray_test.py
index 72117ad7c..d8d1d5147 100644
--- a/sources/pyside2/tests/QtCore/qbitarray_test.py
+++ b/sources/pyside2/tests/QtCore/qbitarray_test.py
@@ -30,8 +30,14 @@
'''Tests if QBitArray class is iterable and also '~' (__invert__) and bitwise operators'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QBitArray
def bool_list_from_qbitarray(qbitarray):
diff --git a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py
index 93527f9d7..20f8fa915 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_buffer_protocol_test.py
@@ -36,7 +36,9 @@ 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"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py
index a3986278c..1375c3ab3 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_concatenation_operator_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
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 15d870bde..d0a65465b 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_operator_iadd_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QByteArray
from helper.docmodifier import DocModifier
diff --git a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py
index 69d016a6b..b19179429 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_operator_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_operator_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qbytearray_test.py b/sources/pyside2/tests/QtCore/qbytearray_test.py
index 99813425e..8f1c9c201 100644
--- a/sources/pyside2/tests/QtCore/qbytearray_test.py
+++ b/sources/pyside2/tests/QtCore/qbytearray_test.py
@@ -37,7 +37,9 @@ import pickle
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qcalendar_test.py b/sources/pyside2/tests/QtCore/qcalendar_test.py
index 4b595a011..e75931ad5 100644
--- a/sources/pyside2/tests/QtCore/qcalendar_test.py
+++ b/sources/pyside2/tests/QtCore/qcalendar_test.py
@@ -30,8 +30,14 @@
'''Test cases for QCalendar (5.14)'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCalendar
class TestQCalendar (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qcbor_test.py b/sources/pyside2/tests/QtCore/qcbor_test.py
index 2ac46673a..ec99e04f5 100644
--- a/sources/pyside2/tests/QtCore/qcbor_test.py
+++ b/sources/pyside2/tests/QtCore/qcbor_test.py
@@ -30,8 +30,14 @@
'''Test cases for QCbor'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import (QByteArray, QCborStreamReader, QCborStreamWriter,
QCborValue)
diff --git a/sources/pyside2/tests/QtCore/qcollator_test.py b/sources/pyside2/tests/QtCore/qcollator_test.py
index 231ce5bbe..3aa33240a 100644
--- a/sources/pyside2/tests/QtCore/qcollator_test.py
+++ b/sources/pyside2/tests/QtCore/qcollator_test.py
@@ -30,9 +30,14 @@
'''Unit tests for QCollator'''
-import unittest
import ctypes
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/qcommandlineparser_test.py b/sources/pyside2/tests/QtCore/qcommandlineparser_test.py
index 207dbbe73..a947cf48f 100644
--- a/sources/pyside2/tests/QtCore/qcommandlineparser_test.py
+++ b/sources/pyside2/tests/QtCore/qcommandlineparser_test.py
@@ -30,9 +30,14 @@
'''Unit tests for QCommandLineParser and QCommandLineOption'''
-import unittest
import ctypes
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py b/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py
index ad1dee0bf..1e1a64204 100644
--- a/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py
+++ b/sources/pyside2/tests/QtCore/qcoreapplication_instance_test.py
@@ -31,8 +31,14 @@
'''Test cases for QCoreApplication.instance static method'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCoreApplication
class QCoreApplicationInstanceTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qcoreapplication_test.py b/sources/pyside2/tests/QtCore/qcoreapplication_test.py
index 15a905846..b9907abbf 100644
--- a/sources/pyside2/tests/QtCore/qcoreapplication_test.py
+++ b/sources/pyside2/tests/QtCore/qcoreapplication_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCoreApplication
class TestQCoreApplication(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qdatastream_test.py b/sources/pyside2/tests/QtCore/qdatastream_test.py
index b50b1d157..a2d2908b2 100644
--- a/sources/pyside2/tests/QtCore/qdatastream_test.py
+++ b/sources/pyside2/tests/QtCore/qdatastream_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qdate_test.py b/sources/pyside2/tests/QtCore/qdate_test.py
index 8c3ddb0d3..911a042b8 100644
--- a/sources/pyside2/tests/QtCore/qdate_test.py
+++ b/sources/pyside2/tests/QtCore/qdate_test.py
@@ -30,8 +30,14 @@
'''Test cases for QDate'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class TestQDate (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qdatetime_test.py b/sources/pyside2/tests/QtCore/qdatetime_test.py
index 9da514277..4d98156d8 100644
--- a/sources/pyside2/tests/QtCore/qdatetime_test.py
+++ b/sources/pyside2/tests/QtCore/qdatetime_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import unittest
import datetime
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QDateTime, QDate, QTime
diff --git a/sources/pyside2/tests/QtCore/qeasingcurve_test.py b/sources/pyside2/tests/QtCore/qeasingcurve_test.py
index 3975d1f2c..82d45f978 100644
--- a/sources/pyside2/tests/QtCore/qeasingcurve_test.py
+++ b/sources/pyside2/tests/QtCore/qeasingcurve_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QEasingCurve
def myFunction(progress):
diff --git a/sources/pyside2/tests/QtCore/qenum_test.py b/sources/pyside2/tests/QtCore/qenum_test.py
index ada625f24..dd91d1581 100644
--- a/sources/pyside2/tests/QtCore/qenum_test.py
+++ b/sources/pyside2/tests/QtCore/qenum_test.py
@@ -30,8 +30,14 @@
'''Test cases for QEnum and QFlags'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class TestEnum(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qevent_test.py b/sources/pyside2/tests/QtCore/qevent_test.py
index c390c6afe..a3e4f7116 100644
--- a/sources/pyside2/tests/QtCore/qevent_test.py
+++ b/sources/pyside2/tests/QtCore/qevent_test.py
@@ -30,8 +30,14 @@
'''Test cases for QtCore.QEvent'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QEvent
class QEventTypeFlag(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qfile_test.py b/sources/pyside2/tests/QtCore/qfile_test.py
index 69208a49d..960d0d1d8 100644
--- a/sources/pyside2/tests/QtCore/qfile_test.py
+++ b/sources/pyside2/tests/QtCore/qfile_test.py
@@ -31,7 +31,9 @@ import sys
import tempfile
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qfileinfo_test.py b/sources/pyside2/tests/QtCore/qfileinfo_test.py
index 16e606a2c..07b37cc51 100644
--- a/sources/pyside2/tests/QtCore/qfileinfo_test.py
+++ b/sources/pyside2/tests/QtCore/qfileinfo_test.py
@@ -26,10 +26,14 @@
##
#############################################################################
-import unittest
-
import os
+import sys
import tempfile
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QFile, QFileInfo
diff --git a/sources/pyside2/tests/QtCore/qfileread_test.py b/sources/pyside2/tests/QtCore/qfileread_test.py
index 16d9082fb..1a9afd1ab 100644
--- a/sources/pyside2/tests/QtCore/qfileread_test.py
+++ b/sources/pyside2/tests/QtCore/qfileread_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QIODevice, QTemporaryFile
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qflags_test.py b/sources/pyside2/tests/QtCore/qflags_test.py
index 7d558424e..08a7c55b1 100644
--- a/sources/pyside2/tests/QtCore/qflags_test.py
+++ b/sources/pyside2/tests/QtCore/qflags_test.py
@@ -30,7 +30,14 @@
'''Test cases for QFlags'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import Qt, QTemporaryFile, QFile, QIODevice, QObject
class QFlagTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qhandle_test.py b/sources/pyside2/tests/QtCore/qhandle_test.py
index db7804467..76dfbd32e 100644
--- a/sources/pyside2/tests/QtCore/qhandle_test.py
+++ b/sources/pyside2/tests/QtCore/qhandle_test.py
@@ -30,8 +30,14 @@
'''Test cases for QEnum and QFlags'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QThread, Qt
class TestHANDLE(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py b/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py
index f14c89311..f46ace5a0 100644
--- a/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py
+++ b/sources/pyside2/tests/QtCore/qinstallmsghandler_test.py
@@ -28,8 +28,13 @@
'''Test cases for qInstallMsgHandler'''
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/qjsondocument_test.py b/sources/pyside2/tests/QtCore/qjsondocument_test.py
index 65f83abe3..3f8a9c848 100644
--- a/sources/pyside2/tests/QtCore/qjsondocument_test.py
+++ b/sources/pyside2/tests/QtCore/qjsondocument_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QJsonDocument
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qlinef_test.py b/sources/pyside2/tests/QtCore/qlinef_test.py
index 2261602c5..084937c06 100644
--- a/sources/pyside2/tests/QtCore/qlinef_test.py
+++ b/sources/pyside2/tests/QtCore/qlinef_test.py
@@ -30,8 +30,13 @@
'''Test cases for QLineF'''
-import unittest
import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/qlocale_test.py b/sources/pyside2/tests/QtCore/qlocale_test.py
index 44374f808..7c797339a 100644
--- a/sources/pyside2/tests/QtCore/qlocale_test.py
+++ b/sources/pyside2/tests/QtCore/qlocale_test.py
@@ -30,9 +30,14 @@
'''Unit tests for QLocale'''
-import unittest
import ctypes
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QLocale
diff --git a/sources/pyside2/tests/QtCore/qlockfile_test.py b/sources/pyside2/tests/QtCore/qlockfile_test.py
index e943af2b7..38b6b7c42 100644
--- a/sources/pyside2/tests/QtCore/qlockfile_test.py
+++ b/sources/pyside2/tests/QtCore/qlockfile_test.py
@@ -30,7 +30,14 @@
'''Test cases for QLockFile'''
-import os, unittest
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
from PySide2.QtCore import QDir, QLockFile, QCoreApplication
diff --git a/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py b/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py
index 2a63e25a2..225807b9e 100644
--- a/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py
+++ b/sources/pyside2/tests/QtCore/qmessageauthenticationcode_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QCryptographicHash, QMessageAuthenticationCode
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qmetaobject_test.py b/sources/pyside2/tests/QtCore/qmetaobject_test.py
index 81a3e7015..d79abb1da 100644
--- a/sources/pyside2/tests/QtCore/qmetaobject_test.py
+++ b/sources/pyside2/tests/QtCore/qmetaobject_test.py
@@ -31,8 +31,14 @@
'''Tests for static methos conflicts with class methods'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class Foo(QFile):
diff --git a/sources/pyside2/tests/QtCore/qmimedatabase_test.py b/sources/pyside2/tests/QtCore/qmimedatabase_test.py
index 1e4e3b574..78ce55328 100644
--- a/sources/pyside2/tests/QtCore/qmimedatabase_test.py
+++ b/sources/pyside2/tests/QtCore/qmimedatabase_test.py
@@ -30,9 +30,14 @@
'''Unit tests for QMimeDatabase'''
-import unittest
import ctypes
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QMimeDatabase, QLocale
diff --git a/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py b/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py
index 770600ea3..83f9d8486 100644
--- a/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py
+++ b/sources/pyside2/tests/QtCore/qmodelindex_internalpointer_test.py
@@ -30,8 +30,14 @@
''' Test case for QAbstractListModel.createIndex and QModelIndex.internalPointer'''
+import os
import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class MyModel (QAbstractListModel):
diff --git a/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py b/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py
index 2b6218aaf..a5604bb70 100644
--- a/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_children_segfault_test.py
@@ -28,8 +28,14 @@
'''Test cases for parent-child relationship'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, QCoreApplication
class ChildrenCoreApplication(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py b/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py
index 74db16ff8..5d9d8052c 100644
--- a/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_connect_notify_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/qobject_destructor.py b/sources/pyside2/tests/QtCore/qobject_destructor.py
index ef322cb3e..d94779239 100644
--- a/sources/pyside2/tests/QtCore/qobject_destructor.py
+++ b/sources/pyside2/tests/QtCore/qobject_destructor.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
class MyObject(QtCore.QObject):
diff --git a/sources/pyside2/tests/QtCore/qobject_event_filter_test.py b/sources/pyside2/tests/QtCore/qobject_event_filter_test.py
index 4b372df3a..ff46bc79f 100644
--- a/sources/pyside2/tests/QtCore/qobject_event_filter_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_event_filter_test.py
@@ -33,7 +33,9 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimerEvent
diff --git a/sources/pyside2/tests/QtCore/qobject_inherits_test.py b/sources/pyside2/tests/QtCore/qobject_inherits_test.py
index 3a87da347..bc6e00654 100644
--- a/sources/pyside2/tests/QtCore/qobject_inherits_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_inherits_test.py
@@ -28,8 +28,13 @@
'''Test cases for QObject methods'''
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimer
from PySide2.QtWidgets import QApplication, QLabel, QVBoxLayout
diff --git a/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py b/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py
index bade8fe46..b2c6305cd 100644
--- a/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_objectproperty_test.py
@@ -33,7 +33,14 @@
http://bugs.openbossa.org/show_bug.cgi?id=378
'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
class ExtQObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/qobject_parent_test.py b/sources/pyside2/tests/QtCore/qobject_parent_test.py
index 85b709137..7e98100a1 100644
--- a/sources/pyside2/tests/QtCore/qobject_parent_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_parent_test.py
@@ -28,8 +28,14 @@
'''Test cases for parent-child relationship'''
-import unittest
+import os
+import sys
from sys import getrefcount
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/qobject_property_test.py b/sources/pyside2/tests/QtCore/qobject_property_test.py
index 80d652ab5..0592bf652 100644
--- a/sources/pyside2/tests/QtCore/qobject_property_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_property_test.py
@@ -28,8 +28,14 @@
'''Test cases for QObject property and setProperty'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Property, Signal
class MyObjectWithNotifyProperty(QObject):
diff --git a/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py b/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py
index 26376e449..3af811e96 100644
--- a/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_protected_methods_test.py
@@ -30,8 +30,14 @@
'''Test cases for QObject protected methods'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, QThread, SIGNAL
class Dummy(QObject):
diff --git a/sources/pyside2/tests/QtCore/qobject_test.py b/sources/pyside2/tests/QtCore/qobject_test.py
index ade885e7d..dd577ecdc 100644
--- a/sources/pyside2/tests/QtCore/qobject_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qobject_timer_event_test.py b/sources/pyside2/tests/QtCore/qobject_timer_event_test.py
index 7abc1528b..bdf074653 100644
--- a/sources/pyside2/tests/QtCore/qobject_timer_event_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_timer_event_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QCoreApplication
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 ee416d08f..bbcd0b99a 100644
--- a/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py
+++ b/sources/pyside2/tests/QtCore/qobject_tr_as_instance_test.py
@@ -36,7 +36,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject
diff --git a/sources/pyside2/tests/QtCore/qoperatingsystemversion_test.py b/sources/pyside2/tests/QtCore/qoperatingsystemversion_test.py
index 82c571d18..bd0ba66db 100644
--- a/sources/pyside2/tests/QtCore/qoperatingsystemversion_test.py
+++ b/sources/pyside2/tests/QtCore/qoperatingsystemversion_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QOperatingSystemVersion
class TestQOperatingSystemVersion(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qpoint_test.py b/sources/pyside2/tests/QtCore/qpoint_test.py
index e77662772..e73c37e5b 100644
--- a/sources/pyside2/tests/QtCore/qpoint_test.py
+++ b/sources/pyside2/tests/QtCore/qpoint_test.py
@@ -28,8 +28,14 @@
'''Test cases for QPoint and QPointF'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QPoint, QPointF
diff --git a/sources/pyside2/tests/QtCore/qprocess_test.py b/sources/pyside2/tests/QtCore/qprocess_test.py
index 72b2e08cb..eb5753f45 100644
--- a/sources/pyside2/tests/QtCore/qprocess_test.py
+++ b/sources/pyside2/tests/QtCore/qprocess_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qproperty_decorator.py b/sources/pyside2/tests/QtCore/qproperty_decorator.py
index c6f0d3c37..aa31e59c4 100644
--- a/sources/pyside2/tests/QtCore/qproperty_decorator.py
+++ b/sources/pyside2/tests/QtCore/qproperty_decorator.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import weakref
+import os
+import sys
import unittest
+import weakref
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, Property
diff --git a/sources/pyside2/tests/QtCore/qrandomgenerator_test.py b/sources/pyside2/tests/QtCore/qrandomgenerator_test.py
index 2b732ad5e..170a31662 100644
--- a/sources/pyside2/tests/QtCore/qrandomgenerator_test.py
+++ b/sources/pyside2/tests/QtCore/qrandomgenerator_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QRandomGenerator, QRandomGenerator64
class QRandomGeneratorTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qrect_test.py b/sources/pyside2/tests/QtCore/qrect_test.py
index bcf9f95ba..9116d7b58 100644
--- a/sources/pyside2/tests/QtCore/qrect_test.py
+++ b/sources/pyside2/tests/QtCore/qrect_test.py
@@ -30,8 +30,14 @@
'''Test cases for QRect'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QPoint, QRect, QRectF
class RectConstructor(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qregexp_test.py b/sources/pyside2/tests/QtCore/qregexp_test.py
index 36d3b07cc..a031137fd 100644
--- a/sources/pyside2/tests/QtCore/qregexp_test.py
+++ b/sources/pyside2/tests/QtCore/qregexp_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QRegExp
class QRegExpTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qregularexpression_test.py b/sources/pyside2/tests/QtCore/qregularexpression_test.py
index cef3ec668..fb2e9c24c 100644
--- a/sources/pyside2/tests/QtCore/qregularexpression_test.py
+++ b/sources/pyside2/tests/QtCore/qregularexpression_test.py
@@ -30,7 +30,14 @@
'''Unit tests for QRegularExpression'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QRegularExpression, QRegularExpressionMatch, QRegularExpressionMatchIterator
class QRegularExpressionTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qresource_test.py b/sources/pyside2/tests/QtCore/qresource_test.py
index 953786799..3ec925032 100644
--- a/sources/pyside2/tests/QtCore/qresource_test.py
+++ b/sources/pyside2/tests/QtCore/qresource_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from PySide2.QtCore import QFile, QIODevice
diff --git a/sources/pyside2/tests/QtCore/qsettings_test.py b/sources/pyside2/tests/QtCore/qsettings_test.py
index 97aa7522b..982ddc38d 100644
--- a/sources/pyside2/tests/QtCore/qsettings_test.py
+++ b/sources/pyside2/tests/QtCore/qsettings_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qsize_test.py b/sources/pyside2/tests/QtCore/qsize_test.py
index 1bc7779fb..1bf31fae6 100644
--- a/sources/pyside2/tests/QtCore/qsize_test.py
+++ b/sources/pyside2/tests/QtCore/qsize_test.py
@@ -30,8 +30,14 @@
'''Unit tests for QSize'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QSize
class QSizeOperator(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qslot_object_test.py b/sources/pyside2/tests/QtCore/qslot_object_test.py
index 7a2691a06..252a09bea 100644
--- a/sources/pyside2/tests/QtCore/qslot_object_test.py
+++ b/sources/pyside2/tests/QtCore/qslot_object_test.py
@@ -28,7 +28,13 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore
"""
diff --git a/sources/pyside2/tests/QtCore/qsocketnotifier_test.py b/sources/pyside2/tests/QtCore/qsocketnotifier_test.py
index 0a9b78af3..cd3d783de 100644
--- a/sources/pyside2/tests/QtCore/qsocketnotifier_test.py
+++ b/sources/pyside2/tests/QtCore/qsocketnotifier_test.py
@@ -30,13 +30,18 @@
'''Unit tests for QUuid'''
+import os
+import socket
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import QApplication
from PySide2.QtCore import QSocketNotifier
-import socket
-import sys
-import os
+
class QSocketNotifierTest(unittest.TestCase):
def testClass(self):
diff --git a/sources/pyside2/tests/QtCore/qsrand_test.py b/sources/pyside2/tests/QtCore/qsrand_test.py
index 459bfeb59..cdad78237 100644
--- a/sources/pyside2/tests/QtCore/qsrand_test.py
+++ b/sources/pyside2/tests/QtCore/qsrand_test.py
@@ -27,8 +27,14 @@
#############################################################################
import gc
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import qsrand
class OverflowExceptionCollect(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qstandardpaths_test.py b/sources/pyside2/tests/QtCore/qstandardpaths_test.py
index 957aa4e18..67c7b4a9b 100644
--- a/sources/pyside2/tests/QtCore/qstandardpaths_test.py
+++ b/sources/pyside2/tests/QtCore/qstandardpaths_test.py
@@ -30,9 +30,14 @@
'''Unit tests for QStandardPaths'''
-import unittest
import ctypes
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QStandardPaths
diff --git a/sources/pyside2/tests/QtCore/qstate_test.py b/sources/pyside2/tests/QtCore/qstate_test.py
index 8627f4bba..4c97fecca 100644
--- a/sources/pyside2/tests/QtCore/qstate_test.py
+++ b/sources/pyside2/tests/QtCore/qstate_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/qstatemachine_test.py b/sources/pyside2/tests/QtCore/qstatemachine_test.py
index 388d9ed01..19dcb1e81 100644
--- a/sources/pyside2/tests/QtCore/qstatemachine_test.py
+++ b/sources/pyside2/tests/QtCore/qstatemachine_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QState, QFinalState, SIGNAL
from PySide2.QtCore import QTimer, QStateMachine
diff --git a/sources/pyside2/tests/QtCore/qstorageinfo_test.py b/sources/pyside2/tests/QtCore/qstorageinfo_test.py
index 783b59564..c7ae14877 100644
--- a/sources/pyside2/tests/QtCore/qstorageinfo_test.py
+++ b/sources/pyside2/tests/QtCore/qstorageinfo_test.py
@@ -30,8 +30,14 @@
'''Unit tests for QStorageInfo'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QStorageInfo
class QandardPathsTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qstring_test.py b/sources/pyside2/tests/QtCore/qstring_test.py
index 95900bc2f..c415fdc3d 100644
--- a/sources/pyside2/tests/QtCore/qstring_test.py
+++ b/sources/pyside2/tests/QtCore/qstring_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2.QtCore import QObject
diff --git a/sources/pyside2/tests/QtCore/qsysinfo_test.py b/sources/pyside2/tests/QtCore/qsysinfo_test.py
index 7e25e4fe9..0f53a9cfa 100644
--- a/sources/pyside2/tests/QtCore/qsysinfo_test.py
+++ b/sources/pyside2/tests/QtCore/qsysinfo_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QSysInfo
class TestQSysInfo(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qtext_codec_test.py b/sources/pyside2/tests/QtCore/qtext_codec_test.py
index 5506c202a..9e41c38c6 100644
--- a/sources/pyside2/tests/QtCore/qtext_codec_test.py
+++ b/sources/pyside2/tests/QtCore/qtext_codec_test.py
@@ -27,8 +27,14 @@
#############################################################################
import gc
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QTextCodec
class TestCodecGetters(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qtextstream_test.py b/sources/pyside2/tests/QtCore/qtextstream_test.py
index a5a587d38..bd25367c3 100644
--- a/sources/pyside2/tests/QtCore/qtextstream_test.py
+++ b/sources/pyside2/tests/QtCore/qtextstream_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py b/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py
index ee3ed1a4a..9ff62c156 100644
--- a/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py
+++ b/sources/pyside2/tests/QtCore/qthread_prod_cons_test.py
@@ -30,9 +30,15 @@
'''Producer-Consumer test/example with QThread'''
-import unittest
-from random import random
import logging
+import os
+from random import random
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
logging.basicConfig(level=logging.WARNING)
diff --git a/sources/pyside2/tests/QtCore/qthread_signal_test.py b/sources/pyside2/tests/QtCore/qthread_signal_test.py
index 31b148a00..bb3423bd7 100644
--- a/sources/pyside2/tests/QtCore/qthread_signal_test.py
+++ b/sources/pyside2/tests/QtCore/qthread_signal_test.py
@@ -28,8 +28,14 @@
'''Test cases for connecting signals between threads'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QThread, QObject, SIGNAL, QCoreApplication
thread_run = False
diff --git a/sources/pyside2/tests/QtCore/qthread_test.py b/sources/pyside2/tests/QtCore/qthread_test.py
index 73683e50f..2ba5a536c 100644
--- a/sources/pyside2/tests/QtCore/qthread_test.py
+++ b/sources/pyside2/tests/QtCore/qthread_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
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 9b2a1567f..41fe4ac97 100644
--- a/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py
+++ b/sources/pyside2/tests/QtCore/qtimer_singleshot_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimer, QCoreApplication, Signal
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/qtimer_timeout_test.py b/sources/pyside2/tests/QtCore/qtimer_timeout_test.py
index 54ff63bc2..4f038ddf1 100644
--- a/sources/pyside2/tests/QtCore/qtimer_timeout_test.py
+++ b/sources/pyside2/tests/QtCore/qtimer_timeout_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimer, SIGNAL
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/qtimezone_test.py b/sources/pyside2/tests/QtCore/qtimezone_test.py
index 3b9512bea..8c960371f 100644
--- a/sources/pyside2/tests/QtCore/qtimezone_test.py
+++ b/sources/pyside2/tests/QtCore/qtimezone_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QTimeZone
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/qtnamespace_test.py b/sources/pyside2/tests/QtCore/qtnamespace_test.py
index 06dece280..fbf92b6d0 100644
--- a/sources/pyside2/tests/QtCore/qtnamespace_test.py
+++ b/sources/pyside2/tests/QtCore/qtnamespace_test.py
@@ -30,8 +30,14 @@
'''Test suite for QtCore.Qt namespace'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import Qt
class QtNamespace(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qurl_test.py b/sources/pyside2/tests/QtCore/qurl_test.py
index b0333d534..8c2b43e9a 100644
--- a/sources/pyside2/tests/QtCore/qurl_test.py
+++ b/sources/pyside2/tests/QtCore/qurl_test.py
@@ -30,8 +30,14 @@
'''Test suite for QtCore.QUrl'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QUrl
from PySide2.QtCore import QUrlQuery
diff --git a/sources/pyside2/tests/QtCore/qurlquery_test.py b/sources/pyside2/tests/QtCore/qurlquery_test.py
index 652a9a88b..ac7ab69b0 100644
--- a/sources/pyside2/tests/QtCore/qurlquery_test.py
+++ b/sources/pyside2/tests/QtCore/qurlquery_test.py
@@ -30,9 +30,14 @@
'''Unit tests for QUrlQuery'''
-import unittest
import ctypes
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QUrlQuery
diff --git a/sources/pyside2/tests/QtCore/quuid_test.py b/sources/pyside2/tests/QtCore/quuid_test.py
index c881383e5..da34429f9 100644
--- a/sources/pyside2/tests/QtCore/quuid_test.py
+++ b/sources/pyside2/tests/QtCore/quuid_test.py
@@ -30,8 +30,14 @@
'''Unit tests for QUuid'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QUuid
class QUuidTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/qversionnumber_test.py b/sources/pyside2/tests/QtCore/qversionnumber_test.py
index d98e320f1..e0d734eec 100644
--- a/sources/pyside2/tests/QtCore/qversionnumber_test.py
+++ b/sources/pyside2/tests/QtCore/qversionnumber_test.py
@@ -30,8 +30,14 @@
'''Unit tests for QVersionNumber'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QVersionNumber
class QVersionNumberTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/repr_test.py b/sources/pyside2/tests/QtCore/repr_test.py
index 4bac44c2a..71bab8330 100644
--- a/sources/pyside2/tests/QtCore/repr_test.py
+++ b/sources/pyside2/tests/QtCore/repr_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import PySide2
from PySide2.QtCore import QByteArray, QDate, QDateTime, QTime, QLine, QLineF
diff --git a/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py b/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py
index ea3690f91..e149f8ffb 100644
--- a/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py
+++ b/sources/pyside2/tests/QtCore/setprop_on_ctor_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtCore/staticMetaObject_test.py b/sources/pyside2/tests/QtCore/staticMetaObject_test.py
index 7fdfaf417..bb5c5d189 100644
--- a/sources/pyside2/tests/QtCore/staticMetaObject_test.py
+++ b/sources/pyside2/tests/QtCore/staticMetaObject_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Slot, QMetaObject
class MyObject(QObject):
diff --git a/sources/pyside2/tests/QtCore/static_method_test.py b/sources/pyside2/tests/QtCore/static_method_test.py
index 28189df4c..e3a7e1798 100644
--- a/sources/pyside2/tests/QtCore/static_method_test.py
+++ b/sources/pyside2/tests/QtCore/static_method_test.py
@@ -31,8 +31,13 @@
'''Test cases for overloads involving static and non-static versions of a method.'''
import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QFile
class StaticNonStaticMethodsTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/thread_signals_test.py b/sources/pyside2/tests/QtCore/thread_signals_test.py
index 9800d2e09..61cbcc53f 100644
--- a/sources/pyside2/tests/QtCore/thread_signals_test.py
+++ b/sources/pyside2/tests/QtCore/thread_signals_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, QFile, QThread, QTimer, Qt
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/QtCore/tr_noop_test.py b/sources/pyside2/tests/QtCore/tr_noop_test.py
index 42cf4a525..369db9fc9 100644
--- a/sources/pyside2/tests/QtCore/tr_noop_test.py
+++ b/sources/pyside2/tests/QtCore/tr_noop_test.py
@@ -26,9 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
-import sys
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QT_TR_NOOP, QT_TR_NOOP_UTF8
from PySide2.QtCore import QT_TRANSLATE_NOOP, QT_TRANSLATE_NOOP3, QT_TRANSLATE_NOOP_UTF8
diff --git a/sources/pyside2/tests/QtCore/translation_test.py b/sources/pyside2/tests/QtCore/translation_test.py
index 1dfeedeef..0f36067bd 100644
--- a/sources/pyside2/tests/QtCore/translation_test.py
+++ b/sources/pyside2/tests/QtCore/translation_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2.QtCore import QObject, QTranslator, QCoreApplication
diff --git a/sources/pyside2/tests/QtCore/unaryoperator_test.py b/sources/pyside2/tests/QtCore/unaryoperator_test.py
index ea5813a5f..2fd06cd4b 100644
--- a/sources/pyside2/tests/QtCore/unaryoperator_test.py
+++ b/sources/pyside2/tests/QtCore/unaryoperator_test.py
@@ -30,8 +30,14 @@
'''Tests the presence of unary operator __neg__ on the QPoint class'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QPoint
class NegUnaryOperatorTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtCore/unicode_test.py b/sources/pyside2/tests/QtCore/unicode_test.py
index 3dee24f47..3f1a4d8dc 100644
--- a/sources/pyside2/tests/QtCore/unicode_test.py
+++ b/sources/pyside2/tests/QtCore/unicode_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtCore/versioninfo_test.py b/sources/pyside2/tests/QtCore/versioninfo_test.py
index 6fff9710f..c682dbbdc 100644
--- a/sources/pyside2/tests/QtCore/versioninfo_test.py
+++ b/sources/pyside2/tests/QtCore/versioninfo_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
class TestVersionInfo(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtDataVisualization/datavisualization_test.py b/sources/pyside2/tests/QtDataVisualization/datavisualization_test.py
index 2ff705ee1..af6e5f5d5 100644
--- a/sources/pyside2/tests/QtDataVisualization/datavisualization_test.py
+++ b/sources/pyside2/tests/QtDataVisualization/datavisualization_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqguiapplication import UsesQGuiApplication
from PySide2.QtCore import QTimer
diff --git a/sources/pyside2/tests/QtGui/bug_1091.py b/sources/pyside2/tests/QtGui/bug_1091.py
index 28f7d9bea..74c0000ac 100644
--- a/sources/pyside2/tests/QtGui/bug_1091.py
+++ b/sources/pyside2/tests/QtGui/bug_1091.py
@@ -28,7 +28,14 @@
''' unit test for BUG #1091 '''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtGui
class QPainterTestCase(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/bug_300_test.py b/sources/pyside2/tests/QtGui/bug_300_test.py
index c2c1bc9cb..d5da0a418 100644
--- a/sources/pyside2/tests/QtGui/bug_300_test.py
+++ b/sources/pyside2/tests/QtGui/bug_300_test.py
@@ -26,9 +26,17 @@
##
#############################################################################
-from PySide2.QtCore import QModelIndex, QStringListModel
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtCore import QModelIndex, QStringListModel
+
+
class TestQAbstractItemModelSignals(unittest.TestCase):
def sigCallback(self, index, r, c):
self._called = True
diff --git a/sources/pyside2/tests/QtGui/bug_367.py b/sources/pyside2/tests/QtGui/bug_367.py
index 2780df5c9..5080295bf 100644
--- a/sources/pyside2/tests/QtGui/bug_367.py
+++ b/sources/pyside2/tests/QtGui/bug_367.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2 import QtCore,QtGui
diff --git a/sources/pyside2/tests/QtGui/bug_480.py b/sources/pyside2/tests/QtGui/bug_480.py
index 506dbf53a..41b83e10d 100644
--- a/sources/pyside2/tests/QtGui/bug_480.py
+++ b/sources/pyside2/tests/QtGui/bug_480.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtWidgets
class BuggyWidget(QtWidgets.QWidget):
diff --git a/sources/pyside2/tests/QtGui/bug_606.py b/sources/pyside2/tests/QtGui/bug_606.py
index 6f01b5797..4f2a4b46e 100644
--- a/sources/pyside2/tests/QtGui/bug_606.py
+++ b/sources/pyside2/tests/QtGui/bug_606.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
from PySide2.QtGui import QVector2D, QVector3D, QVector4D
from PySide2.QtGui import QColor
diff --git a/sources/pyside2/tests/QtGui/bug_617.py b/sources/pyside2/tests/QtGui/bug_617.py
index 370d6469f..32e1fc05e 100644
--- a/sources/pyside2/tests/QtGui/bug_617.py
+++ b/sources/pyside2/tests/QtGui/bug_617.py
@@ -26,9 +26,17 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QEvent
from PySide2.QtGui import QColor
-import unittest
+
class MyEvent(QEvent):
def __init__(self):
diff --git a/sources/pyside2/tests/QtGui/bug_652.py b/sources/pyside2/tests/QtGui/bug_652.py
index 92b2d5a82..c80709f98 100644
--- a/sources/pyside2/tests/QtGui/bug_652.py
+++ b/sources/pyside2/tests/QtGui/bug_652.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import *
class MyData(QTextBlockUserData):
@@ -55,4 +62,4 @@ class TestBug652(unittest.TestCase):
self.assertEqual(blk.userData().getMyNiceData(), heyHo)
if __name__ == "__main__":
- unittest.main() \ No newline at end of file
+ unittest.main()
diff --git a/sources/pyside2/tests/QtGui/bug_660.py b/sources/pyside2/tests/QtGui/bug_660.py
index f2a50fd3c..058364d1d 100644
--- a/sources/pyside2/tests/QtGui/bug_660.py
+++ b/sources/pyside2/tests/QtGui/bug_660.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2.QtGui import QStandardItemModel, QStandardItem
diff --git a/sources/pyside2/tests/QtGui/bug_716.py b/sources/pyside2/tests/QtGui/bug_716.py
index f29739490..d68b11d0e 100644
--- a/sources/pyside2/tests/QtGui/bug_716.py
+++ b/sources/pyside2/tests/QtGui/bug_716.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import Qt, QPersistentModelIndex, QStringListModel
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtGui/bug_740.py b/sources/pyside2/tests/QtGui/bug_740.py
index bfd9a03fe..a4db6e5a8 100644
--- a/sources/pyside2/tests/QtGui/bug_740.py
+++ b/sources/pyside2/tests/QtGui/bug_740.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtGui/bug_743.py b/sources/pyside2/tests/QtGui/bug_743.py
index 75933ae21..2ad0a0612 100644
--- a/sources/pyside2/tests/QtGui/bug_743.py
+++ b/sources/pyside2/tests/QtGui/bug_743.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QMatrix4x4
class TestQMatrix(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/bug_991.py b/sources/pyside2/tests/QtGui/bug_991.py
index 43af0832a..1af304a27 100644
--- a/sources/pyside2/tests/QtGui/bug_991.py
+++ b/sources/pyside2/tests/QtGui/bug_991.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
from PySide2.QtGui import QPen, QBrush
diff --git a/sources/pyside2/tests/QtGui/bug_PYSIDE-344.py b/sources/pyside2/tests/QtGui/bug_PYSIDE-344.py
index 0946d70ed..f050008a7 100644
--- a/sources/pyside2/tests/QtGui/bug_PYSIDE-344.py
+++ b/sources/pyside2/tests/QtGui/bug_PYSIDE-344.py
@@ -30,8 +30,14 @@
'''Test cases for PYSIDE-344, imul/idiv are used instead of mul/div, modifying the argument passed in'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtGui/bug_PYSIDE-41.py b/sources/pyside2/tests/QtGui/bug_PYSIDE-41.py
index 128a6574b..15967a512 100644
--- a/sources/pyside2/tests/QtGui/bug_PYSIDE-41.py
+++ b/sources/pyside2/tests/QtGui/bug_PYSIDE-41.py
@@ -30,8 +30,14 @@
# move this to QtCore -- QStringListModel is part of QtGui and there is no
# simple model class appropriate for this test in QtCore.
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtGui/deepcopy_test.py b/sources/pyside2/tests/QtGui/deepcopy_test.py
index b99912647..d4dcdd64c 100644
--- a/sources/pyside2/tests/QtGui/deepcopy_test.py
+++ b/sources/pyside2/tests/QtGui/deepcopy_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import unittest
from copy import deepcopy
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QPoint
from PySide2.QtGui import QMatrix
diff --git a/sources/pyside2/tests/QtGui/float_to_int_implicit_conversion_test.py b/sources/pyside2/tests/QtGui/float_to_int_implicit_conversion_test.py
index 9277fecbb..5e8747a0c 100644
--- a/sources/pyside2/tests/QtGui/float_to_int_implicit_conversion_test.py
+++ b/sources/pyside2/tests/QtGui/float_to_int_implicit_conversion_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QImage, qRgb
diff --git a/sources/pyside2/tests/QtGui/pyside_reload_test.py b/sources/pyside2/tests/QtGui/pyside_reload_test.py
index b4e98c693..f3c7c3e8d 100644
--- a/sources/pyside2/tests/QtGui/pyside_reload_test.py
+++ b/sources/pyside2/tests/QtGui/pyside_reload_test.py
@@ -31,7 +31,9 @@ import shutil
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtGui/qcolor_reduce_test.py b/sources/pyside2/tests/QtGui/qcolor_reduce_test.py
index 7f904fd10..adb07fbf1 100644
--- a/sources/pyside2/tests/QtGui/qcolor_reduce_test.py
+++ b/sources/pyside2/tests/QtGui/qcolor_reduce_test.py
@@ -26,8 +26,15 @@
##
#############################################################################
-import unittest
+import os
import pickle
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QColor
class TestQColor (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/qcolor_test.py b/sources/pyside2/tests/QtGui/qcolor_test.py
index 021e7c128..55554b6c5 100644
--- a/sources/pyside2/tests/QtGui/qcolor_test.py
+++ b/sources/pyside2/tests/QtGui/qcolor_test.py
@@ -26,10 +26,16 @@
##
#############################################################################
-import unittest
import colorsys
-import PySide2
+import os
+import sys
+import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+import PySide2
from PySide2.QtCore import Qt
from PySide2.QtGui import QColor
diff --git a/sources/pyside2/tests/QtGui/qcursor_test.py b/sources/pyside2/tests/QtGui/qcursor_test.py
index 02c0fe514..7adc34788 100644
--- a/sources/pyside2/tests/QtGui/qcursor_test.py
+++ b/sources/pyside2/tests/QtGui/qcursor_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QBitmap, QCursor, QPixmap
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtGui/qdatastream_gui_operators_test.py b/sources/pyside2/tests/QtGui/qdatastream_gui_operators_test.py
index 9c35cd452..c9b5c16a5 100644
--- a/sources/pyside2/tests/QtGui/qdatastream_gui_operators_test.py
+++ b/sources/pyside2/tests/QtGui/qdatastream_gui_operators_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QDataStream, QByteArray, QIODevice, Qt
from PySide2.QtGui import QPixmap, QColor
diff --git a/sources/pyside2/tests/QtGui/qdesktopservices_test.py b/sources/pyside2/tests/QtGui/qdesktopservices_test.py
index e3c26719c..97bf97de1 100644
--- a/sources/pyside2/tests/QtGui/qdesktopservices_test.py
+++ b/sources/pyside2/tests/QtGui/qdesktopservices_test.py
@@ -28,8 +28,14 @@
'''Unit tests for QDesktopServices'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QDesktopServices
from PySide2.QtCore import QUrl
diff --git a/sources/pyside2/tests/QtGui/qfontmetrics_test.py b/sources/pyside2/tests/QtGui/qfontmetrics_test.py
index 5b5c7d2bf..cbf0b0698 100644
--- a/sources/pyside2/tests/QtGui/qfontmetrics_test.py
+++ b/sources/pyside2/tests/QtGui/qfontmetrics_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QFont, QFontMetrics, QFontMetricsF
from PySide2.QtCore import QRect, QRectF, Qt, QSize, QSizeF
diff --git a/sources/pyside2/tests/QtGui/qguiapplication_test.py b/sources/pyside2/tests/QtGui/qguiapplication_test.py
index d1a044655..b761cf242 100644
--- a/sources/pyside2/tests/QtGui/qguiapplication_test.py
+++ b/sources/pyside2/tests/QtGui/qguiapplication_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QGuiApplication
class TestQGuiApplication(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/qicon_test.py b/sources/pyside2/tests/QtGui/qicon_test.py
index a8763e653..f3ad498e6 100644
--- a/sources/pyside2/tests/QtGui/qicon_test.py
+++ b/sources/pyside2/tests/QtGui/qicon_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.timedqapplication import TimedQApplication
from PySide2.QtGui import QIcon
diff --git a/sources/pyside2/tests/QtGui/qitemselection_test.py b/sources/pyside2/tests/QtGui/qitemselection_test.py
index 4bb0375ff..8e9639a31 100644
--- a/sources/pyside2/tests/QtGui/qitemselection_test.py
+++ b/sources/pyside2/tests/QtGui/qitemselection_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QItemSelection
diff --git a/sources/pyside2/tests/QtGui/qkeysequence_test.py b/sources/pyside2/tests/QtGui/qkeysequence_test.py
index be28e5dec..226793400 100644
--- a/sources/pyside2/tests/QtGui/qkeysequence_test.py
+++ b/sources/pyside2/tests/QtGui/qkeysequence_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Qt
from PySide2.QtGui import QKeySequence
diff --git a/sources/pyside2/tests/QtGui/qmatrix_test.py b/sources/pyside2/tests/QtGui/qmatrix_test.py
index bc6a2b8ae..48380faf6 100644
--- a/sources/pyside2/tests/QtGui/qmatrix_test.py
+++ b/sources/pyside2/tests/QtGui/qmatrix_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QPoint
from PySide2.QtGui import QMatrix, QMatrix2x2, QMatrix4x4
diff --git a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py b/sources/pyside2/tests/QtGui/qopenglbuffer_test.py
index c80bd41b2..a5d8385c9 100644
--- a/sources/pyside2/tests/QtGui/qopenglbuffer_test.py
+++ b/sources/pyside2/tests/QtGui/qopenglbuffer_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import QOpenGLBuffer
diff --git a/sources/pyside2/tests/QtGui/qopenglwindow_test.py b/sources/pyside2/tests/QtGui/qopenglwindow_test.py
index 316b39203..e39cfb19c 100644
--- a/sources/pyside2/tests/QtGui/qopenglwindow_test.py
+++ b/sources/pyside2/tests/QtGui/qopenglwindow_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtGui/qpainter_test.py b/sources/pyside2/tests/QtGui/qpainter_test.py
index 77cea835f..d86e69b64 100644
--- a/sources/pyside2/tests/QtGui/qpainter_test.py
+++ b/sources/pyside2/tests/QtGui/qpainter_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QPainter, QLinearGradient
from PySide2.QtCore import QLine, QLineF, QPoint, QPointF, QRect, QRectF, Qt
diff --git a/sources/pyside2/tests/QtGui/qpdfwriter_test.py b/sources/pyside2/tests/QtGui/qpdfwriter_test.py
index dbda66133..aae636d31 100644
--- a/sources/pyside2/tests/QtGui/qpdfwriter_test.py
+++ b/sources/pyside2/tests/QtGui/qpdfwriter_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import QPageLayout, QPageSize, QPdfWriter, QTextDocument
diff --git a/sources/pyside2/tests/QtGui/qpixelformat_test.py b/sources/pyside2/tests/QtGui/qpixelformat_test.py
index fb0c10611..30ea213d6 100644
--- a/sources/pyside2/tests/QtGui/qpixelformat_test.py
+++ b/sources/pyside2/tests/QtGui/qpixelformat_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QSize, Qt
diff --git a/sources/pyside2/tests/QtGui/qpixmap_test.py b/sources/pyside2/tests/QtGui/qpixmap_test.py
index d59fa0281..7d2d75bc3 100644
--- a/sources/pyside2/tests/QtGui/qpixmap_test.py
+++ b/sources/pyside2/tests/QtGui/qpixmap_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtGui/qpixmapcache_test.py b/sources/pyside2/tests/QtGui/qpixmapcache_test.py
index a0e8dc03c..672ea79d5 100644
--- a/sources/pyside2/tests/QtGui/qpixmapcache_test.py
+++ b/sources/pyside2/tests/QtGui/qpixmapcache_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import QPixmapCache, QPixmap
diff --git a/sources/pyside2/tests/QtGui/qpolygonf_test.py b/sources/pyside2/tests/QtGui/qpolygonf_test.py
index 023af533d..a21518a7e 100644
--- a/sources/pyside2/tests/QtGui/qpolygonf_test.py
+++ b/sources/pyside2/tests/QtGui/qpolygonf_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtGui/qradialgradient_test.py b/sources/pyside2/tests/QtGui/qradialgradient_test.py
index c9f5bd8b0..728a721f9 100644
--- a/sources/pyside2/tests/QtGui/qradialgradient_test.py
+++ b/sources/pyside2/tests/QtGui/qradialgradient_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QRadialGradient
from PySide2.QtCore import QPointF
diff --git a/sources/pyside2/tests/QtGui/qrasterwindow_test.py b/sources/pyside2/tests/QtGui/qrasterwindow_test.py
index 5bb13600b..f18ceaaf4 100644
--- a/sources/pyside2/tests/QtGui/qrasterwindow_test.py
+++ b/sources/pyside2/tests/QtGui/qrasterwindow_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QEvent, QPoint, QRect, QSize, QTimer, Qt
diff --git a/sources/pyside2/tests/QtGui/qregion_test.py b/sources/pyside2/tests/QtGui/qregion_test.py
index 085fcec3a..3e05617ef 100644
--- a/sources/pyside2/tests/QtGui/qregion_test.py
+++ b/sources/pyside2/tests/QtGui/qregion_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QRegion
from PySide2.QtCore import QPoint
diff --git a/sources/pyside2/tests/QtGui/qstylehints_test.py b/sources/pyside2/tests/QtGui/qstylehints_test.py
index a771d38f2..3cecfa60b 100644
--- a/sources/pyside2/tests/QtGui/qstylehints_test.py
+++ b/sources/pyside2/tests/QtGui/qstylehints_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import QStyleHints
diff --git a/sources/pyside2/tests/QtGui/qtextdocument_functions.py b/sources/pyside2/tests/QtGui/qtextdocument_functions.py
index f1376aa5b..765a6b5b7 100644
--- a/sources/pyside2/tests/QtGui/qtextdocument_functions.py
+++ b/sources/pyside2/tests/QtGui/qtextdocument_functions.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import Qt
from PySide2.QtCore import QTextCodec
diff --git a/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py b/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py
index ce5474b42..1cbb8ff29 100644
--- a/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py
+++ b/sources/pyside2/tests/QtGui/qtextdocument_undoredo_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QTextDocument, QTextCursor
class QTextDocumentTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py b/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py
index f13ba884e..d9d96dd34 100644
--- a/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py
+++ b/sources/pyside2/tests/QtGui/qtextdocumentwriter_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QTextDocumentWriter, QTextDocument
from PySide2.QtCore import QBuffer
diff --git a/sources/pyside2/tests/QtGui/qtextline_test.py b/sources/pyside2/tests/QtGui/qtextline_test.py
index 5abdc076b..92af7b823 100644
--- a/sources/pyside2/tests/QtGui/qtextline_test.py
+++ b/sources/pyside2/tests/QtGui/qtextline_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QTextLayout
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtGui/qtransform_test.py b/sources/pyside2/tests/QtGui/qtransform_test.py
index f121868b0..29f9b86bb 100644
--- a/sources/pyside2/tests/QtGui/qtransform_test.py
+++ b/sources/pyside2/tests/QtGui/qtransform_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QPointF
from PySide2.QtGui import QTransform, QPolygonF, QPolygonF
diff --git a/sources/pyside2/tests/QtGui/repr_test.py b/sources/pyside2/tests/QtGui/repr_test.py
index bcf276319..e06f4d487 100644
--- a/sources/pyside2/tests/QtGui/repr_test.py
+++ b/sources/pyside2/tests/QtGui/repr_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
from PySide2.QtCore import QPoint
from PySide2.QtGui import QMatrix
diff --git a/sources/pyside2/tests/QtGui/timed_app_and_patching_test.py b/sources/pyside2/tests/QtGui/timed_app_and_patching_test.py
index 897310057..1f873fa02 100644
--- a/sources/pyside2/tests/QtGui/timed_app_and_patching_test.py
+++ b/sources/pyside2/tests/QtGui/timed_app_and_patching_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.timedqapplication import TimedQApplication
from PySide2.support import deprecated
diff --git a/sources/pyside2/tests/QtHelp/help_test.py b/sources/pyside2/tests/QtHelp/help_test.py
index e99214d4b..42814a30f 100644
--- a/sources/pyside2/tests/QtHelp/help_test.py
+++ b/sources/pyside2/tests/QtHelp/help_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtHelp import QHelpEngine
diff --git a/sources/pyside2/tests/QtHelp/helpsearchengine_test.py b/sources/pyside2/tests/QtHelp/helpsearchengine_test.py
index b81078b29..54f74b8fc 100644
--- a/sources/pyside2/tests/QtHelp/helpsearchengine_test.py
+++ b/sources/pyside2/tests/QtHelp/helpsearchengine_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtHelp import QHelpEngineCore, QHelpSearchEngine, QHelpSearchResult
diff --git a/sources/pyside2/tests/QtLocation/location.py b/sources/pyside2/tests/QtLocation/location.py
index e3c2f546e..151470a22 100644
--- a/sources/pyside2/tests/QtLocation/location.py
+++ b/sources/pyside2/tests/QtLocation/location.py
@@ -28,9 +28,17 @@
'''Unit test for Location'''
-from PySide2.QtLocation import QGeoServiceProvider
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtLocation import QGeoServiceProvider
+
+
class QLocationTestCase(unittest.TestCase):
def test(self):
geoServiceProvider = QGeoServiceProvider("none")
diff --git a/sources/pyside2/tests/QtMultimedia/audio_test.py b/sources/pyside2/tests/QtMultimedia/audio_test.py
index 97352988d..f242865f1 100644
--- a/sources/pyside2/tests/QtMultimedia/audio_test.py
+++ b/sources/pyside2/tests/QtMultimedia/audio_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqguiapplication import UsesQGuiApplication
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py b/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py
index 99d4bba83..f7ad812eb 100644
--- a/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py
+++ b/sources/pyside2/tests/QtMultimediaWidgets/qmultimediawidgets.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtMultimediaWidgets import QGraphicsVideoItem, QVideoWidget
diff --git a/sources/pyside2/tests/QtNetwork/accessManager_test.py b/sources/pyside2/tests/QtNetwork/accessManager_test.py
index 95c882d26..12ed25317 100644
--- a/sources/pyside2/tests/QtNetwork/accessManager_test.py
+++ b/sources/pyside2/tests/QtNetwork/accessManager_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from PySide2.QtNetwork import *
diff --git a/sources/pyside2/tests/QtNetwork/bug_1084.py b/sources/pyside2/tests/QtNetwork/bug_1084.py
index 947ba1466..d2c273fca 100644
--- a/sources/pyside2/tests/QtNetwork/bug_1084.py
+++ b/sources/pyside2/tests/QtNetwork/bug_1084.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtNetwork
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtNetwork/bug_446.py b/sources/pyside2/tests/QtNetwork/bug_446.py
index 91333ef7a..f15ff01f9 100644
--- a/sources/pyside2/tests/QtNetwork/bug_446.py
+++ b/sources/pyside2/tests/QtNetwork/bug_446.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from PySide2.QtNetwork import *
diff --git a/sources/pyside2/tests/QtNetwork/dnslookup_test.py b/sources/pyside2/tests/QtNetwork/dnslookup_test.py
index b0375b0f5..3a8b7a2d7 100644
--- a/sources/pyside2/tests/QtNetwork/dnslookup_test.py
+++ b/sources/pyside2/tests/QtNetwork/dnslookup_test.py
@@ -28,8 +28,14 @@
'''Test cases for QDnsLookup'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCoreApplication
from PySide2.QtNetwork import QDnsLookup
diff --git a/sources/pyside2/tests/QtNetwork/qipv6address_test.py b/sources/pyside2/tests/QtNetwork/qipv6address_test.py
index 04e6c3fc4..046d4d850 100644
--- a/sources/pyside2/tests/QtNetwork/qipv6address_test.py
+++ b/sources/pyside2/tests/QtNetwork/qipv6address_test.py
@@ -28,8 +28,14 @@
'''Test cases for QIPv6Address'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtNetwork import *
class QIPv6AddressGetItemTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py b/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py
index 503ffecdc..13da3e733 100644
--- a/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py
+++ b/sources/pyside2/tests/QtNetwork/qpassworddigestor_test.py
@@ -30,8 +30,14 @@
'''Test cases for QPasswordDigestor'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QByteArray, QCryptographicHash
from PySide2.QtNetwork import QPasswordDigestor
diff --git a/sources/pyside2/tests/QtNetwork/tcpserver_test.py b/sources/pyside2/tests/QtNetwork/tcpserver_test.py
index afa332898..9a047e5c6 100644
--- a/sources/pyside2/tests/QtNetwork/tcpserver_test.py
+++ b/sources/pyside2/tests/QtNetwork/tcpserver_test.py
@@ -28,8 +28,14 @@
'''Test cases for QTCPServer'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtNetwork import QTcpServer
class ListenDefaultArgsCase(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtNetwork/udpsocket_test.py b/sources/pyside2/tests/QtNetwork/udpsocket_test.py
index fc7f7b0d2..da5a21c29 100644
--- a/sources/pyside2/tests/QtNetwork/udpsocket_test.py
+++ b/sources/pyside2/tests/QtNetwork/udpsocket_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QUrl, QObject, SIGNAL, QCoreApplication, QTimer
from PySide2.QtNetwork import QUdpSocket, QHostAddress
diff --git a/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py b/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py
index 56812e0fa..e633d6ee2 100644
--- a/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py
+++ b/sources/pyside2/tests/QtOpenGL/qglbuffer_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QByteArray
from PySide2.QtOpenGL import QGLBuffer, QGLWidget
diff --git a/sources/pyside2/tests/QtOpenGL/qglwidget_test.py b/sources/pyside2/tests/QtOpenGL/qglwidget_test.py
index 8779578bf..c3bb7e27d 100644
--- a/sources/pyside2/tests/QtOpenGL/qglwidget_test.py
+++ b/sources/pyside2/tests/QtOpenGL/qglwidget_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from PySide2.QtOpenGL import *
diff --git a/sources/pyside2/tests/QtPositioning/positioning.py b/sources/pyside2/tests/QtPositioning/positioning.py
index 1b3e263ec..8b9b715c1 100644
--- a/sources/pyside2/tests/QtPositioning/positioning.py
+++ b/sources/pyside2/tests/QtPositioning/positioning.py
@@ -28,9 +28,17 @@
'''Unit test for Positioning'''
-from PySide2.QtPositioning import QGeoPositionInfoSource
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtPositioning import QGeoPositionInfoSource
+
+
class QPositioningTestCase(unittest.TestCase):
def test(self):
source = QGeoPositionInfoSource.createDefaultSource(None)
diff --git a/sources/pyside2/tests/QtPrintSupport/bug_500.py b/sources/pyside2/tests/QtPrintSupport/bug_500.py
index 0a13da7d1..43146d021 100644
--- a/sources/pyside2/tests/QtPrintSupport/bug_500.py
+++ b/sources/pyside2/tests/QtPrintSupport/bug_500.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from PySide2.QtPrintSupport import *
diff --git a/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py b/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
index 1ca9431c8..573ca9940 100644
--- a/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
+++ b/sources/pyside2/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QTextCursor
from PySide2.QtPrintSupport import QPrinter, QPrinterInfo
diff --git a/sources/pyside2/tests/QtQml/bug_1029.py b/sources/pyside2/tests/QtQml/bug_1029.py
index 92734cb3b..36306e4a2 100644
--- a/sources/pyside2/tests/QtQml/bug_1029.py
+++ b/sources/pyside2/tests/QtQml/bug_1029.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import sys
import gc
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QUrl
from PySide2.QtGui import QGuiApplication
diff --git a/sources/pyside2/tests/QtQml/bug_451.py b/sources/pyside2/tests/QtQml/bug_451.py
index f6405ffc8..f87680638 100644
--- a/sources/pyside2/tests/QtQml/bug_451.py
+++ b/sources/pyside2/tests/QtQml/bug_451.py
@@ -37,7 +37,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtQml/bug_456.py b/sources/pyside2/tests/QtQml/bug_456.py
index 0ecc012f8..a99ce2b80 100644
--- a/sources/pyside2/tests/QtQml/bug_456.py
+++ b/sources/pyside2/tests/QtQml/bug_456.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_557.py b/sources/pyside2/tests/QtQml/bug_557.py
index a8b330865..20892475f 100644
--- a/sources/pyside2/tests/QtQml/bug_557.py
+++ b/sources/pyside2/tests/QtQml/bug_557.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtQml/bug_726.py b/sources/pyside2/tests/QtQml/bug_726.py
index 4594a43b6..795d8a13f 100644
--- a/sources/pyside2/tests/QtQml/bug_726.py
+++ b/sources/pyside2/tests/QtQml/bug_726.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_814.py b/sources/pyside2/tests/QtQml/bug_814.py
index 5b38f134d..c6f0b8441 100644
--- a/sources/pyside2/tests/QtQml/bug_814.py
+++ b/sources/pyside2/tests/QtQml/bug_814.py
@@ -41,7 +41,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_825.py b/sources/pyside2/tests/QtQml/bug_825.py
index fcf0fac28..019653e93 100644
--- a/sources/pyside2/tests/QtQml/bug_825.py
+++ b/sources/pyside2/tests/QtQml/bug_825.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtQml/bug_847.py b/sources/pyside2/tests/QtQml/bug_847.py
index 7347e1649..ac5836459 100644
--- a/sources/pyside2/tests/QtQml/bug_847.py
+++ b/sources/pyside2/tests/QtQml/bug_847.py
@@ -40,7 +40,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_915.py b/sources/pyside2/tests/QtQml/bug_915.py
index 74cc30d4c..9c888b4ae 100644
--- a/sources/pyside2/tests/QtQml/bug_915.py
+++ b/sources/pyside2/tests/QtQml/bug_915.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_926.py b/sources/pyside2/tests/QtQml/bug_926.py
index 2eb958d89..0764b8e97 100644
--- a/sources/pyside2/tests/QtQml/bug_926.py
+++ b/sources/pyside2/tests/QtQml/bug_926.py
@@ -31,7 +31,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtQml/bug_951.py b/sources/pyside2/tests/QtQml/bug_951.py
index 2223b2a50..8919f5880 100644
--- a/sources/pyside2/tests/QtQml/bug_951.py
+++ b/sources/pyside2/tests/QtQml/bug_951.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_995.py b/sources/pyside2/tests/QtQml/bug_995.py
index 9a83a8110..945cd5bcc 100644
--- a/sources/pyside2/tests/QtQml/bug_995.py
+++ b/sources/pyside2/tests/QtQml/bug_995.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtQml/bug_997.py b/sources/pyside2/tests/QtQml/bug_997.py
index 9d4efff71..597e253e5 100644
--- a/sources/pyside2/tests/QtQml/bug_997.py
+++ b/sources/pyside2/tests/QtQml/bug_997.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtQml/connect_python_qml.py b/sources/pyside2/tests/QtQml/connect_python_qml.py
index 31569b7aa..22134efe7 100644
--- a/sources/pyside2/tests/QtQml/connect_python_qml.py
+++ b/sources/pyside2/tests/QtQml/connect_python_qml.py
@@ -37,7 +37,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/javascript_exceptions.py b/sources/pyside2/tests/QtQml/javascript_exceptions.py
index 2cf81fc80..a5e6a4b43 100644
--- a/sources/pyside2/tests/QtQml/javascript_exceptions.py
+++ b/sources/pyside2/tests/QtQml/javascript_exceptions.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py
index 281646545..f33d852a7 100644
--- a/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py
+++ b/sources/pyside2/tests/QtQml/qqmlincubator_incubateWhile.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtQml/qqmlnetwork_test.py b/sources/pyside2/tests/QtQml/qqmlnetwork_test.py
index 4ea5f8d19..2cc273431 100644
--- a/sources/pyside2/tests/QtQml/qqmlnetwork_test.py
+++ b/sources/pyside2/tests/QtQml/qqmlnetwork_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QUrl
from PySide2.QtQuick import QQuickView
diff --git a/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py b/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py
index a9618a92a..6735d5230 100644
--- a/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py
+++ b/sources/pyside2/tests/QtQml/qquickitem_grabToImage.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/qquickview_test.py b/sources/pyside2/tests/QtQml/qquickview_test.py
index e0b35dc59..0b723612e 100644
--- a/sources/pyside2/tests/QtQml/qquickview_test.py
+++ b/sources/pyside2/tests/QtQml/qquickview_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtQml/registertype.py b/sources/pyside2/tests/QtQml/registertype.py
index be15b87e8..7e6fe8d29 100644
--- a/sources/pyside2/tests/QtQml/registertype.py
+++ b/sources/pyside2/tests/QtQml/registertype.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtQml/signal_arguments.py b/sources/pyside2/tests/QtQml/signal_arguments.py
index d46a34fcb..98b52c05c 100644
--- a/sources/pyside2/tests/QtQml/signal_arguments.py
+++ b/sources/pyside2/tests/QtQml/signal_arguments.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtScript/base_test.py b/sources/pyside2/tests/QtScript/base_test.py
index 4343a6d77..3cde8ad83 100644
--- a/sources/pyside2/tests/QtScript/base_test.py
+++ b/sources/pyside2/tests/QtScript/base_test.py
@@ -26,6 +26,13 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtScript
diff --git a/sources/pyside2/tests/QtScript/bug_1022.py b/sources/pyside2/tests/QtScript/bug_1022.py
index 63866ec3c..2c2699de6 100644
--- a/sources/pyside2/tests/QtScript/bug_1022.py
+++ b/sources/pyside2/tests/QtScript/bug_1022.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtScript import *
diff --git a/sources/pyside2/tests/QtScript/engine_test.py b/sources/pyside2/tests/QtScript/engine_test.py
index 2b228281c..f88b98d69 100644
--- a/sources/pyside2/tests/QtScript/engine_test.py
+++ b/sources/pyside2/tests/QtScript/engine_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
from PySide2.QtScript import QScriptEngine
diff --git a/sources/pyside2/tests/QtScript/property_test.py b/sources/pyside2/tests/QtScript/property_test.py
index a5c9f059b..372bba2ba 100644
--- a/sources/pyside2/tests/QtScript/property_test.py
+++ b/sources/pyside2/tests/QtScript/property_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Property, QCoreApplication
from PySide2.QtScript import QScriptEngine
diff --git a/sources/pyside2/tests/QtScript/qscriptvalue_test.py b/sources/pyside2/tests/QtScript/qscriptvalue_test.py
index e5f2a0734..06a029232 100644
--- a/sources/pyside2/tests/QtScript/qscriptvalue_test.py
+++ b/sources/pyside2/tests/QtScript/qscriptvalue_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtScript import *
diff --git a/sources/pyside2/tests/QtScriptTools/debugger_test.py b/sources/pyside2/tests/QtScriptTools/debugger_test.py
index a5ec8867a..cefe48f5b 100644
--- a/sources/pyside2/tests/QtScriptTools/debugger_test.py
+++ b/sources/pyside2/tests/QtScriptTools/debugger_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import SIGNAL, QTimer
from PySide2.QtScript import QScriptEngine
diff --git a/sources/pyside2/tests/QtScxml/test_dynamic.py b/sources/pyside2/tests/QtScxml/test_dynamic.py
index 2a9ad97df..51672a9bb 100644
--- a/sources/pyside2/tests/QtScxml/test_dynamic.py
+++ b/sources/pyside2/tests/QtScxml/test_dynamic.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.timedqapplication import TimedQApplication
from PySide2.QtCore import QObject, SIGNAL
diff --git a/sources/pyside2/tests/QtSensors/sensors.py b/sources/pyside2/tests/QtSensors/sensors.py
index 2f25adebb..360d68999 100644
--- a/sources/pyside2/tests/QtSensors/sensors.py
+++ b/sources/pyside2/tests/QtSensors/sensors.py
@@ -30,9 +30,17 @@
'''Test cases for QSensor'''
-from PySide2.QtSensors import QSensor, QSensorReading
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtSensors import QSensor, QSensorReading
+
+
class QSensorTest(unittest.TestCase):
def test(self):
for sensorType in QSensor.sensorTypes():
diff --git a/sources/pyside2/tests/QtSql/bug_1013.py b/sources/pyside2/tests/QtSql/bug_1013.py
index 3b8fb5d09..3cade31f4 100644
--- a/sources/pyside2/tests/QtSql/bug_1013.py
+++ b/sources/pyside2/tests/QtSql/bug_1013.py
@@ -26,9 +26,17 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtSql import *
-import unittest
+
class TestBug1013 (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py b/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py
index 5bb034aa0..7db28b992 100644
--- a/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py
+++ b/sources/pyside2/tests/QtSql/qsqldatabaseandqueries_test.py
@@ -31,8 +31,14 @@
'''Test cases for QtSql database creation, destruction and queries'''
import sys
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtSql
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtSql/qvarianttype_test.py b/sources/pyside2/tests/QtSql/qvarianttype_test.py
index 266cafa22..3175a178f 100644
--- a/sources/pyside2/tests/QtSql/qvarianttype_test.py
+++ b/sources/pyside2/tests/QtSql/qvarianttype_test.py
@@ -31,7 +31,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2.QtSql import QSqlField
diff --git a/sources/pyside2/tests/QtSvg/qsvggenerator_test.py b/sources/pyside2/tests/QtSvg/qsvggenerator_test.py
index 2b3bed756..e4680f6ca 100644
--- a/sources/pyside2/tests/QtSvg/qsvggenerator_test.py
+++ b/sources/pyside2/tests/QtSvg/qsvggenerator_test.py
@@ -28,8 +28,15 @@
##
#############################################################################
-import unittest
+import os
+import sys
from sys import getrefcount
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QBuffer
from PySide2.QtSvg import QSvgGenerator
diff --git a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
index ee276ae93..88537edfe 100644
--- a/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
+++ b/sources/pyside2/tests/QtSvg/qsvgrenderer_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
-import unittest, os
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from PySide2.QtSvg import *
diff --git a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py b/sources/pyside2/tests/QtSvg/qsvgwidget_test.py
index 59cf35d63..17bf6527b 100644
--- a/sources/pyside2/tests/QtSvg/qsvgwidget_test.py
+++ b/sources/pyside2/tests/QtSvg/qsvgwidget_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
-import unittest, os
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from PySide2.QtSvg import *
diff --git a/sources/pyside2/tests/QtTest/click_test.py b/sources/pyside2/tests/QtTest/click_test.py
index 48b01e30c..8b3be38ea 100644
--- a/sources/pyside2/tests/QtTest/click_test.py
+++ b/sources/pyside2/tests/QtTest/click_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Qt, QObject
from PySide2.QtWidgets import QPushButton, QLineEdit
diff --git a/sources/pyside2/tests/QtTest/eventfilter_test.py b/sources/pyside2/tests/QtTest/eventfilter_test.py
index c087e2550..6ca61c36b 100644
--- a/sources/pyside2/tests/QtTest/eventfilter_test.py
+++ b/sources/pyside2/tests/QtTest/eventfilter_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Qt, QObject, QEvent
from PySide2.QtGui import QKeyEvent
diff --git a/sources/pyside2/tests/QtTest/qvalidator_test.py b/sources/pyside2/tests/QtTest/qvalidator_test.py
index d3ac5571f..021e455f2 100644
--- a/sources/pyside2/tests/QtTest/qvalidator_test.py
+++ b/sources/pyside2/tests/QtTest/qvalidator_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtTest/touchevent_test.py b/sources/pyside2/tests/QtTest/touchevent_test.py
index 0105ac684..8f9b88461 100644
--- a/sources/pyside2/tests/QtTest/touchevent_test.py
+++ b/sources/pyside2/tests/QtTest/touchevent_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtTextToSpeech/qtexttospeech_test.py b/sources/pyside2/tests/QtTextToSpeech/qtexttospeech_test.py
index 6bf8f85b1..4881bd25a 100644
--- a/sources/pyside2/tests/QtTextToSpeech/qtexttospeech_test.py
+++ b/sources/pyside2/tests/QtTextToSpeech/qtexttospeech_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_1060.py b/sources/pyside2/tests/QtUiTools/bug_1060.py
index 22da11a82..f60912780 100644
--- a/sources/pyside2/tests/QtUiTools/bug_1060.py
+++ b/sources/pyside2/tests/QtUiTools/bug_1060.py
@@ -31,7 +31,9 @@
import os
import sys
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from PySide2.QtWidgets import QApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_360.py b/sources/pyside2/tests/QtUiTools/bug_360.py
index 6af5ff49d..8d15f2730 100644
--- a/sources/pyside2/tests/QtUiTools/bug_360.py
+++ b/sources/pyside2/tests/QtUiTools/bug_360.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_376.py b/sources/pyside2/tests/QtUiTools/bug_376.py
index 1da380fd3..264faad7f 100644
--- a/sources/pyside2/tests/QtUiTools/bug_376.py
+++ b/sources/pyside2/tests/QtUiTools/bug_376.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_392.py b/sources/pyside2/tests/QtUiTools/bug_392.py
index 9b5782f2b..2439e7203 100644
--- a/sources/pyside2/tests/QtUiTools/bug_392.py
+++ b/sources/pyside2/tests/QtUiTools/bug_392.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtUiTools/bug_426.py b/sources/pyside2/tests/QtUiTools/bug_426.py
index 5b055a45f..e84da0382 100644
--- a/sources/pyside2/tests/QtUiTools/bug_426.py
+++ b/sources/pyside2/tests/QtUiTools/bug_426.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import sys
import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore, QtWidgets
from PySide2.QtUiTools import QUiLoader
diff --git a/sources/pyside2/tests/QtUiTools/bug_552.py b/sources/pyside2/tests/QtUiTools/bug_552.py
index 7a0530897..be42789cf 100644
--- a/sources/pyside2/tests/QtUiTools/bug_552.py
+++ b/sources/pyside2/tests/QtUiTools/bug_552.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
from PySide2 import QtWidgets, QtCore
diff --git a/sources/pyside2/tests/QtUiTools/bug_797.py b/sources/pyside2/tests/QtUiTools/bug_797.py
index 0fb7ed435..454699196 100644
--- a/sources/pyside2/tests/QtUiTools/bug_797.py
+++ b/sources/pyside2/tests/QtUiTools/bug_797.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/bug_909.py b/sources/pyside2/tests/QtUiTools/bug_909.py
index 5c9c12521..9831b6b0e 100644
--- a/sources/pyside2/tests/QtUiTools/bug_909.py
+++ b/sources/pyside2/tests/QtUiTools/bug_909.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QFile
from PySide2.QtWidgets import QTabWidget
diff --git a/sources/pyside2/tests/QtUiTools/bug_913.py b/sources/pyside2/tests/QtUiTools/bug_913.py
index b0a871b8b..3e2ca818b 100644
--- a/sources/pyside2/tests/QtUiTools/bug_913.py
+++ b/sources/pyside2/tests/QtUiTools/bug_913.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/bug_958.py b/sources/pyside2/tests/QtUiTools/bug_958.py
index f631d36e3..98ac16189 100644
--- a/sources/pyside2/tests/QtUiTools/bug_958.py
+++ b/sources/pyside2/tests/QtUiTools/bug_958.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtWidgets, QtUiTools
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/bug_965.py b/sources/pyside2/tests/QtUiTools/bug_965.py
index a8fabe727..217f948af 100644
--- a/sources/pyside2/tests/QtUiTools/bug_965.py
+++ b/sources/pyside2/tests/QtUiTools/bug_965.py
@@ -26,12 +26,15 @@
##
#############################################################################
-from PySide2.QtUiTools import QUiLoader
import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtUiTools import QUiLoader
from helper.usesqapplication import UsesQApplication
from helper.helper import adjust_filename
diff --git a/sources/pyside2/tests/QtUiTools/ui_test.py b/sources/pyside2/tests/QtUiTools/ui_test.py
index 2fe78fba4..6705bb0be 100644
--- a/sources/pyside2/tests/QtUiTools/ui_test.py
+++ b/sources/pyside2/tests/QtUiTools/ui_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtUiTools import QUiLoader
diff --git a/sources/pyside2/tests/QtUiTools/uiloader_test.py b/sources/pyside2/tests/QtUiTools/uiloader_test.py
index 4f5881719..48b401426 100644
--- a/sources/pyside2/tests/QtUiTools/uiloader_test.py
+++ b/sources/pyside2/tests/QtUiTools/uiloader_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWebEngine/web_engine_initialize.py b/sources/pyside2/tests/QtWebEngine/web_engine_initialize.py
index f6abeb9cd..1f0482f96 100644
--- a/sources/pyside2/tests/QtWebEngine/web_engine_initialize.py
+++ b/sources/pyside2/tests/QtWebEngine/web_engine_initialize.py
@@ -28,8 +28,14 @@
from __future__ import print_function
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QTimer
from PySide2.QtWebEngine import QtWebEngine
from PySide2.QtWidgets import QApplication
diff --git a/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py b/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py
index 7fc879fa9..190810edb 100644
--- a/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py
+++ b/sources/pyside2/tests/QtWebEngineCore/web_engine_custom_scheme.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QBuffer, Qt, QTimer
from PySide2.QtWidgets import QApplication, QWidget, QVBoxLayout
diff --git a/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py b/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
index a56d6d0f5..a40e29887 100644
--- a/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
+++ b/sources/pyside2/tests/QtWebEngineWidgets/pyside-474-qtwebengineview.py
@@ -28,8 +28,14 @@
from __future__ import print_function
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtWidgets
from PySide2 import QtWebEngineWidgets
diff --git a/sources/pyside2/tests/QtWebKit/bug_448.py b/sources/pyside2/tests/QtWebKit/bug_448.py
index c8341840a..98ebb1958 100644
--- a/sources/pyside2/tests/QtWebKit/bug_448.py
+++ b/sources/pyside2/tests/QtWebKit/bug_448.py
@@ -28,8 +28,13 @@
'''Test cases for bug: http://bugs.openbossa.org/show_bug.cgi?id=448'''
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QApplication
from PySide2.QtWebKit import QWebView
diff --git a/sources/pyside2/tests/QtWebKit/bug_694.py b/sources/pyside2/tests/QtWebKit/bug_694.py
index 60fb37f84..b18d658f6 100644
--- a/sources/pyside2/tests/QtWebKit/bug_694.py
+++ b/sources/pyside2/tests/QtWebKit/bug_694.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
from PySide2.QtWebKit import *
diff --git a/sources/pyside2/tests/QtWebKit/bug_803.py b/sources/pyside2/tests/QtWebKit/bug_803.py
index ea2b34ce2..ec6f93c33 100644
--- a/sources/pyside2/tests/QtWebKit/bug_803.py
+++ b/sources/pyside2/tests/QtWebKit/bug_803.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import *
from PySide2.QtWebKit import *
diff --git a/sources/pyside2/tests/QtWebKit/bug_899.py b/sources/pyside2/tests/QtWebKit/bug_899.py
index 681210444..cb8e76784 100644
--- a/sources/pyside2/tests/QtWebKit/bug_899.py
+++ b/sources/pyside2/tests/QtWebKit/bug_899.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Property, QObject
from PySide2.QtWebKit import QWebView
diff --git a/sources/pyside2/tests/QtWebKit/bug_959.py b/sources/pyside2/tests/QtWebKit/bug_959.py
index 6ddf25540..5214ee1e1 100644
--- a/sources/pyside2/tests/QtWebKit/bug_959.py
+++ b/sources/pyside2/tests/QtWebKit/bug_959.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWebKit/qml_plugin_test.py b/sources/pyside2/tests/QtWebKit/qml_plugin_test.py
index 5cb6cee57..33497bdc1 100644
--- a/sources/pyside2/tests/QtWebKit/qml_plugin_test.py
+++ b/sources/pyside2/tests/QtWebKit/qml_plugin_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QUrl, QTimer
from PySide2.QtWidgets import QApplication, QLabel
diff --git a/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py b/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py
index aeee109d0..6a51a6488 100644
--- a/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py
+++ b/sources/pyside2/tests/QtWebKit/qvariantlist_property_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Property, QObject
from PySide2.QtWebKit import QWebView
diff --git a/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py b/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py
index 722fc63d1..4db5adbb5 100644
--- a/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py
+++ b/sources/pyside2/tests/QtWebKit/shouldInterruptjavascript_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore, QtWebKit
diff --git a/sources/pyside2/tests/QtWebKit/webframe_test.py b/sources/pyside2/tests/QtWebKit/webframe_test.py
index b92174c80..d46c1b229 100644
--- a/sources/pyside2/tests/QtWebKit/webframe_test.py
+++ b/sources/pyside2/tests/QtWebKit/webframe_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, QUrl
from PySide2.QtWebKit import *
diff --git a/sources/pyside2/tests/QtWebKit/webpage_test.py b/sources/pyside2/tests/QtWebKit/webpage_test.py
index 22ad1ff9f..0c37befa2 100644
--- a/sources/pyside2/tests/QtWebKit/webpage_test.py
+++ b/sources/pyside2/tests/QtWebKit/webpage_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, QUrl
from PySide2.QtWebKit import QWebPage
diff --git a/sources/pyside2/tests/QtWebKit/webview_test.py b/sources/pyside2/tests/QtWebKit/webview_test.py
index 06e5b7d0f..5ecac5387 100644
--- a/sources/pyside2/tests/QtWebKit/webview_test.py
+++ b/sources/pyside2/tests/QtWebKit/webview_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtWidgets/action_clear.py b/sources/pyside2/tests/QtWidgets/action_clear.py
index b8a6ad590..ed8150493 100644
--- a/sources/pyside2/tests/QtWidgets/action_clear.py
+++ b/sources/pyside2/tests/QtWidgets/action_clear.py
@@ -31,7 +31,9 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QMenu, QWidget, QMenuBar, QToolBar
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/add_action_test.py b/sources/pyside2/tests/QtWidgets/add_action_test.py
index 1dbc5d549..c8a7c2269 100644
--- a/sources/pyside2/tests/QtWidgets/add_action_test.py
+++ b/sources/pyside2/tests/QtWidgets/add_action_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import SLOT
from PySide2.QtWidgets import QMenuBar, QAction, QPushButton
diff --git a/sources/pyside2/tests/QtWidgets/api2_test.py b/sources/pyside2/tests/QtWidgets/api2_test.py
index 151ebb9fc..379d3e997 100644
--- a/sources/pyside2/tests/QtWidgets/api2_test.py
+++ b/sources/pyside2/tests/QtWidgets/api2_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QIntValidator, QValidator
from PySide2.QtWidgets import QWidget, QSpinBox, QApplication
diff --git a/sources/pyside2/tests/QtWidgets/application_test.py b/sources/pyside2/tests/QtWidgets/application_test.py
index efb41684a..a5b949ec6 100644
--- a/sources/pyside2/tests/QtWidgets/application_test.py
+++ b/sources/pyside2/tests/QtWidgets/application_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import TestObject
from PySide2.QtWidgets import QApplication
from PySide2 import __all__ as all
diff --git a/sources/pyside2/tests/QtWidgets/bug_1002.py b/sources/pyside2/tests/QtWidgets/bug_1002.py
index c25209d2a..2810ca07f 100644
--- a/sources/pyside2/tests/QtWidgets/bug_1002.py
+++ b/sources/pyside2/tests/QtWidgets/bug_1002.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QWidget, QPushButton
diff --git a/sources/pyside2/tests/QtWidgets/bug_1006.py b/sources/pyside2/tests/QtWidgets/bug_1006.py
index 8b7ab7802..f7d4af804 100644
--- a/sources/pyside2/tests/QtWidgets/bug_1006.py
+++ b/sources/pyside2/tests/QtWidgets/bug_1006.py
@@ -31,7 +31,9 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QDialog, QLabel, QGridLayout, QHBoxLayout, QWidget
diff --git a/sources/pyside2/tests/QtWidgets/bug_1048.py b/sources/pyside2/tests/QtWidgets/bug_1048.py
index 2042a99c4..1b2189a7a 100644
--- a/sources/pyside2/tests/QtWidgets/bug_1048.py
+++ b/sources/pyside2/tests/QtWidgets/bug_1048.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2 import QtWidgets
a = QtWidgets.QApplication([])
diff --git a/sources/pyside2/tests/QtWidgets/bug_1077.py b/sources/pyside2/tests/QtWidgets/bug_1077.py
index 7943e5550..cb3bf70c4 100644
--- a/sources/pyside2/tests/QtWidgets/bug_1077.py
+++ b/sources/pyside2/tests/QtWidgets/bug_1077.py
@@ -28,9 +28,18 @@
''' unit test for BUG #1077 '''
-from PySide2 import QtCore, QtGui, QtWidgets
+import os
+import sys
import time
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
+from PySide2 import QtCore, QtGui, QtWidgets
+
+
class Highlighter(QtGui.QSyntaxHighlighter):
def __init__(self, parent, mode):
QtGui.QSyntaxHighlighter.__init__(self, parent)
diff --git a/sources/pyside2/tests/QtWidgets/bug_172.py b/sources/pyside2/tests/QtWidgets/bug_172.py
index 5b0822555..c9cc8d088 100644
--- a/sources/pyside2/tests/QtWidgets/bug_172.py
+++ b/sources/pyside2/tests/QtWidgets/bug_172.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtWidgets import *
if __name__ == '__main__':
diff --git a/sources/pyside2/tests/QtWidgets/bug_243.py b/sources/pyside2/tests/QtWidgets/bug_243.py
index 7ce0a468e..bf5fa2eaa 100644
--- a/sources/pyside2/tests/QtWidgets/bug_243.py
+++ b/sources/pyside2/tests/QtWidgets/bug_243.py
@@ -28,8 +28,13 @@
''' Test bug 243: http://bugs.openbossa.org/show_bug.cgi?id=243'''
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QApplication, QMainWindow, QLayout
diff --git a/sources/pyside2/tests/QtWidgets/bug_307.py b/sources/pyside2/tests/QtWidgets/bug_307.py
index 0a0e9faa5..d3e8ba9df 100644
--- a/sources/pyside2/tests/QtWidgets/bug_307.py
+++ b/sources/pyside2/tests/QtWidgets/bug_307.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import unittest
import colorsys
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import SIGNAL
from PySide2.QtWidgets import QPushButton, QApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_324.py b/sources/pyside2/tests/QtWidgets/bug_324.py
index fbaf43738..c6e5a757a 100644
--- a/sources/pyside2/tests/QtWidgets/bug_324.py
+++ b/sources/pyside2/tests/QtWidgets/bug_324.py
@@ -28,9 +28,14 @@
''' Test bug 324: http://bugs.openbossa.org/show_bug.cgi?id=324'''
-import unittest
+import os
import sys
-import signal
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_338.py b/sources/pyside2/tests/QtWidgets/bug_338.py
index e51cb1523..ca095a617 100644
--- a/sources/pyside2/tests/QtWidgets/bug_338.py
+++ b/sources/pyside2/tests/QtWidgets/bug_338.py
@@ -28,9 +28,14 @@
''' Test bug 338: http://bugs.openbossa.org/show_bug.cgi?id=338'''
+import os
import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore, QtWidgets
class DiagramItem(QtWidgets.QGraphicsPolygonItem):
diff --git a/sources/pyside2/tests/QtWidgets/bug_363.py b/sources/pyside2/tests/QtWidgets/bug_363.py
index a5abb4dbf..910525fed 100644
--- a/sources/pyside2/tests/QtWidgets/bug_363.py
+++ b/sources/pyside2/tests/QtWidgets/bug_363.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2 import QtCore, QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/bug_389.py b/sources/pyside2/tests/QtWidgets/bug_389.py
index bd18705a6..dcc4a5df7 100644
--- a/sources/pyside2/tests/QtWidgets/bug_389.py
+++ b/sources/pyside2/tests/QtWidgets/bug_389.py
@@ -32,7 +32,9 @@ import sys
import os
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2 import QtCore, QtGui, QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/bug_400.py b/sources/pyside2/tests/QtWidgets/bug_400.py
index e98ce3d22..03f82a149 100644
--- a/sources/pyside2/tests/QtWidgets/bug_400.py
+++ b/sources/pyside2/tests/QtWidgets/bug_400.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtWidgets import QTreeWidgetItemIterator, QTreeWidgetItem, QTreeWidget
diff --git a/sources/pyside2/tests/QtWidgets/bug_416.py b/sources/pyside2/tests/QtWidgets/bug_416.py
index f88f3965b..092abebaf 100644
--- a/sources/pyside2/tests/QtWidgets/bug_416.py
+++ b/sources/pyside2/tests/QtWidgets/bug_416.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.timedqapplication import TimedQApplication
from PySide2.QtCore import QSignalTransition, QState, Qt, QStateMachine
diff --git a/sources/pyside2/tests/QtWidgets/bug_429.py b/sources/pyside2/tests/QtWidgets/bug_429.py
index dea855f30..9b2fb9c42 100644
--- a/sources/pyside2/tests/QtWidgets/bug_429.py
+++ b/sources/pyside2/tests/QtWidgets/bug_429.py
@@ -26,9 +26,17 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
-import sys
+
app = QApplication(sys.argv)
scene = QGraphicsScene()
diff --git a/sources/pyside2/tests/QtWidgets/bug_430.py b/sources/pyside2/tests/QtWidgets/bug_430.py
index 89f6f795d..81a8d34f6 100644
--- a/sources/pyside2/tests/QtWidgets/bug_430.py
+++ b/sources/pyside2/tests/QtWidgets/bug_430.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_433.py b/sources/pyside2/tests/QtWidgets/bug_433.py
index a214b2cce..ab316db1e 100644
--- a/sources/pyside2/tests/QtWidgets/bug_433.py
+++ b/sources/pyside2/tests/QtWidgets/bug_433.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
import sys
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2 import QtCore, QtWidgets
class Test(QtWidgets.QGraphicsView):
diff --git a/sources/pyside2/tests/QtWidgets/bug_467.py b/sources/pyside2/tests/QtWidgets/bug_467.py
index d26b4424c..ee2da71dc 100644
--- a/sources/pyside2/tests/QtWidgets/bug_467.py
+++ b/sources/pyside2/tests/QtWidgets/bug_467.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtWidgets import QMainWindow, QApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_493.py b/sources/pyside2/tests/QtWidgets/bug_493.py
index 19cbb0023..a981952fb 100644
--- a/sources/pyside2/tests/QtWidgets/bug_493.py
+++ b/sources/pyside2/tests/QtWidgets/bug_493.py
@@ -26,10 +26,17 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import Qt, QEvent
from PySide2.QtGui import QKeyEvent, QKeySequence
from PySide2.QtWidgets import QApplication
-import unittest
class TestBug493(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_512.py b/sources/pyside2/tests/QtWidgets/bug_512.py
index 5d1cab9bb..45f127c73 100644
--- a/sources/pyside2/tests/QtWidgets/bug_512.py
+++ b/sources/pyside2/tests/QtWidgets/bug_512.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_525.py b/sources/pyside2/tests/QtWidgets/bug_525.py
index 842a4406f..bb0244497 100644
--- a/sources/pyside2/tests/QtWidgets/bug_525.py
+++ b/sources/pyside2/tests/QtWidgets/bug_525.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import QApplication
from PySide2.QtWidgets import QMenu
diff --git a/sources/pyside2/tests/QtWidgets/bug_546.py b/sources/pyside2/tests/QtWidgets/bug_546.py
index a56406cc3..3fadcfaef 100644
--- a/sources/pyside2/tests/QtWidgets/bug_546.py
+++ b/sources/pyside2/tests/QtWidgets/bug_546.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import *
class TestBug546(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_547.py b/sources/pyside2/tests/QtWidgets/bug_547.py
index ac2000716..070b2f81a 100644
--- a/sources/pyside2/tests/QtWidgets/bug_547.py
+++ b/sources/pyside2/tests/QtWidgets/bug_547.py
@@ -30,8 +30,14 @@
""" http://bugs.openbossa.org/show_bug.cgi?id=547 """
import sys
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtWidgets
class MyMainWindow(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_549.py b/sources/pyside2/tests/QtWidgets/bug_549.py
index 0e2afc653..7da9cca8f 100644
--- a/sources/pyside2/tests/QtWidgets/bug_549.py
+++ b/sources/pyside2/tests/QtWidgets/bug_549.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import *
class TestBug549(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_569.py b/sources/pyside2/tests/QtWidgets/bug_569.py
index 4e3d07c35..cf95467c6 100644
--- a/sources/pyside2/tests/QtWidgets/bug_569.py
+++ b/sources/pyside2/tests/QtWidgets/bug_569.py
@@ -26,9 +26,16 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
-import unittest
class TestBug569(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_575.py b/sources/pyside2/tests/QtWidgets/bug_575.py
index 4996c6986..425a659e2 100644
--- a/sources/pyside2/tests/QtWidgets/bug_575.py
+++ b/sources/pyside2/tests/QtWidgets/bug_575.py
@@ -29,10 +29,18 @@
""" Unittest for bug #575 """
""" http://bugs.openbossa.org/show_bug.cgi?id=575 """
-from PySide2.QtWidgets import QApplication, QPlainTextEdit, QTextEdit
+import sys
+import os
import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtWidgets import QApplication, QPlainTextEdit, QTextEdit
+
+
class Bug575(unittest.TestCase):
def testPropertyValues(self):
app = QApplication(sys.argv)
diff --git a/sources/pyside2/tests/QtWidgets/bug_576.py b/sources/pyside2/tests/QtWidgets/bug_576.py
index b0b044499..9674f7a9d 100644
--- a/sources/pyside2/tests/QtWidgets/bug_576.py
+++ b/sources/pyside2/tests/QtWidgets/bug_576.py
@@ -30,8 +30,14 @@
""" http://bugs.openbossa.org/show_bug.cgi?id=576 """
import sys
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore, QtWidgets
class Bug576(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_585.py b/sources/pyside2/tests/QtWidgets/bug_585.py
index 1c5eb75f1..a0e5c0b5e 100644
--- a/sources/pyside2/tests/QtWidgets/bug_585.py
+++ b/sources/pyside2/tests/QtWidgets/bug_585.py
@@ -28,9 +28,14 @@
'''Test bug 585: http://bugs.openbossa.org/show_bug.cgi?id=585'''
+import os
import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore, QtWidgets
class Bug585(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_589.py b/sources/pyside2/tests/QtWidgets/bug_589.py
index c75a12f7f..8f81384a7 100644
--- a/sources/pyside2/tests/QtWidgets/bug_589.py
+++ b/sources/pyside2/tests/QtWidgets/bug_589.py
@@ -28,10 +28,17 @@
# trimmed down diagramscene.py to demonstrate crash in sizeHint()
+import os
import sys
-from PySide2 import QtCore, QtWidgets
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2 import QtCore, QtWidgets
+
+
class CustomWidget(QtWidgets.QGraphicsProxyWidget):
def itemChange(self, eventType, value):
QtWidgets.QGraphicsProxyWidget.itemChange(self, eventType, value)
diff --git a/sources/pyside2/tests/QtWidgets/bug_632.py b/sources/pyside2/tests/QtWidgets/bug_632.py
index e60416102..d836b2ff6 100644
--- a/sources/pyside2/tests/QtWidgets/bug_632.py
+++ b/sources/pyside2/tests/QtWidgets/bug_632.py
@@ -26,10 +26,16 @@
##
#############################################################################
+import os
import sys
-from PySide2.QtWidgets import QLineEdit, QApplication
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtWidgets import QLineEdit, QApplication
+
class Bug589(unittest.TestCase):
def testWrongSignature(self):
diff --git a/sources/pyside2/tests/QtWidgets/bug_635.py b/sources/pyside2/tests/QtWidgets/bug_635.py
index 59f27fa22..6707c3f05 100644
--- a/sources/pyside2/tests/QtWidgets/bug_635.py
+++ b/sources/pyside2/tests/QtWidgets/bug_635.py
@@ -28,10 +28,17 @@
''' Test bug 635: http://bugs.openbossa.org/show_bug.cgi?id=635'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QApplication, QToolBar
-import sys
+
class testQToolBar(unittest.TestCase):
def callback(self):
diff --git a/sources/pyside2/tests/QtWidgets/bug_640.py b/sources/pyside2/tests/QtWidgets/bug_640.py
index 9e63a1d7f..13d98aa47 100644
--- a/sources/pyside2/tests/QtWidgets/bug_640.py
+++ b/sources/pyside2/tests/QtWidgets/bug_640.py
@@ -26,10 +26,17 @@
##
#############################################################################
+import os
import sys
-from PySide2.QtWidgets import *
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtWidgets import *
+
+
class Bug640(unittest.TestCase):
def testIt(self):
option = QStyleOptionGraphicsItem()
diff --git a/sources/pyside2/tests/QtWidgets/bug_653.py b/sources/pyside2/tests/QtWidgets/bug_653.py
index e1b2ed416..df7dbacdb 100644
--- a/sources/pyside2/tests/QtWidgets/bug_653.py
+++ b/sources/pyside2/tests/QtWidgets/bug_653.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
@@ -42,4 +49,4 @@ class TestBug653(unittest.TestCase):
wizard.show()
if __name__ == "__main__":
- unittest.main() \ No newline at end of file
+ unittest.main()
diff --git a/sources/pyside2/tests/QtWidgets/bug_662.py b/sources/pyside2/tests/QtWidgets/bug_662.py
index a5cc650c1..7fb97deb6 100644
--- a/sources/pyside2/tests/QtWidgets/bug_662.py
+++ b/sources/pyside2/tests/QtWidgets/bug_662.py
@@ -28,7 +28,13 @@
''' Test bug 662: http://bugs.openbossa.org/show_bug.cgi?id=662'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QTextCharFormat
from PySide2.QtWidgets import QTextEdit, QApplication
import sys
diff --git a/sources/pyside2/tests/QtWidgets/bug_667.py b/sources/pyside2/tests/QtWidgets/bug_667.py
index e2b472299..cbbd57c20 100644
--- a/sources/pyside2/tests/QtWidgets/bug_667.py
+++ b/sources/pyside2/tests/QtWidgets/bug_667.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
import sys
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import QTimer, QPointF
from PySide2.QtWidgets import QApplication, QGraphicsView, QGraphicsScene, QGraphicsEllipseItem
diff --git a/sources/pyside2/tests/QtWidgets/bug_668.py b/sources/pyside2/tests/QtWidgets/bug_668.py
index 05cffa39d..42d956257 100644
--- a/sources/pyside2/tests/QtWidgets/bug_668.py
+++ b/sources/pyside2/tests/QtWidgets/bug_668.py
@@ -28,10 +28,17 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
-import sys
class A(QMainWindow):
def __init__(self, parent=None):
diff --git a/sources/pyside2/tests/QtWidgets/bug_674.py b/sources/pyside2/tests/QtWidgets/bug_674.py
index 40fd19206..1c8f55338 100644
--- a/sources/pyside2/tests/QtWidgets/bug_674.py
+++ b/sources/pyside2/tests/QtWidgets/bug_674.py
@@ -26,10 +26,17 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
-import unittest
-import sys
+
class TestBug679(unittest.TestCase):
'''QGraphicsScene::clear() is missing'''
diff --git a/sources/pyside2/tests/QtWidgets/bug_675.py b/sources/pyside2/tests/QtWidgets/bug_675.py
index 93489064b..1e54f1b8f 100644
--- a/sources/pyside2/tests/QtWidgets/bug_675.py
+++ b/sources/pyside2/tests/QtWidgets/bug_675.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_688.py b/sources/pyside2/tests/QtWidgets/bug_688.py
index 4627d8042..97d62e2c9 100644
--- a/sources/pyside2/tests/QtWidgets/bug_688.py
+++ b/sources/pyside2/tests/QtWidgets/bug_688.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import QTextFrame, QTextCursor, QTextCharFormat, QFont, QTextFrameFormat
diff --git a/sources/pyside2/tests/QtWidgets/bug_693.py b/sources/pyside2/tests/QtWidgets/bug_693.py
index 31b0262c4..68d19e00f 100644
--- a/sources/pyside2/tests/QtWidgets/bug_693.py
+++ b/sources/pyside2/tests/QtWidgets/bug_693.py
@@ -26,9 +26,17 @@
##
#############################################################################
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
-import unittest
+
class MyModel (QAbstractListModel):
diff --git a/sources/pyside2/tests/QtWidgets/bug_696.py b/sources/pyside2/tests/QtWidgets/bug_696.py
index 5af193ffc..abd4246a5 100644
--- a/sources/pyside2/tests/QtWidgets/bug_696.py
+++ b/sources/pyside2/tests/QtWidgets/bug_696.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtWidgets import QMainWindow, QMenu, QApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_711.py b/sources/pyside2/tests/QtWidgets/bug_711.py
index 073d4e3c8..43e4b7bb2 100644
--- a/sources/pyside2/tests/QtWidgets/bug_711.py
+++ b/sources/pyside2/tests/QtWidgets/bug_711.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import QToolBar, QApplication, QAction, QToolButton
try:
diff --git a/sources/pyside2/tests/QtWidgets/bug_714.py b/sources/pyside2/tests/QtWidgets/bug_714.py
index 345207ff9..76cf0295b 100644
--- a/sources/pyside2/tests/QtWidgets/bug_714.py
+++ b/sources/pyside2/tests/QtWidgets/bug_714.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QLabel, QApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_722.py b/sources/pyside2/tests/QtWidgets/bug_722.py
index 1cdf7ff43..7eae897dc 100644
--- a/sources/pyside2/tests/QtWidgets/bug_722.py
+++ b/sources/pyside2/tests/QtWidgets/bug_722.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_728.py b/sources/pyside2/tests/QtWidgets/bug_728.py
index 59269d72c..5cd39b66f 100644
--- a/sources/pyside2/tests/QtWidgets/bug_728.py
+++ b/sources/pyside2/tests/QtWidgets/bug_728.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtWidgets import *
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_736.py b/sources/pyside2/tests/QtWidgets/bug_736.py
index 31ce80e57..4e040f965 100644
--- a/sources/pyside2/tests/QtWidgets/bug_736.py
+++ b/sources/pyside2/tests/QtWidgets/bug_736.py
@@ -26,7 +26,13 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_750.py b/sources/pyside2/tests/QtWidgets/bug_750.py
index 78d333efd..20f2d5d58 100644
--- a/sources/pyside2/tests/QtWidgets/bug_750.py
+++ b/sources/pyside2/tests/QtWidgets/bug_750.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_778.py b/sources/pyside2/tests/QtWidgets/bug_778.py
index c5615b06f..148ae5ae5 100644
--- a/sources/pyside2/tests/QtWidgets/bug_778.py
+++ b/sources/pyside2/tests/QtWidgets/bug_778.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_785.py b/sources/pyside2/tests/QtWidgets/bug_785.py
index 312b17996..ba18a99a1 100644
--- a/sources/pyside2/tests/QtWidgets/bug_785.py
+++ b/sources/pyside2/tests/QtWidgets/bug_785.py
@@ -26,9 +26,14 @@
##
#############################################################################
+import os
import sys
-
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QItemSelection
from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtWidgets import QApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_793.py b/sources/pyside2/tests/QtWidgets/bug_793.py
index 3d63cae2e..37eddfd57 100644
--- a/sources/pyside2/tests/QtWidgets/bug_793.py
+++ b/sources/pyside2/tests/QtWidgets/bug_793.py
@@ -26,8 +26,14 @@
##
#############################################################################
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QTimer
from PySide2.QtWidgets import QWidget, QApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_811.py b/sources/pyside2/tests/QtWidgets/bug_811.py
index aa0ebfae5..fd618fba3 100644
--- a/sources/pyside2/tests/QtWidgets/bug_811.py
+++ b/sources/pyside2/tests/QtWidgets/bug_811.py
@@ -31,7 +31,9 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/bug_834.py b/sources/pyside2/tests/QtWidgets/bug_834.py
index 129da321c..9dba711ed 100644
--- a/sources/pyside2/tests/QtWidgets/bug_834.py
+++ b/sources/pyside2/tests/QtWidgets/bug_834.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2 import QtCore, QtWidgets
class Window(QtWidgets.QMainWindow):
diff --git a/sources/pyside2/tests/QtWidgets/bug_836.py b/sources/pyside2/tests/QtWidgets/bug_836.py
index 69e23e2dc..4d995ddcb 100644
--- a/sources/pyside2/tests/QtWidgets/bug_836.py
+++ b/sources/pyside2/tests/QtWidgets/bug_836.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_844.py b/sources/pyside2/tests/QtWidgets/bug_844.py
index 822863294..a14e3afc3 100644
--- a/sources/pyside2/tests/QtWidgets/bug_844.py
+++ b/sources/pyside2/tests/QtWidgets/bug_844.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import sys
+import os
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtWidgets import *
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_854.py b/sources/pyside2/tests/QtWidgets/bug_854.py
index 60d843b64..acfa1c270 100644
--- a/sources/pyside2/tests/QtWidgets/bug_854.py
+++ b/sources/pyside2/tests/QtWidgets/bug_854.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QTableView, QVBoxLayout, QApplication
from PySide2.QtCore import QAbstractItemModel
diff --git a/sources/pyside2/tests/QtWidgets/bug_860.py b/sources/pyside2/tests/QtWidgets/bug_860.py
index 7440b2613..8cdab2e45 100644
--- a/sources/pyside2/tests/QtWidgets/bug_860.py
+++ b/sources/pyside2/tests/QtWidgets/bug_860.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QSignalMapper
from PySide2.QtWidgets import QCheckBox
diff --git a/sources/pyside2/tests/QtWidgets/bug_862.py b/sources/pyside2/tests/QtWidgets/bug_862.py
index 4621fc3b4..96aeb6f14 100644
--- a/sources/pyside2/tests/QtWidgets/bug_862.py
+++ b/sources/pyside2/tests/QtWidgets/bug_862.py
@@ -48,11 +48,18 @@
# <__main__.MyQGraphicsItem object at 0x7f55cf226c20>
#
+import os
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject
from PySide2.QtWidgets import *
import PySide2.QtCore
-import unittest
+
class MyQObject(QObject):
def __init__(self):
diff --git a/sources/pyside2/tests/QtWidgets/bug_871.py b/sources/pyside2/tests/QtWidgets/bug_871.py
index a3759cb97..4a53b98aa 100644
--- a/sources/pyside2/tests/QtWidgets/bug_871.py
+++ b/sources/pyside2/tests/QtWidgets/bug_871.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtGui import QValidator, QIntValidator
diff --git a/sources/pyside2/tests/QtWidgets/bug_879.py b/sources/pyside2/tests/QtWidgets/bug_879.py
index 59eb979aa..981be0390 100644
--- a/sources/pyside2/tests/QtWidgets/bug_879.py
+++ b/sources/pyside2/tests/QtWidgets/bug_879.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QCoreApplication, QTimer, QEvent, Qt
from PySide2.QtWidgets import QApplication, QSpinBox
from PySide2.QtGui import QKeyEvent
diff --git a/sources/pyside2/tests/QtWidgets/bug_919.py b/sources/pyside2/tests/QtWidgets/bug_919.py
index 4ef133fa3..40ba94d2e 100644
--- a/sources/pyside2/tests/QtWidgets/bug_919.py
+++ b/sources/pyside2/tests/QtWidgets/bug_919.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.timedqapplication import TimedQApplication
from PySide2.QtCore import Signal, QTimer
diff --git a/sources/pyside2/tests/QtWidgets/bug_921.py b/sources/pyside2/tests/QtWidgets/bug_921.py
index 9380a08f1..56abe0970 100644
--- a/sources/pyside2/tests/QtWidgets/bug_921.py
+++ b/sources/pyside2/tests/QtWidgets/bug_921.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore, QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/bug_941.py b/sources/pyside2/tests/QtWidgets/bug_941.py
index 562be9a3b..074fde8e6 100644
--- a/sources/pyside2/tests/QtWidgets/bug_941.py
+++ b/sources/pyside2/tests/QtWidgets/bug_941.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_964.py b/sources/pyside2/tests/QtWidgets/bug_964.py
index 9c7af6c53..a160afd1b 100644
--- a/sources/pyside2/tests/QtWidgets/bug_964.py
+++ b/sources/pyside2/tests/QtWidgets/bug_964.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/bug_967.py b/sources/pyside2/tests/QtWidgets/bug_967.py
index 643041100..19d6b1e43 100644
--- a/sources/pyside2/tests/QtWidgets/bug_967.py
+++ b/sources/pyside2/tests/QtWidgets/bug_967.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import *
class TestBug967 (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_972.py b/sources/pyside2/tests/QtWidgets/bug_972.py
index a5299eebc..15bf949a8 100644
--- a/sources/pyside2/tests/QtWidgets/bug_972.py
+++ b/sources/pyside2/tests/QtWidgets/bug_972.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QSizeF
from PySide2.QtWidgets import QGraphicsProxyWidget, QSizePolicy, QPushButton, QGraphicsScene, QGraphicsView
diff --git a/sources/pyside2/tests/QtWidgets/bug_979.py b/sources/pyside2/tests/QtWidgets/bug_979.py
index 4bc0c966e..c5d65c361 100644
--- a/sources/pyside2/tests/QtWidgets/bug_979.py
+++ b/sources/pyside2/tests/QtWidgets/bug_979.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtWidgets import QDialog
from import_test import PysideImportTest2
diff --git a/sources/pyside2/tests/QtWidgets/bug_988.py b/sources/pyside2/tests/QtWidgets/bug_988.py
index e74edac82..93c2cc1aa 100644
--- a/sources/pyside2/tests/QtWidgets/bug_988.py
+++ b/sources/pyside2/tests/QtWidgets/bug_988.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import *
class TestBug988 (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/bug_998.py b/sources/pyside2/tests/QtWidgets/bug_998.py
index 8e0c96e5f..7c7587dd2 100644
--- a/sources/pyside2/tests/QtWidgets/bug_998.py
+++ b/sources/pyside2/tests/QtWidgets/bug_998.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import QApplication
class TestBug998 (unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/customproxywidget_test.py b/sources/pyside2/tests/QtWidgets/customproxywidget_test.py
index 051f31a71..7082fb12c 100644
--- a/sources/pyside2/tests/QtWidgets/customproxywidget_test.py
+++ b/sources/pyside2/tests/QtWidgets/customproxywidget_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import Qt, QTimer
diff --git a/sources/pyside2/tests/QtWidgets/event_filter_test.py b/sources/pyside2/tests/QtWidgets/event_filter_test.py
index a367c0349..fe18a3646 100644
--- a/sources/pyside2/tests/QtWidgets/event_filter_test.py
+++ b/sources/pyside2/tests/QtWidgets/event_filter_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QObject, QEvent
diff --git a/sources/pyside2/tests/QtWidgets/grandparent_method_test.py b/sources/pyside2/tests/QtWidgets/grandparent_method_test.py
index 6e64a047b..6b8fcbab5 100644
--- a/sources/pyside2/tests/QtWidgets/grandparent_method_test.py
+++ b/sources/pyside2/tests/QtWidgets/grandparent_method_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QPushButton, QWidget
diff --git a/sources/pyside2/tests/QtWidgets/hashabletype_test.py b/sources/pyside2/tests/QtWidgets/hashabletype_test.py
index 356afd8b9..0c3f045ce 100644
--- a/sources/pyside2/tests/QtWidgets/hashabletype_test.py
+++ b/sources/pyside2/tests/QtWidgets/hashabletype_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QTreeWidgetItem
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/keep_reference_test.py b/sources/pyside2/tests/QtWidgets/keep_reference_test.py
index c250da24b..c0139ed9f 100644
--- a/sources/pyside2/tests/QtWidgets/keep_reference_test.py
+++ b/sources/pyside2/tests/QtWidgets/keep_reference_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from sys import getrefcount
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/missing_symbols_test.py b/sources/pyside2/tests/QtWidgets/missing_symbols_test.py
index de243c4b2..064ed0b7c 100644
--- a/sources/pyside2/tests/QtWidgets/missing_symbols_test.py
+++ b/sources/pyside2/tests/QtWidgets/missing_symbols_test.py
@@ -28,7 +28,14 @@
'''(Very) Simple test case for missing names from QtGui and QtWidgets'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtGui
from PySide2 import QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/paint_event_test.py b/sources/pyside2/tests/QtWidgets/paint_event_test.py
index 1b715ce27..d57a523eb 100644
--- a/sources/pyside2/tests/QtWidgets/paint_event_test.py
+++ b/sources/pyside2/tests/QtWidgets/paint_event_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QTimerEvent
from PySide2.QtWidgets import QApplication, QWidget
diff --git a/sources/pyside2/tests/QtWidgets/parent_method_test.py b/sources/pyside2/tests/QtWidgets/parent_method_test.py
index 2f00a72d1..ef8e9ca8c 100644
--- a/sources/pyside2/tests/QtWidgets/parent_method_test.py
+++ b/sources/pyside2/tests/QtWidgets/parent_method_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QTimer, QThread
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/QtWidgets/private_mangle_test.py b/sources/pyside2/tests/QtWidgets/private_mangle_test.py
index 5ad10c7b3..75545537b 100644
--- a/sources/pyside2/tests/QtWidgets/private_mangle_test.py
+++ b/sources/pyside2/tests/QtWidgets/private_mangle_test.py
@@ -42,7 +42,14 @@ This is the example from https://bugreports.qt.io/browse/PYSIDE-772
with no interaction as a unittest.
"""
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import Signal
from PySide2.QtWidgets import QApplication, QWidget
from PySide2 import QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/python_properties_test.py b/sources/pyside2/tests/QtWidgets/python_properties_test.py
index f4e46f2bd..fb1679297 100644
--- a/sources/pyside2/tests/QtWidgets/python_properties_test.py
+++ b/sources/pyside2/tests/QtWidgets/python_properties_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore, QtWidgets
class Properties(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py b/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py
index c08c9e95b..8e291bb63 100644
--- a/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py
+++ b/sources/pyside2/tests/QtWidgets/qabstracttextdocumentlayout_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
diff --git a/sources/pyside2/tests/QtWidgets/qaction_test.py b/sources/pyside2/tests/QtWidgets/qaction_test.py
index 7ee74fffa..8fc8f6c05 100644
--- a/sources/pyside2/tests/QtWidgets/qaction_test.py
+++ b/sources/pyside2/tests/QtWidgets/qaction_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QAction, QWidget
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qapp_issue_585.py b/sources/pyside2/tests/QtWidgets/qapp_issue_585.py
index f124ee6a6..d7afdec3a 100644
--- a/sources/pyside2/tests/QtWidgets/qapp_issue_585.py
+++ b/sources/pyside2/tests/QtWidgets/qapp_issue_585.py
@@ -58,6 +58,14 @@ For some reason, the test does not work as a unittest because it creates
no crash. We leave it this way.
"""
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtCore import QTimer
from PySide2 import QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/qapp_test.py b/sources/pyside2/tests/QtWidgets/qapp_test.py
index 0bd919318..cda34be77 100644
--- a/sources/pyside2/tests/QtWidgets/qapp_test.py
+++ b/sources/pyside2/tests/QtWidgets/qapp_test.py
@@ -28,8 +28,14 @@
''' Test the presence of qApp Macro'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import *
class QAppPresence(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/qapplication_exit_segfault_test.py b/sources/pyside2/tests/QtWidgets/qapplication_exit_segfault_test.py
index f74ced668..f70086460 100644
--- a/sources/pyside2/tests/QtWidgets/qapplication_exit_segfault_test.py
+++ b/sources/pyside2/tests/QtWidgets/qapplication_exit_segfault_test.py
@@ -26,8 +26,13 @@
##
#############################################################################
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QApplication, QPushButton, QWidget, QSpinBox
diff --git a/sources/pyside2/tests/QtWidgets/qapplication_test.py b/sources/pyside2/tests/QtWidgets/qapplication_test.py
index b29aba6ac..0fc174e8f 100644
--- a/sources/pyside2/tests/QtWidgets/qapplication_test.py
+++ b/sources/pyside2/tests/QtWidgets/qapplication_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import QApplication
class TestQApplication(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/qbrush_test.py b/sources/pyside2/tests/QtWidgets/qbrush_test.py
index 78f32c7bc..97b1e824a 100644
--- a/sources/pyside2/tests/QtWidgets/qbrush_test.py
+++ b/sources/pyside2/tests/QtWidgets/qbrush_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Qt
from PySide2.QtGui import QColor, QBrush
diff --git a/sources/pyside2/tests/QtWidgets/qcolormap_test.py b/sources/pyside2/tests/QtWidgets/qcolormap_test.py
index 6166b32fb..1123b0d21 100644
--- a/sources/pyside2/tests/QtWidgets/qcolormap_test.py
+++ b/sources/pyside2/tests/QtWidgets/qcolormap_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QColormap
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qdynamic_signal.py b/sources/pyside2/tests/QtWidgets/qdynamic_signal.py
index 3b14ab3fb..4b9f76333 100644
--- a/sources/pyside2/tests/QtWidgets/qdynamic_signal.py
+++ b/sources/pyside2/tests/QtWidgets/qdynamic_signal.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject
from PySide2.QtWidgets import QInputDialog
diff --git a/sources/pyside2/tests/QtWidgets/qfontdialog_test.py b/sources/pyside2/tests/QtWidgets/qfontdialog_test.py
index 97fe9d797..b9706e4e7 100644
--- a/sources/pyside2/tests/QtWidgets/qfontdialog_test.py
+++ b/sources/pyside2/tests/QtWidgets/qfontdialog_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore
from PySide2 import QtGui
diff --git a/sources/pyside2/tests/QtWidgets/qformlayout_test.py b/sources/pyside2/tests/QtWidgets/qformlayout_test.py
index 0b38f675d..ff5a13aeb 100644
--- a/sources/pyside2/tests/QtWidgets/qformlayout_test.py
+++ b/sources/pyside2/tests/QtWidgets/qformlayout_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QFormLayout, QWidget
diff --git a/sources/pyside2/tests/QtWidgets/qgraphicsitem_isblocked_test.py b/sources/pyside2/tests/QtWidgets/qgraphicsitem_isblocked_test.py
index 524ca6fa8..e40dff6f6 100644
--- a/sources/pyside2/tests/QtWidgets/qgraphicsitem_isblocked_test.py
+++ b/sources/pyside2/tests/QtWidgets/qgraphicsitem_isblocked_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore
from PySide2 import QtGui
diff --git a/sources/pyside2/tests/QtWidgets/qgraphicsitem_test.py b/sources/pyside2/tests/QtWidgets/qgraphicsitem_test.py
index 8787b6178..27d543a7f 100644
--- a/sources/pyside2/tests/QtWidgets/qgraphicsitem_test.py
+++ b/sources/pyside2/tests/QtWidgets/qgraphicsitem_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QPolygonF, QColor, QBrush
from PySide2.QtWidgets import QGraphicsScene
diff --git a/sources/pyside2/tests/QtWidgets/qgraphicsobjectreimpl_test.py b/sources/pyside2/tests/QtWidgets/qgraphicsobjectreimpl_test.py
index 11825e42e..46569cc1e 100644
--- a/sources/pyside2/tests/QtWidgets/qgraphicsobjectreimpl_test.py
+++ b/sources/pyside2/tests/QtWidgets/qgraphicsobjectreimpl_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QGraphicsObject, QGraphicsWidget
from PySide2.QtCore import QRectF
diff --git a/sources/pyside2/tests/QtWidgets/qgraphicsproxywidget_test.py b/sources/pyside2/tests/QtWidgets/qgraphicsproxywidget_test.py
index 59796142d..54f95880e 100644
--- a/sources/pyside2/tests/QtWidgets/qgraphicsproxywidget_test.py
+++ b/sources/pyside2/tests/QtWidgets/qgraphicsproxywidget_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import Qt, QTimer
diff --git a/sources/pyside2/tests/QtWidgets/qgraphicsscene_test.py b/sources/pyside2/tests/QtWidgets/qgraphicsscene_test.py
index 8c521369d..cb1867b88 100644
--- a/sources/pyside2/tests/QtWidgets/qgraphicsscene_test.py
+++ b/sources/pyside2/tests/QtWidgets/qgraphicsscene_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QPointF
from PySide2.QtGui import QPolygonF, QPixmap, QPainterPath, QTransform, QWindow
diff --git a/sources/pyside2/tests/QtWidgets/qimage_test.py b/sources/pyside2/tests/QtWidgets/qimage_test.py
index 51f4fcd57..8bb83c51a 100644
--- a/sources/pyside2/tests/QtWidgets/qimage_test.py
+++ b/sources/pyside2/tests/QtWidgets/qimage_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py b/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py
index 69d1613b6..0aaf548c9 100644
--- a/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py
+++ b/sources/pyside2/tests/QtWidgets/qinputdialog_get_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore, QtWidgets
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py b/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py
index d85d20aa2..150eb3d31 100644
--- a/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py
+++ b/sources/pyside2/tests/QtWidgets/qkeysequenceedit_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QTimer
from PySide2.QtWidgets import QKeySequenceEdit
diff --git a/sources/pyside2/tests/QtWidgets/qlabel_test.py b/sources/pyside2/tests/QtWidgets/qlabel_test.py
index c8e8e2619..19387dee9 100644
--- a/sources/pyside2/tests/QtWidgets/qlabel_test.py
+++ b/sources/pyside2/tests/QtWidgets/qlabel_test.py
@@ -28,8 +28,14 @@
'''Test cases for QLabel'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QLabel
import shiboken2 as shiboken
diff --git a/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py b/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py
index 09b808794..9f0b4cca3 100644
--- a/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py
+++ b/sources/pyside2/tests/QtWidgets/qlayout_ref_test.py
@@ -33,7 +33,9 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QWidget
from PySide2.QtWidgets import QStackedLayout, QFormLayout
diff --git a/sources/pyside2/tests/QtWidgets/qlayout_test.py b/sources/pyside2/tests/QtWidgets/qlayout_test.py
index 8077e3bd3..3882761ea 100644
--- a/sources/pyside2/tests/QtWidgets/qlayout_test.py
+++ b/sources/pyside2/tests/QtWidgets/qlayout_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py b/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py
index 6da0a31b8..e079d6dd5 100644
--- a/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py
+++ b/sources/pyside2/tests/QtWidgets/qlcdnumber_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtWidgets import QApplication, QLCDNumber
class QLCDNumberOverflow(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtWidgets/qlistwidget_test.py b/sources/pyside2/tests/QtWidgets/qlistwidget_test.py
index 6fab3fb34..732f3859c 100644
--- a/sources/pyside2/tests/QtWidgets/qlistwidget_test.py
+++ b/sources/pyside2/tests/QtWidgets/qlistwidget_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtWidgets, QtCore
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py b/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py
index 2da159bce..b23852698 100644
--- a/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py
+++ b/sources/pyside2/tests/QtWidgets/qlistwidgetitem_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/qmainwindow_test.py b/sources/pyside2/tests/QtWidgets/qmainwindow_test.py
index 50c992f1a..c1cd106bd 100644
--- a/sources/pyside2/tests/QtWidgets/qmainwindow_test.py
+++ b/sources/pyside2/tests/QtWidgets/qmainwindow_test.py
@@ -31,7 +31,9 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtWidgets
from PySide2 import QtCore
diff --git a/sources/pyside2/tests/QtWidgets/qmenu_test.py b/sources/pyside2/tests/QtWidgets/qmenu_test.py
index c1d03393c..9c5b12b25 100644
--- a/sources/pyside2/tests/QtWidgets/qmenu_test.py
+++ b/sources/pyside2/tests/QtWidgets/qmenu_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QMenu
from PySide2.QtGui import QKeySequence, QIcon
diff --git a/sources/pyside2/tests/QtWidgets/qmenuadd_test.py b/sources/pyside2/tests/QtWidgets/qmenuadd_test.py
index c2881b206..f4ecbb398 100644
--- a/sources/pyside2/tests/QtWidgets/qmenuadd_test.py
+++ b/sources/pyside2/tests/QtWidgets/qmenuadd_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/qobject_mi_test.py b/sources/pyside2/tests/QtWidgets/qobject_mi_test.py
index 032229e4e..6934229cd 100644
--- a/sources/pyside2/tests/QtWidgets/qobject_mi_test.py
+++ b/sources/pyside2/tests/QtWidgets/qobject_mi_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject
from PySide2.QtGui import *
diff --git a/sources/pyside2/tests/QtWidgets/qpen_test.py b/sources/pyside2/tests/QtWidgets/qpen_test.py
index 9469cb10c..0acb8c27b 100644
--- a/sources/pyside2/tests/QtWidgets/qpen_test.py
+++ b/sources/pyside2/tests/QtWidgets/qpen_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qpicture_test.py b/sources/pyside2/tests/QtWidgets/qpicture_test.py
index 002be64e5..3a5747e4a 100644
--- a/sources/pyside2/tests/QtWidgets/qpicture_test.py
+++ b/sources/pyside2/tests/QtWidgets/qpicture_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import QTimer
diff --git a/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py b/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py
index 7e44e92b1..38f9b4adc 100644
--- a/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py
+++ b/sources/pyside2/tests/QtWidgets/qpixmap_constructor.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QLabel
diff --git a/sources/pyside2/tests/QtWidgets/qpushbutton_test.py b/sources/pyside2/tests/QtWidgets/qpushbutton_test.py
index 7fb17d922..896d4935c 100644
--- a/sources/pyside2/tests/QtWidgets/qpushbutton_test.py
+++ b/sources/pyside2/tests/QtWidgets/qpushbutton_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtWidgets import QPushButton, QMenu, QWidget
diff --git a/sources/pyside2/tests/QtWidgets/qshortcut_test.py b/sources/pyside2/tests/QtWidgets/qshortcut_test.py
index 7faaf6f92..18aec285d 100644
--- a/sources/pyside2/tests/QtWidgets/qshortcut_test.py
+++ b/sources/pyside2/tests/QtWidgets/qshortcut_test.py
@@ -30,8 +30,13 @@
''' Test the QShortcut constructor'''
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore, QtGui, QtWidgets
diff --git a/sources/pyside2/tests/QtWidgets/qsplitter_test.py b/sources/pyside2/tests/QtWidgets/qsplitter_test.py
index 2c792a63f..f375c820d 100644
--- a/sources/pyside2/tests/QtWidgets/qsplitter_test.py
+++ b/sources/pyside2/tests/QtWidgets/qsplitter_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QSplitter
diff --git a/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py b/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py
index 5b41af467..f1c360b82 100644
--- a/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py
+++ b/sources/pyside2/tests/QtWidgets/qstandarditemmodel_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QStandardItemModel, QStandardItem
from PySide2.QtWidgets import QWidget
diff --git a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
index 80eba412c..0321b69a4 100644
--- a/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
+++ b/sources/pyside2/tests/QtWidgets/qstring_qkeysequence_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qstyle_test.py b/sources/pyside2/tests/QtWidgets/qstyle_test.py
index 0452ca0fa..60130a14c 100644
--- a/sources/pyside2/tests/QtWidgets/qstyle_test.py
+++ b/sources/pyside2/tests/QtWidgets/qstyle_test.py
@@ -31,7 +31,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qtableview_test.py b/sources/pyside2/tests/QtWidgets/qtableview_test.py
index e97c5567c..040f8b91a 100644
--- a/sources/pyside2/tests/QtWidgets/qtableview_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtableview_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QAbstractTableModel
from PySide2.QtWidgets import QTableWidget
diff --git a/sources/pyside2/tests/QtWidgets/qtabwidget_test.py b/sources/pyside2/tests/QtWidgets/qtabwidget_test.py
index 5b2ebbdea..fc4f98c1d 100644
--- a/sources/pyside2/tests/QtWidgets/qtabwidget_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtabwidget_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import *
from helper.timedqapplication import TimedQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qtabwidgetclear_test.py b/sources/pyside2/tests/QtWidgets/qtabwidgetclear_test.py
index 75e0e4dab..c0c25d955 100644
--- a/sources/pyside2/tests/QtWidgets/qtabwidgetclear_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtabwidgetclear_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QMainWindow, QTabWidget, QTextEdit, QSplitter
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py b/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py
index aa10fb9d0..aef06448b 100644
--- a/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtextedit_signal_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore, QtWidgets
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qtextedit_test.py b/sources/pyside2/tests/QtWidgets/qtextedit_test.py
index d809ebfc6..d06cb4f83 100644
--- a/sources/pyside2/tests/QtWidgets/qtextedit_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtextedit_test.py
@@ -33,7 +33,9 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QTextEdit
diff --git a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
index 956c72ee3..856bf07f3 100644
--- a/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtoolbar_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QToolBar, QMainWindow, QAction
diff --git a/sources/pyside2/tests/QtWidgets/qtoolbox_test.py b/sources/pyside2/tests/QtWidgets/qtoolbox_test.py
index e9cf086a6..9fdd53958 100644
--- a/sources/pyside2/tests/QtWidgets/qtoolbox_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtoolbox_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QIcon
from PySide2.QtWidgets import QToolBox, QWidget
diff --git a/sources/pyside2/tests/QtWidgets/qtreeview_test.py b/sources/pyside2/tests/QtWidgets/qtreeview_test.py
index 6673d36b9..8824088d4 100644
--- a/sources/pyside2/tests/QtWidgets/qtreeview_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtreeview_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QStandardItemModel
from PySide2.QtWidgets import (QWidget, QTreeView, QVBoxLayout,
diff --git a/sources/pyside2/tests/QtWidgets/qtreewidget_test.py b/sources/pyside2/tests/QtWidgets/qtreewidget_test.py
index ec3724f6c..6700f82c9 100644
--- a/sources/pyside2/tests/QtWidgets/qtreewidget_test.py
+++ b/sources/pyside2/tests/QtWidgets/qtreewidget_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QTreeWidget, QTreeWidgetItem, QPushButton
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qvariant_test.py b/sources/pyside2/tests/QtWidgets/qvariant_test.py
index 8a9bf152f..d4da7d4b2 100644
--- a/sources/pyside2/tests/QtWidgets/qvariant_test.py
+++ b/sources/pyside2/tests/QtWidgets/qvariant_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import (QApplication, QComboBox, QGraphicsScene,
QGraphicsRectItem)
diff --git a/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py b/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py
index f06ebb74f..4ac9e4e04 100644
--- a/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py
+++ b/sources/pyside2/tests/QtWidgets/qwidget_setlayout_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QWidget, QVBoxLayout, QPushButton, QApplication, QHBoxLayout
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/qwidget_test.py b/sources/pyside2/tests/QtWidgets/qwidget_test.py
index ed6a0226e..74e97d7be 100644
--- a/sources/pyside2/tests/QtWidgets/qwidget_test.py
+++ b/sources/pyside2/tests/QtWidgets/qwidget_test.py
@@ -31,7 +31,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QWidget, QMainWindow
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/QtWidgets/reference_count_test.py b/sources/pyside2/tests/QtWidgets/reference_count_test.py
index 7b5412353..a6ba302f9 100644
--- a/sources/pyside2/tests/QtWidgets/reference_count_test.py
+++ b/sources/pyside2/tests/QtWidgets/reference_count_test.py
@@ -34,7 +34,9 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import Qt, QPointF
from PySide2.QtGui import QPolygonF
diff --git a/sources/pyside2/tests/QtWidgets/signature_test.py b/sources/pyside2/tests/QtWidgets/signature_test.py
index 3a0114b07..57fcf3874 100644
--- a/sources/pyside2/tests/QtWidgets/signature_test.py
+++ b/sources/pyside2/tests/QtWidgets/signature_test.py
@@ -39,7 +39,14 @@
from __future__ import print_function, absolute_import
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2.QtCore
import PySide2.QtWidgets
from shibokensupport.signature import inspect
diff --git a/sources/pyside2/tests/QtWidgets/standardpixmap_test.py b/sources/pyside2/tests/QtWidgets/standardpixmap_test.py
index c907c8209..12a5bea8e 100644
--- a/sources/pyside2/tests/QtWidgets/standardpixmap_test.py
+++ b/sources/pyside2/tests/QtWidgets/standardpixmap_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtGui import QPixmap
from PySide2.QtWidgets import QStyle
diff --git a/sources/pyside2/tests/QtWidgets/test_module_template.py b/sources/pyside2/tests/QtWidgets/test_module_template.py
index cc61fcf69..175004800 100644
--- a/sources/pyside2/tests/QtWidgets/test_module_template.py
+++ b/sources/pyside2/tests/QtWidgets/test_module_template.py
@@ -26,6 +26,14 @@
##
#############################################################################
+import os
+import sys
+
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths()
+
from PySide2.QtWidgets import QWidget
from PySide2.QtCore import QObject
diff --git a/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py b/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py
index 56580fc1e..4e6651cec 100644
--- a/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py
+++ b/sources/pyside2/tests/QtWidgets/virtual_protected_inheritance_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QTimerEvent
from PySide2.QtWidgets import QApplication, QSpinBox
diff --git a/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py b/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py
index 4ee56152e..78ad04043 100644
--- a/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py
+++ b/sources/pyside2/tests/QtWidgets/virtual_pure_override_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtWidgets import QGraphicsScene, QGraphicsRectItem, QGraphicsView, QApplication
from PySide2.QtGui import QBrush, QColor
diff --git a/sources/pyside2/tests/QtWidgets/wrong_return_test.py b/sources/pyside2/tests/QtWidgets/wrong_return_test.py
index 8fad3d627..d95ae7639 100644
--- a/sources/pyside2/tests/QtWidgets/wrong_return_test.py
+++ b/sources/pyside2/tests/QtWidgets/wrong_return_test.py
@@ -33,7 +33,9 @@ import sys
import unittest
import warnings
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
import py3kcompat as py3k
from PySide2 import QtWidgets
diff --git a/sources/pyside2/tests/QtXml/qdomdocument_test.py b/sources/pyside2/tests/QtXml/qdomdocument_test.py
index 3ff296503..67da9952c 100644
--- a/sources/pyside2/tests/QtXml/qdomdocument_test.py
+++ b/sources/pyside2/tests/QtXml/qdomdocument_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QByteArray
from PySide2.QtXml import QDomDocument, QDomElement
diff --git a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py b/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py
index 770495385..a30d68cde 100644
--- a/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py
+++ b/sources/pyside2/tests/QtXml/qxmlsimplereader_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtXml import QXmlSimpleReader
class QXmlSimpleReaderTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/QtXmlPatterns/import_test.py b/sources/pyside2/tests/QtXmlPatterns/import_test.py
index 0c6f74184..09032909f 100644
--- a/sources/pyside2/tests/QtXmlPatterns/import_test.py
+++ b/sources/pyside2/tests/QtXmlPatterns/import_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from PySide2.QtXmlPatterns import QXmlSchema
diff --git a/sources/pyside2/tests/init_paths.py b/sources/pyside2/tests/init_paths.py
new file mode 100644
index 000000000..9cfdebc86
--- /dev/null
+++ b/sources/pyside2/tests/init_paths.py
@@ -0,0 +1,104 @@
+#############################################################################
+##
+## Copyright (C) 2020 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the test suite of Qt for Python.
+##
+## $QT_BEGIN_LICENSE:GPL-EXCEPT$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 as published by the Free Software
+## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+#############################################################################
+
+from __future__ import print_function
+
+import os
+import sys
+
+SRC_DIR = os.path.dirname(os.path.abspath(__file__))
+sys.path.append(os.path.join(os.path.dirname(os.path.dirname(SRC_DIR)),
+ 'shiboken2', 'tests'))
+from shiboken_paths import (get_dir_env_var, get_build_dir, add_python_dirs,
+ add_lib_dirs, shiboken_paths)
+
+
+def _get_qt_dir():
+ """Retrieve the location of Qt."""
+ result = None
+ try:
+ result = get_dir_env_var('QT_DIR')
+ except Exception:
+ # This is just a convenience for command line invocation independent
+ # of ctest. Normally, QT_DIR should be set to avoid repetitive patch
+ # searches.
+ print('The environment variable QT_DIR is not set; falling back to path search',
+ file=sys.stderr)
+ qmake = 'qmake.exe' if sys.platform == 'win32' else 'qmake'
+ for path in os.environ.get('PATH').split(os.pathsep):
+ if path and os.path.isfile(os.path.join(path, qmake)):
+ result = os.path.dirname(path)
+ break
+ if not result:
+ raise ValueError('Unable to locate Qt. Please set the environment variable QT_DIR')
+ print('Qt as determined by path search: {}'.format(result), file=sys.stderr)
+ return result
+
+
+def _get_qt_lib_dir():
+ """Retrieve the location of the Qt library directory."""
+ sub_dir = 'bin' if sys.platform == 'win32' else 'lib'
+ return os.path.join(_get_qt_dir(), sub_dir) # For testbinding
+
+
+def _init_test_paths(shiboken_tests=False, testbindings_module=False):
+ """Sets the correct import paths (Python modules and C++ library paths)
+ for PySide tests and shiboken2 tests using depending on the environment
+ variables BUILD_DIR and QT_DIR pointing to the build directory and
+ Qt directory, respectively."""
+ src_dir = os.path.dirname(os.path.abspath(__file__))
+
+ python_dirs = [os.path.join(src_dir, 'util')] # Helper module
+
+ pyside_build_dir = os.path.join(get_build_dir(), 'pyside2')
+ python_dirs.append(pyside_build_dir) # for PySide2
+ lib_dirs = [os.path.join(pyside_build_dir, 'libpyside')]
+
+ if testbindings_module:
+ python_dirs.append(os.path.join(pyside_build_dir,
+ 'tests', 'pysidetest'))
+ lib_dirs.append(_get_qt_lib_dir())
+
+ shiboken_path_tuple = shiboken_paths(shiboken_tests)
+ python_dirs.extend(shiboken_path_tuple[0])
+ lib_dirs.extend(shiboken_path_tuple[1])
+
+ add_python_dirs(python_dirs)
+ add_lib_dirs(lib_dirs)
+
+
+def init_test_paths(testbindings_module=False):
+ """Sets the correct import paths for PySide2 tests, optionally including
+ testbindings."""
+ _init_test_paths(False, testbindings_module)
+
+
+def init_all_test_paths():
+ """Sets the correct import paths for PySide2 and shiboken2 tests
+ (for registry checking only)."""
+ _init_test_paths(True, True)
diff --git a/sources/pyside2/tests/mac/qmacstyle_test.py b/sources/pyside2/tests/mac/qmacstyle_test.py
index 4a65a144d..091f9591b 100644
--- a/sources/pyside2/tests/mac/qmacstyle_test.py
+++ b/sources/pyside2/tests/mac/qmacstyle_test.py
@@ -27,14 +27,17 @@
#############################################################################
# Qt5: this is gone: from PySide2.QtGui import QMacStyle
-from PySide2.QtWidgets import QApplication, QLabel, QStyleFactory
-from PySide2.QtCore import QObject
import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2.QtWidgets import QApplication, QLabel, QStyleFactory
+from PySide2.QtCore import QObject
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/pysidetest/all_modules_load_test.py b/sources/pyside2/tests/pysidetest/all_modules_load_test.py
index e802685fb..10ccc5221 100644
--- a/sources/pyside2/tests/pysidetest/all_modules_load_test.py
+++ b/sources/pyside2/tests/pysidetest/all_modules_load_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
# Note:
diff --git a/sources/pyside2/tests/pysidetest/bug_1016.py b/sources/pyside2/tests/pysidetest/bug_1016.py
index c2b709333..9f035e0e1 100644
--- a/sources/pyside2/tests/pysidetest/bug_1016.py
+++ b/sources/pyside2/tests/pysidetest/bug_1016.py
@@ -26,9 +26,17 @@
##
#############################################################################
-from testbinding import *
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
+import shiboken2
+from testbinding import *
+
class TestBug1016 (unittest.TestCase):
def testIt(self):
diff --git a/sources/pyside2/tests/pysidetest/constructor_properties_test.py b/sources/pyside2/tests/pysidetest/constructor_properties_test.py
index e84a4546e..139091fed 100644
--- a/sources/pyside2/tests/pysidetest/constructor_properties_test.py
+++ b/sources/pyside2/tests/pysidetest/constructor_properties_test.py
@@ -41,7 +41,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from helper.usesqapplication import UsesQApplication
from PySide2.QtCore import Qt
diff --git a/sources/pyside2/tests/pysidetest/decoratedslot_test.py b/sources/pyside2/tests/pysidetest/decoratedslot_test.py
index 47878ed8c..3825f48ab 100644
--- a/sources/pyside2/tests/pysidetest/decoratedslot_test.py
+++ b/sources/pyside2/tests/pysidetest/decoratedslot_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from PySide2.QtCore import QObject
from testbinding import TestObject
diff --git a/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py b/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py
index 82967a177..1378ca8ad 100644
--- a/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py
+++ b/sources/pyside2/tests/pysidetest/delegatecreateseditor_test.py
@@ -28,9 +28,15 @@
##
#############################################################################
+import os
+import sys
import unittest
-from helper.usesqapplication import UsesQApplication
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
+from helper.usesqapplication import UsesQApplication
from testbinding import TestView
from PySide2.QtCore import Qt
from PySide2.QtWidgets import QAbstractItemDelegate, QComboBox
diff --git a/sources/pyside2/tests/pysidetest/embedding_test.py b/sources/pyside2/tests/pysidetest/embedding_test.py
index aa71360ca..1960838ff 100644
--- a/sources/pyside2/tests/pysidetest/embedding_test.py
+++ b/sources/pyside2/tests/pysidetest/embedding_test.py
@@ -37,8 +37,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
# This test tests the embedding feature of PySide.
# Normally, embedding is only used when necessary.
# By setting the variable "pyside_uses_embedding",
diff --git a/sources/pyside2/tests/pysidetest/enum_test.py b/sources/pyside2/tests/pysidetest/enum_test.py
index 428e087f0..d179d6248 100644
--- a/sources/pyside2/tests/pysidetest/enum_test.py
+++ b/sources/pyside2/tests/pysidetest/enum_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import Enum1, TestObjectWithoutNamespace
class ListConnectionTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py b/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py
index 906d0ddb7..1566b4a82 100644
--- a/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py
+++ b/sources/pyside2/tests/pysidetest/homonymoussignalandmethod_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import TestObject
'''Tests the behaviour of homonymous signals and slots.'''
diff --git a/sources/pyside2/tests/pysidetest/iterable_test.py b/sources/pyside2/tests/pysidetest/iterable_test.py
index 2f488875e..c5685112d 100644
--- a/sources/pyside2/tests/pysidetest/iterable_test.py
+++ b/sources/pyside2/tests/pysidetest/iterable_test.py
@@ -35,6 +35,11 @@ This test checks that the Iterable protocol is implemented correctly.
import os
import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
from PySide2 import QtCore, QtGui
diff --git a/sources/pyside2/tests/pysidetest/list_signal_test.py b/sources/pyside2/tests/pysidetest/list_signal_test.py
index a438f0c89..d66ba7905 100644
--- a/sources/pyside2/tests/pysidetest/list_signal_test.py
+++ b/sources/pyside2/tests/pysidetest/list_signal_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import TestObject
from PySide2.QtCore import QObject
diff --git a/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py b/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py
index 44bb33be6..d0b40cfa0 100644
--- a/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py
+++ b/sources/pyside2/tests/pysidetest/mixin_signal_slots_test.py
@@ -33,7 +33,14 @@
are registered at type parsing time. Also test that the signal and slot
indices do not change after signal connection or emission. '''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
class Mixin(object):
diff --git a/sources/pyside2/tests/pysidetest/modelview_test.py b/sources/pyside2/tests/pysidetest/modelview_test.py
index a0f723c4a..a4ae9dd40 100644
--- a/sources/pyside2/tests/pysidetest/modelview_test.py
+++ b/sources/pyside2/tests/pysidetest/modelview_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
import py3kcompat as py3k
from testbinding import TestView
from PySide2.QtCore import QAbstractListModel, QObject, QModelIndex
diff --git a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
index 09e5f2610..81a764986 100644
--- a/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
+++ b/sources/pyside2/tests/pysidetest/new_inherited_functions_test.py
@@ -28,10 +28,14 @@
from __future__ import print_function
-import sys
import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import *
for modname, mod in sys.modules.items():
# Python 2 leaves "None" in the dict.
diff --git a/sources/pyside2/tests/pysidetest/notify_id.py b/sources/pyside2/tests/pysidetest/notify_id.py
index d96e8d91f..393736a65 100644
--- a/sources/pyside2/tests/pysidetest/notify_id.py
+++ b/sources/pyside2/tests/pysidetest/notify_id.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Signal, Property, Slot
'''Tests that the signal notify id of a property is correct, aka corresponds to the initially set
diff --git a/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py b/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py
index 2cc18c9c9..bfcf40111 100644
--- a/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py
+++ b/sources/pyside2/tests/pysidetest/qapp_like_a_macro_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import PySide2
# This test tests the new "macro" feature of qApp.
diff --git a/sources/pyside2/tests/pysidetest/qvariant_test.py b/sources/pyside2/tests/pysidetest/qvariant_test.py
index 8f8b8b968..0efece889 100644
--- a/sources/pyside2/tests/pysidetest/qvariant_test.py
+++ b/sources/pyside2/tests/pysidetest/qvariant_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import TestObject
from PySide2.QtCore import Qt
from PySide2.QtGui import QKeySequence
diff --git a/sources/pyside2/tests/pysidetest/repr_test.py b/sources/pyside2/tests/pysidetest/repr_test.py
index 295084f17..356d11911 100644
--- a/sources/pyside2/tests/pysidetest/repr_test.py
+++ b/sources/pyside2/tests/pysidetest/repr_test.py
@@ -40,7 +40,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import PySideCPP, TestObject
class QObjectDerivedReprTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/pysidetest/signal_slot_warning.py b/sources/pyside2/tests/pysidetest/signal_slot_warning.py
index 84ddc23de..a54974c3b 100644
--- a/sources/pyside2/tests/pysidetest/signal_slot_warning.py
+++ b/sources/pyside2/tests/pysidetest/signal_slot_warning.py
@@ -33,11 +33,17 @@
from __future__ import print_function
-import unittest
-import PySide2.QtCore as QtCore
+import os
import sys
+import unittest
import warnings
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+import PySide2.QtCore as QtCore
+
class Whatever(QtCore.QObject):
echoSignal = QtCore.Signal(str)
diff --git a/sources/pyside2/tests/pysidetest/signalandnamespace_test.py b/sources/pyside2/tests/pysidetest/signalandnamespace_test.py
index 9bb42ea40..f56beaf84 100644
--- a/sources/pyside2/tests/pysidetest/signalandnamespace_test.py
+++ b/sources/pyside2/tests/pysidetest/signalandnamespace_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import PySideCPP, TestObjectWithoutNamespace
class ModelViewTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py b/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py
index 43b31f5c0..ed7302c69 100644
--- a/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py
+++ b/sources/pyside2/tests/pysidetest/signalemissionfrompython_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import TestObject
from PySide2.QtCore import QObject, SIGNAL
diff --git a/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py b/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py
index 11951fb09..fc13fc0d9 100644
--- a/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py
+++ b/sources/pyside2/tests/pysidetest/signalwithdefaultvalue_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from testbinding import TestObject
from PySide2.QtCore import QObject, SIGNAL
diff --git a/sources/pyside2/tests/pysidetest/typedef_signal_test.py b/sources/pyside2/tests/pysidetest/typedef_signal_test.py
index f7724b618..ecbfa35d4 100644
--- a/sources/pyside2/tests/pysidetest/typedef_signal_test.py
+++ b/sources/pyside2/tests/pysidetest/typedef_signal_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from PySide2.QtCore import QObject
from testbinding import TestObject
diff --git a/sources/pyside2/tests/pysidetest/version_test.py b/sources/pyside2/tests/pysidetest/version_test.py
index 447fafdeb..5cc34d8c3 100644
--- a/sources/pyside2/tests/pysidetest/version_test.py
+++ b/sources/pyside2/tests/pysidetest/version_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import __version_info__, __version__, QtCore
class CheckForVariablesTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/registry/existence_test.py b/sources/pyside2/tests/registry/existence_test.py
index 6db88a818..4bfd63cc3 100644
--- a/sources/pyside2/tests/registry/existence_test.py
+++ b/sources/pyside2/tests/registry/existence_test.py
@@ -68,8 +68,13 @@ List entry
import os
import sys
-import unittest
from textwrap import dedent
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_all_test_paths
+init_all_test_paths()
+
from init_platform import enum_all, generate_all
from util import (isolate_warnings, check_warnings, suppress_warnings, warn,
is_ci, qt_version, get_script_dir, get_effective_refpath,
diff --git a/sources/pyside2/tests/signals/args_dont_match_test.py b/sources/pyside2/tests/signals/args_dont_match_test.py
index f50611ad6..732706ac0 100644
--- a/sources/pyside2/tests/signals/args_dont_match_test.py
+++ b/sources/pyside2/tests/signals/args_dont_match_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
class ArgsDontMatch(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/bug_189.py b/sources/pyside2/tests/signals/bug_189.py
index a23658422..6492f0359 100644
--- a/sources/pyside2/tests/signals/bug_189.py
+++ b/sources/pyside2/tests/signals/bug_189.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore, QtWidgets
from helper.usesqapplication import UsesQApplication
diff --git a/sources/pyside2/tests/signals/bug_311.py b/sources/pyside2/tests/signals/bug_311.py
index 36e022a55..c9782741d 100644
--- a/sources/pyside2/tests/signals/bug_311.py
+++ b/sources/pyside2/tests/signals/bug_311.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/bug_312.py b/sources/pyside2/tests/signals/bug_312.py
index 08019654c..1b6eabe7e 100644
--- a/sources/pyside2/tests/signals/bug_312.py
+++ b/sources/pyside2/tests/signals/bug_312.py
@@ -29,8 +29,14 @@
##
#############################################################################
-import unittest
+import os
import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL
MAX_LOOPS = 5
diff --git a/sources/pyside2/tests/signals/bug_319.py b/sources/pyside2/tests/signals/bug_319.py
index f42add3cf..17cd8abcf 100644
--- a/sources/pyside2/tests/signals/bug_319.py
+++ b/sources/pyside2/tests/signals/bug_319.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtCore
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/bug_79.py b/sources/pyside2/tests/signals/bug_79.py
index 4a595912c..ca25fb3f4 100644
--- a/sources/pyside2/tests/signals/bug_79.py
+++ b/sources/pyside2/tests/signals/bug_79.py
@@ -27,9 +27,14 @@
#############################################################################
from __future__ import print_function
-import unittest
-import sys
+import os
import gc
+import sys
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2 import QtGui, QtWidgets
diff --git a/sources/pyside2/tests/signals/decorators_test.py b/sources/pyside2/tests/signals/decorators_test.py
index e5a8be461..e262f0bce 100644
--- a/sources/pyside2/tests/signals/decorators_test.py
+++ b/sources/pyside2/tests/signals/decorators_test.py
@@ -28,8 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Slot, SIGNAL, SLOT
class MyObject(QObject):
diff --git a/sources/pyside2/tests/signals/disconnect_test.py b/sources/pyside2/tests/signals/disconnect_test.py
index 79c33ed7a..6242e9e38 100644
--- a/sources/pyside2/tests/signals/disconnect_test.py
+++ b/sources/pyside2/tests/signals/disconnect_test.py
@@ -26,10 +26,14 @@
##
#############################################################################
-import os, sys
-sys.path.insert(0, os.path.join("..", "pysidetest"))
-
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(True)
+
from PySide2.QtCore import *
from testbinding import TestObject
diff --git a/sources/pyside2/tests/signals/invalid_callback_test.py b/sources/pyside2/tests/signals/invalid_callback_test.py
index b3b301d67..442720baa 100644
--- a/sources/pyside2/tests/signals/invalid_callback_test.py
+++ b/sources/pyside2/tests/signals/invalid_callback_test.py
@@ -28,8 +28,14 @@
'''Test cases for passing invalid callbacks to QObject.connect'''
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL
class InvalidCallback(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/lambda_gui_test.py b/sources/pyside2/tests/signals/lambda_gui_test.py
index 4f33addab..843b4037f 100644
--- a/sources/pyside2/tests/signals/lambda_gui_test.py
+++ b/sources/pyside2/tests/signals/lambda_gui_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL
diff --git a/sources/pyside2/tests/signals/lambda_test.py b/sources/pyside2/tests/signals/lambda_test.py
index 2a3f0139a..f01096150 100644
--- a/sources/pyside2/tests/signals/lambda_test.py
+++ b/sources/pyside2/tests/signals/lambda_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, QProcess
diff --git a/sources/pyside2/tests/signals/leaking_signal_test.py b/sources/pyside2/tests/signals/leaking_signal_test.py
index f8ac041ba..705d16075 100644
--- a/sources/pyside2/tests/signals/leaking_signal_test.py
+++ b/sources/pyside2/tests/signals/leaking_signal_test.py
@@ -26,10 +26,18 @@
##
#############################################################################
+import os
+import sys
import unittest
-from PySide2 import QtCore
import weakref
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
+from PySide2 import QtCore
+
+
class LeakingSignal(unittest.TestCase):
def testLeakingSignal(self):
diff --git a/sources/pyside2/tests/signals/multiple_connections_gui_test.py b/sources/pyside2/tests/signals/multiple_connections_gui_test.py
index d4104b5ce..4429c49f4 100644
--- a/sources/pyside2/tests/signals/multiple_connections_gui_test.py
+++ b/sources/pyside2/tests/signals/multiple_connections_gui_test.py
@@ -32,7 +32,9 @@ import random
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
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 8172596b1..a8f5bcd9d 100644
--- a/sources/pyside2/tests/signals/multiple_connections_test.py
+++ b/sources/pyside2/tests/signals/multiple_connections_test.py
@@ -31,7 +31,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
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 bdb62b5bf..5561671c4 100644
--- a/sources/pyside2/tests/signals/pysignal_test.py
+++ b/sources/pyside2/tests/signals/pysignal_test.py
@@ -30,7 +30,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, SLOT, Qt
diff --git a/sources/pyside2/tests/signals/qobject_destroyed_test.py b/sources/pyside2/tests/signals/qobject_destroyed_test.py
index 87e78c22c..35752a6ca 100644
--- a/sources/pyside2/tests/signals/qobject_destroyed_test.py
+++ b/sources/pyside2/tests/signals/qobject_destroyed_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL
class QObjectDestroyed(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/qobject_receivers_test.py b/sources/pyside2/tests/signals/qobject_receivers_test.py
index 629fda5cf..8ad89fe78 100644
--- a/sources/pyside2/tests/signals/qobject_receivers_test.py
+++ b/sources/pyside2/tests/signals/qobject_receivers_test.py
@@ -30,7 +30,14 @@
''' Test case for QObject.receivers()'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
def cute_slot():
diff --git a/sources/pyside2/tests/signals/qobject_sender_test.py b/sources/pyside2/tests/signals/qobject_sender_test.py
index 108054518..ce11b803a 100644
--- a/sources/pyside2/tests/signals/qobject_sender_test.py
+++ b/sources/pyside2/tests/signals/qobject_sender_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/ref01_test.py b/sources/pyside2/tests/signals/ref01_test.py
index e12dfc910..d2c658568 100644
--- a/sources/pyside2/tests/signals/ref01_test.py
+++ b/sources/pyside2/tests/signals/ref01_test.py
@@ -29,7 +29,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Signal
class BoundAndUnboundSignalsTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/ref02_test.py b/sources/pyside2/tests/signals/ref02_test.py
index e7659246d..9a31b4b52 100644
--- a/sources/pyside2/tests/signals/ref02_test.py
+++ b/sources/pyside2/tests/signals/ref02_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QCoreApplication, QTimeLine
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/ref03_test.py b/sources/pyside2/tests/signals/ref03_test.py
index da24da659..25f404f38 100644
--- a/sources/pyside2/tests/signals/ref03_test.py
+++ b/sources/pyside2/tests/signals/ref03_test.py
@@ -29,8 +29,15 @@
##
#############################################################################
-import unittest
+import os
+import sys
from sys import getrefcount
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject
class DisconnectSignalsTest(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/ref04_test.py b/sources/pyside2/tests/signals/ref04_test.py
index 033449cc7..4c66c04ef 100644
--- a/sources/pyside2/tests/signals/ref04_test.py
+++ b/sources/pyside2/tests/signals/ref04_test.py
@@ -29,7 +29,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, Signal
class ExtQObject(QObject):
diff --git a/sources/pyside2/tests/signals/ref05_test.py b/sources/pyside2/tests/signals/ref05_test.py
index 848bf89d6..3b7bf1983 100644
--- a/sources/pyside2/tests/signals/ref05_test.py
+++ b/sources/pyside2/tests/signals/ref05_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QCoreApplication, QTimeLine, Slot
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/ref06_test.py b/sources/pyside2/tests/signals/ref06_test.py
index adba267b4..51d78e638 100644
--- a/sources/pyside2/tests/signals/ref06_test.py
+++ b/sources/pyside2/tests/signals/ref06_test.py
@@ -33,7 +33,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, QCoreApplication, QTimeLine, Signal, Slot
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/segfault_proxyparent_test.py b/sources/pyside2/tests/signals/segfault_proxyparent_test.py
index 758c7888f..2d45f1e7f 100644
--- a/sources/pyside2/tests/signals/segfault_proxyparent_test.py
+++ b/sources/pyside2/tests/signals/segfault_proxyparent_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL
# Description of the problem
diff --git a/sources/pyside2/tests/signals/self_connect_test.py b/sources/pyside2/tests/signals/self_connect_test.py
index 61280474a..cca97b096 100644
--- a/sources/pyside2/tests/signals/self_connect_test.py
+++ b/sources/pyside2/tests/signals/self_connect_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, SLOT
from PySide2.QtWidgets import QPushButton, QWidget
diff --git a/sources/pyside2/tests/signals/short_circuit_test.py b/sources/pyside2/tests/signals/short_circuit_test.py
index e181b6497..61acc77c0 100644
--- a/sources/pyside2/tests/signals/short_circuit_test.py
+++ b/sources/pyside2/tests/signals/short_circuit_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL, SLOT
class Dummy(QObject):
diff --git a/sources/pyside2/tests/signals/signal2signal_connect_test.py b/sources/pyside2/tests/signals/signal2signal_connect_test.py
index 4619a8694..c5008c942 100644
--- a/sources/pyside2/tests/signals/signal2signal_connect_test.py
+++ b/sources/pyside2/tests/signals/signal2signal_connect_test.py
@@ -30,7 +30,14 @@
''' Test case for signal to signal connections.'''
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
def cute_slot():
diff --git a/sources/pyside2/tests/signals/signal_autoconnect_test.py b/sources/pyside2/tests/signals/signal_autoconnect_test.py
index 9fe8f94d3..b19f28ab7 100644
--- a/sources/pyside2/tests/signals/signal_autoconnect_test.py
+++ b/sources/pyside2/tests/signals/signal_autoconnect_test.py
@@ -28,8 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
from PySide2.QtWidgets import *
diff --git a/sources/pyside2/tests/signals/signal_connectiontype_support_test.py b/sources/pyside2/tests/signals/signal_connectiontype_support_test.py
index d8dee9454..00865a95e 100644
--- a/sources/pyside2/tests/signals/signal_connectiontype_support_test.py
+++ b/sources/pyside2/tests/signals/signal_connectiontype_support_test.py
@@ -26,8 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL, Qt
class Dummy(QObject):
diff --git a/sources/pyside2/tests/signals/signal_emission_gui_test.py b/sources/pyside2/tests/signals/signal_emission_gui_test.py
index 4b36336fb..d46e78c5e 100644
--- a/sources/pyside2/tests/signals/signal_emission_gui_test.py
+++ b/sources/pyside2/tests/signals/signal_emission_gui_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, SLOT
diff --git a/sources/pyside2/tests/signals/signal_emission_test.py b/sources/pyside2/tests/signals/signal_emission_test.py
index e45902abd..f9c221e8f 100644
--- a/sources/pyside2/tests/signals/signal_emission_test.py
+++ b/sources/pyside2/tests/signals/signal_emission_test.py
@@ -35,7 +35,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, SLOT, QProcess, QTimeLine
diff --git a/sources/pyside2/tests/signals/signal_func_test.py b/sources/pyside2/tests/signals/signal_func_test.py
index 37bb191fe..0026bc726 100644
--- a/sources/pyside2/tests/signals/signal_func_test.py
+++ b/sources/pyside2/tests/signals/signal_func_test.py
@@ -28,8 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import SIGNAL, SLOT
class SIGNALSLOTTests(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/signal_manager_refcount_test.py b/sources/pyside2/tests/signals/signal_manager_refcount_test.py
index ece9a3ce0..6942f983d 100644
--- a/sources/pyside2/tests/signals/signal_manager_refcount_test.py
+++ b/sources/pyside2/tests/signals/signal_manager_refcount_test.py
@@ -28,8 +28,16 @@
##
#############################################################################
+
+import os
+import sys
from sys import getrefcount
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import QObject, SIGNAL
class SignalManagerRefCount(unittest.TestCase):
diff --git a/sources/pyside2/tests/signals/signal_number_limit_test.py b/sources/pyside2/tests/signals/signal_number_limit_test.py
index ba1edac25..67bb63e44 100644
--- a/sources/pyside2/tests/signals/signal_number_limit_test.py
+++ b/sources/pyside2/tests/signals/signal_number_limit_test.py
@@ -29,7 +29,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2 import QtCore
class Emitter(QtCore.QObject):
diff --git a/sources/pyside2/tests/signals/signal_object_test.py b/sources/pyside2/tests/signals/signal_object_test.py
index 76b859a4f..bf4abedbc 100644
--- a/sources/pyside2/tests/signals/signal_object_test.py
+++ b/sources/pyside2/tests/signals/signal_object_test.py
@@ -32,7 +32,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QTimer, Signal, QObject, Slot, Qt
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/signal_signature_test.py b/sources/pyside2/tests/signals/signal_signature_test.py
index da19862fe..1f661de0a 100644
--- a/sources/pyside2/tests/signals/signal_signature_test.py
+++ b/sources/pyside2/tests/signals/signal_signature_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import *
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/signals/signal_with_primitive_type_test.py b/sources/pyside2/tests/signals/signal_with_primitive_type_test.py
index cc3f084d0..f7f691f34 100644
--- a/sources/pyside2/tests/signals/signal_with_primitive_type_test.py
+++ b/sources/pyside2/tests/signals/signal_with_primitive_type_test.py
@@ -28,7 +28,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
from PySide2.QtCore import *
diff --git a/sources/pyside2/tests/signals/slot_reference_count_test.py b/sources/pyside2/tests/signals/slot_reference_count_test.py
index e6bcda0e8..7885a358b 100644
--- a/sources/pyside2/tests/signals/slot_reference_count_test.py
+++ b/sources/pyside2/tests/signals/slot_reference_count_test.py
@@ -28,8 +28,14 @@
''' Forced disconnection: Delete one end of the signal connection'''
-import unittest
+import os
+import sys
from sys import getrefcount
+import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, SLOT
diff --git a/sources/pyside2/tests/signals/static_metaobject_test.py b/sources/pyside2/tests/signals/static_metaobject_test.py
index a6cca5ca4..bdb3b1992 100644
--- a/sources/pyside2/tests/signals/static_metaobject_test.py
+++ b/sources/pyside2/tests/signals/static_metaobject_test.py
@@ -34,7 +34,9 @@ import os
import sys
import unittest
-sys.path.append(os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "util"))
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
from PySide2.QtCore import QObject, SIGNAL, Slot
from helper.usesqcoreapplication import UsesQCoreApplication
diff --git a/sources/pyside2/tests/support/voidptr_test.py b/sources/pyside2/tests/support/voidptr_test.py
index f68217244..9e3668eb1 100644
--- a/sources/pyside2/tests/support/voidptr_test.py
+++ b/sources/pyside2/tests/support/voidptr_test.py
@@ -26,7 +26,14 @@
##
#############################################################################
+import os
+import sys
import unittest
+
+sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from init_paths import init_test_paths
+init_test_paths(False)
+
import shiboken2 as shiboken
from PySide2.support import VoidPtr
from PySide2.QtCore import QByteArray
diff --git a/sources/pyside2/tests/util/py2xfunctions.py b/sources/pyside2/tests/util/py2xfunctions.py
deleted file mode 100644
index 11bc6826b..000000000
--- a/sources/pyside2/tests/util/py2xfunctions.py
+++ /dev/null
@@ -1,46 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-def b(s):
- return s
-
-def l(n):
- return long(n)
-
-def unicode_(s):
- if type(s) == str:
- import codecs
- c = codecs.lookup('utf-8')
- s2 = c.decode(s, 'ignore')
- return s2[0]
- return u'%s' % s
-
-unicode = unicode
-unichr = unichr
-long = long
-buffer = buffer
diff --git a/sources/pyside2/tests/util/py3kcompat.py b/sources/pyside2/tests/util/py3kcompat.py
index b58181fff..bd90973ec 100644
--- a/sources/pyside2/tests/util/py3kcompat.py
+++ b/sources/pyside2/tests/util/py3kcompat.py
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
+
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -27,12 +28,55 @@
##
#############################################################################
+# Copy of ../../../shiboken2/tests/py3kcompat.py
+
import sys
IS_PY3K = sys.version_info[0] == 3
if IS_PY3K:
- from py3xfunctions import b, l, unicode_, unicode, unichr, long, unichr, buffer
+ def b(s):
+ if type(s) == bytes:
+ return s
+ return bytes(s, "UTF8")
+
+ def buffer_(s):
+ if s == None:
+ return None
+ elif type(s) == str:
+ return bytes(s, "UTF8")
+ elif type(s) == bytes:
+ return s
+ else:
+ memoryview(s)
+
+ def l(n):
+ return n
+
+ def unicode_(s):
+ return s
+
+ unicode = str
+ unichr = chr
+ long = int
+ unichr = chr
+ buffer = buffer_
else:
- from py2xfunctions import b, l, unicode_, unicode, unichr, long, unichr, buffer
+ def b(s):
+ return s
+
+ def l(n):
+ return long(n)
+
+ def unicode_(s):
+ if type(s) == str:
+ import codecs
+ c = codecs.lookup('utf-8')
+ s2 = c.decode(s, 'ignore')
+ return s2[0]
+ return u'%s' % s
+ unicode = unicode
+ unichr = unichr
+ long = long
+ buffer = buffer
diff --git a/sources/pyside2/tests/util/py3xfunctions.py b/sources/pyside2/tests/util/py3xfunctions.py
deleted file mode 100644
index 2d84c4721..000000000
--- a/sources/pyside2/tests/util/py3xfunctions.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#############################################################################
-##
-## Copyright (C) 2016 The Qt Company Ltd.
-## Contact: https://www.qt.io/licensing/
-##
-## This file is part of the test suite of Qt for Python.
-##
-## $QT_BEGIN_LICENSE:GPL-EXCEPT$
-## Commercial License Usage
-## Licensees holding valid commercial Qt licenses may use this file in
-## accordance with the commercial license agreement provided with the
-## Software or, alternatively, in accordance with the terms contained in
-## a written agreement between you and The Qt Company. For licensing terms
-## and conditions see https://www.qt.io/terms-conditions. For further
-## information use the contact form at https://www.qt.io/contact-us.
-##
-## GNU General Public License Usage
-## Alternatively, this file may be used under the terms of the GNU
-## General Public License version 3 as published by the Free Software
-## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-## included in the packaging of this file. Please review the following
-## information to ensure the GNU General Public License requirements will
-## be met: https://www.gnu.org/licenses/gpl-3.0.html.
-##
-## $QT_END_LICENSE$
-##
-#############################################################################
-
-def b(s):
- if type(s) == bytes:
- return s
- return bytes(s, "UTF8")
-
-def buffer_(s):
- if s == None:
- return None
- elif type(s) == str:
- return bytes(s, "UTF8")
- elif type(s) == bytes:
- return s
- else:
- memoryview(s)
-
-def l(n):
- return n
-
-def unicode_(s):
- return s
-
-unicode = str
-unichr = chr
-long = int
-unichr = chr
-buffer = buffer_
diff --git a/sources/shiboken2/ApiExtractor/typesystem.h b/sources/shiboken2/ApiExtractor/typesystem.h
index 790fb95cb..2324e8b78 100644
--- a/sources/shiboken2/ApiExtractor/typesystem.h
+++ b/sources/shiboken2/ApiExtractor/typesystem.h
@@ -1179,7 +1179,8 @@ class ComplexTypeEntry : public TypeEntry
{
public:
enum TypeFlag {
- Deprecated = 0x4
+ Deprecated = 0x4,
+ NoOverrideCaching = 0x8
};
Q_DECLARE_FLAGS(TypeFlags, TypeFlag)
diff --git a/sources/shiboken2/ApiExtractor/typesystemparser.cpp b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
index 55b079edd..efdab8be3 100644
--- a/sources/shiboken2/ApiExtractor/typesystemparser.cpp
+++ b/sources/shiboken2/ApiExtractor/typesystemparser.cpp
@@ -60,6 +60,7 @@ static inline QString untilAttribute() { return QStringLiteral("until"); }
static inline QString defaultSuperclassAttribute() { return QStringLiteral("default-superclass"); }
static inline QString deleteInMainThreadAttribute() { return QStringLiteral("delete-in-main-thread"); }
static inline QString deprecatedAttribute() { return QStringLiteral("deprecated"); }
+static inline QString noOverrideCachingAttribute() { return QStringLiteral("no-override-caching"); }
static inline QString exceptionHandlingAttribute() { return QStringLiteral("exception-handling"); }
static inline QString extensibleAttribute() { return QStringLiteral("extensible"); }
static inline QString fileNameAttribute() { return QStringLiteral("file-name"); }
@@ -1534,6 +1535,9 @@ void TypeSystemParser::applyComplexTypeAttributes(const QXmlStreamReader &reader
} else if (name == deprecatedAttribute()) {
if (convertBoolean(attributes->takeAt(i).value(), deprecatedAttribute(), false))
ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::Deprecated);
+ } else if (name == noOverrideCachingAttribute()) {
+ if (convertBoolean(attributes->takeAt(i).value(), noOverrideCachingAttribute(), false))
+ ctype->setTypeFlags(ctype->typeFlags() | ComplexTypeEntry::NoOverrideCaching);
} else if (name == deleteInMainThreadAttribute()) {
if (convertBoolean(attributes->takeAt(i).value(), deleteInMainThreadAttribute(), false))
ctype->setDeleteInMainThread(true);
diff --git a/sources/shiboken2/doc/typesystem_specifying_types.rst b/sources/shiboken2/doc/typesystem_specifying_types.rst
index 5d086f4d3..d296ccc80 100644
--- a/sources/shiboken2/doc/typesystem_specifying_types.rst
+++ b/sources/shiboken2/doc/typesystem_specifying_types.rst
@@ -309,6 +309,7 @@ object-type
allow-thread="..."
exception-handling="..."
hash-function="..."
+ no-override-caching="yes | no"
stream="yes | no"
revision="..." />
</typesystem>
@@ -332,6 +333,10 @@ object-type
specify the default handling for the corresponding function modification
(see :ref:`modify-function`).
+ The *optional* attribute **no-override-caching** can be used to turn off the
+ caching of methods overridden in Python, which can trigger obscure bugs when
+ setting attributes in Python 2.
+
interface-type
^^^^^^^^^^^^^^
diff --git a/sources/shiboken2/generator/main.cpp b/sources/shiboken2/generator/main.cpp
index 089ecb48f..e4d86f489 100644
--- a/sources/shiboken2/generator/main.cpp
+++ b/sources/shiboken2/generator/main.cpp
@@ -370,7 +370,7 @@ static void parseIncludePathOption(const QString &option, HeaderType headerType,
const CommandArgumentMap::iterator it = args.find(option);
if (it != args.end()) {
const QStringList includePathListList =
- it.value().split(pathSplitter, QString::SkipEmptyParts);
+ it.value().split(pathSplitter, Qt::SkipEmptyParts);
args.erase(it);
for (const QString &s : includePathListList) {
auto path = QFile::encodeName(QDir::cleanPath(s));
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
index 5697a24e0..9e7b96c7f 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.cpp
@@ -414,18 +414,17 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
}
const AbstractMetaFunctionList &funcs = filterFunctions(metaClass);
+ int maxOverrides = 0;
+ writeCacheResetNative(s, metaClass);
for (const AbstractMetaFunction *func : funcs) {
const bool notAbstract = !func->isAbstract();
if ((func->isPrivate() && notAbstract && !visibilityModifiedToPrivate(func))
|| (func->isModifiedRemoved() && notAbstract))
continue;
- if (func->functionType() == AbstractMetaFunction::ConstructorFunction && !func->isUserAdded()) {
+ if (func->functionType() == AbstractMetaFunction::ConstructorFunction && !func->isUserAdded())
writeConstructorNative(s, func);
- } else if ((!avoidProtectedHack() || !metaClass->hasPrivateDestructor())
- && ((func->isVirtual() || func->isAbstract())
- && (func->attributes() & AbstractMetaAttributes::FinalCppMethod) == 0)) {
- writeVirtualMethodNative(s, func);
- }
+ else if (shouldWriteVirtualMethodNative(func))
+ writeVirtualMethodNative(s, func, maxOverrides++);
}
if (!avoidProtectedHack() || !metaClass->hasPrivateDestructor()) {
@@ -695,6 +694,14 @@ void CppGenerator::generateClass(QTextStream &s, GeneratorContext &classContext)
}
}
+void CppGenerator::writeCacheResetNative(QTextStream &s, const AbstractMetaClass *metaClass)
+{
+ Indentation indentation(INDENT);
+ s << "void " << wrapperName(metaClass) << "::resetPyMethodCache()\n{\n";
+ s << INDENT << "std::fill_n(m_PyMethodCache, sizeof(m_PyMethodCache) / sizeof(m_PyMethodCache[0]), false);\n";
+ s << "}\n\n";
+}
+
void CppGenerator::writeConstructorNative(QTextStream &s, const AbstractMetaFunction *func)
{
Indentation indentation(INDENT);
@@ -704,6 +711,7 @@ void CppGenerator::writeConstructorNative(QTextStream &s, const AbstractMetaFunc
writeFunctionCall(s, func);
s << "\n{\n";
const AbstractMetaArgument *lastArg = func->arguments().isEmpty() ? nullptr : func->arguments().constLast();
+ s << INDENT << "resetPyMethodCache();\n";
writeCodeSnips(s, func->injectedCodeSnips(), TypeSystem::CodeSnipPositionBeginning, TypeSystem::NativeCode, func, lastArg);
s << INDENT << "// ... middle\n";
writeCodeSnips(s, func->injectedCodeSnips(), TypeSystem::CodeSnipPositionEnd, TypeSystem::NativeCode, func, lastArg);
@@ -763,7 +771,9 @@ QString CppGenerator::getVirtualFunctionReturnTypeName(const AbstractMetaFunctio
+ typeEntry->qualifiedCppName() + QLatin1String(" >())->tp_name");
}
-void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFunction *func)
+void CppGenerator::writeVirtualMethodNative(QTextStream &s,
+ const AbstractMetaFunction *func,
+ int cacheIndex)
{
//skip metaObject function, this will be written manually ahead
if (usePySideExtensions() && func->ownerClass() && func->ownerClass()->isQObject() &&
@@ -838,6 +848,28 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
s << Qt::endl;
}
+ // PYSIDE-803: Build a boolean cache for unused overrides.
+ bool multi_line = retType == nullptr; // set to true when using instrumentation
+ s << INDENT << "if (m_PyMethodCache[" << cacheIndex << "])" << (multi_line ? " {\n" : "\n");
+ {
+ Indentation indentation(INDENT);
+ s << INDENT;
+ if (retType)
+ s << "return ";
+ if (!func->isAbstract()) {
+ s << "this->::" << func->implementingClass()->qualifiedCppName() << "::";
+ writeFunctionCall(s, func, Generator::VirtualCall);
+ } else {
+ if (retType)
+ s << ' ' << defaultReturnExpr.returnValue();
+ }
+ if (!retType)
+ s << ";\n" << INDENT << "return";
+ s << ";\n";
+ }
+ if (multi_line)
+ s << INDENT << "}\n";
+
s << INDENT << "Shiboken::GilState gil;\n";
// Get out of virtual method call if someone already threw an error.
@@ -870,7 +902,10 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
s << ' ' << defaultReturnExpr.returnValue();
} else {
s << INDENT << "gil.release();\n";
- s << INDENT;
+ if (useOverrideCaching(func->ownerClass())) {
+ s << INDENT << "m_PyMethodCache[" << cacheIndex << "] = true;\n";
+ s << INDENT;
+ }
if (retType)
s << "return ";
s << "this->::" << func->implementingClass()->qualifiedCppName() << "::";
@@ -880,7 +915,7 @@ void CppGenerator::writeVirtualMethodNative(QTextStream &s, const AbstractMetaFu
}
}
s << ";\n";
- s << INDENT<< "}\n\n";
+ s << INDENT << "}\n\n"; //WS
writeConversionRule(s, func, TypeSystem::TargetLangCode);
@@ -1477,10 +1512,10 @@ void CppGenerator::writeConverterRegister(QTextStream &s, const AbstractMetaClas
QStringList cppSignature;
if (!classContext.forSmartPointer()) {
cppSignature = metaClass->qualifiedCppName().split(QLatin1String("::"),
- QString::SkipEmptyParts);
+ Qt::SkipEmptyParts);
} else {
cppSignature = classContext.preciseType()->cppSignature().split(QLatin1String("::"),
- QString::SkipEmptyParts);
+ Qt::SkipEmptyParts);
}
while (!cppSignature.isEmpty()) {
QString signature = cppSignature.join(QLatin1String("::"));
@@ -1928,7 +1963,7 @@ void CppGenerator::writeArgumentsInitializer(QTextStream &s, OverloadData &overl
s << INDENT << "PyObject *";
s << PYTHON_ARGS << "[] = {"
- << QString(maxArgs, QLatin1Char('0')).split(QLatin1String(""), QString::SkipEmptyParts).join(QLatin1String(", "))
+ << QString(maxArgs, QLatin1Char('0')).split(QLatin1String(""), Qt::SkipEmptyParts).join(QLatin1String(", "))
<< "};\n";
s << Qt::endl;
@@ -5238,6 +5273,16 @@ void CppGenerator::writeSetattroFunction(QTextStream &s, AttroCheck attroCheck,
Q_ASSERT(!context.forSmartPointer());
const AbstractMetaClass *metaClass = context.metaClass();
writeSetattroDefinition(s, metaClass);
+ // PYSIDE-803: Detect duck-punching; clear cache if a method is set.
+ if (attroCheck.testFlag(AttroCheckFlag::SetattroMethodOverride)
+ && ShibokenGenerator::shouldGenerateCppWrapper(metaClass)) {
+ s << INDENT << "if (value && PyCallable_Check(value)) {\n";
+ s << INDENT << " auto plain_inst = " << cpythonWrapperCPtr(metaClass, QLatin1String("self")) << ";\n";
+ s << INDENT << " auto inst = dynamic_cast<" << wrapperName(metaClass) << " *>(plain_inst);\n";
+ s << INDENT << " if (inst)\n";
+ s << INDENT << " inst->resetPyMethodCache();\n";
+ s << INDENT << "}\n";
+ }
if (attroCheck.testFlag(AttroCheckFlag::SetattroQObject)) {
s << INDENT << "Shiboken::AutoDecRef pp(reinterpret_cast<PyObject *>(PySide::Property::getObject(self, name)));\n";
s << INDENT << "if (!pp.isNull())\n";
@@ -5771,7 +5816,7 @@ bool CppGenerator::finishGeneration()
if (!referencedType)
continue;
QString converter = converterObject(referencedType);
- QStringList cppSignature = pte->qualifiedCppName().split(QLatin1String("::"), QString::SkipEmptyParts);
+ QStringList cppSignature = pte->qualifiedCppName().split(QLatin1String("::"), Qt::SkipEmptyParts);
while (!cppSignature.isEmpty()) {
QString signature = cppSignature.join(QLatin1String("::"));
s << INDENT << "Shiboken::Conversions::registerConverterName(" << converter << ", \"" << signature << "\");\n";
diff --git a/sources/shiboken2/generator/shiboken2/cppgenerator.h b/sources/shiboken2/generator/shiboken2/cppgenerator.h
index 4b7c80ee4..aee1fb7d4 100644
--- a/sources/shiboken2/generator/shiboken2/cppgenerator.h
+++ b/sources/shiboken2/generator/shiboken2/cppgenerator.h
@@ -53,11 +53,12 @@ private:
void writeInitFunc(QTextStream &declStr, QTextStream &callStr,
const Indentor &indent, const QString &initFunctionName,
const TypeEntry *enclosingEntry = nullptr);
+ void writeCacheResetNative(QTextStream &s, const AbstractMetaClass *metaClass);
void writeConstructorNative(QTextStream &s, const AbstractMetaFunction *func);
void writeDestructorNative(QTextStream &s, const AbstractMetaClass *metaClass);
QString getVirtualFunctionReturnTypeName(const AbstractMetaFunction *func);
- void writeVirtualMethodNative(QTextStream &s, const AbstractMetaFunction *func);
+ void writeVirtualMethodNative(QTextStream &s, const AbstractMetaFunction *func, int cacheIndex);
void writeMetaObjectMethod(QTextStream &s, const AbstractMetaClass *metaClass);
void writeMetaCast(QTextStream &s, const AbstractMetaClass *metaClass);
diff --git a/sources/shiboken2/generator/shiboken2/headergenerator.cpp b/sources/shiboken2/generator/shiboken2/headergenerator.cpp
index a565659de..af56d944a 100644
--- a/sources/shiboken2/generator/shiboken2/headergenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/headergenerator.cpp
@@ -139,10 +139,17 @@ void HeaderGenerator::generateClass(QTextStream &s, GeneratorContext &classConte
s << "\n{\npublic:\n";
const AbstractMetaFunctionList &funcs = filterFunctions(metaClass);
+ int maxOverrides = 0;
for (AbstractMetaFunction *func : funcs) {
- if ((func->attributes() & AbstractMetaAttributes::FinalCppMethod) == 0)
+ if ((func->attributes() & AbstractMetaAttributes::FinalCppMethod) == 0) {
writeFunction(s, func);
+ // PYSIDE-803: Build a boolean cache for unused overrides.
+ if (shouldWriteVirtualMethodNative(func))
+ maxOverrides++;
+ }
}
+ if (!maxOverrides)
+ maxOverrides = 1;
if (avoidProtectedHack() && metaClass->hasProtectedFields()) {
const AbstractMetaFieldList &fields = metaClass->fields();
@@ -182,6 +189,10 @@ void HeaderGenerator::generateClass(QTextStream &s, GeneratorContext &classConte
if (usePySideExtensions())
s << INDENT << "static void pysideInitQtMetaTypes();\n";
+ s << INDENT << "void resetPyMethodCache();\n";
+ s << "private:\n";
+ s << INDENT << "mutable bool m_PyMethodCache[" << maxOverrides << "];\n";
+
s << "};\n\n";
if (!innerHeaderGuard.isEmpty())
s << "# endif // SBK_" << innerHeaderGuard << "_H\n\n";
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
index 9793998b9..170cbd74e 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp
@@ -96,7 +96,7 @@ static QString resolveScopePrefix(const QStringList &scopeList, const QString &v
static inline QStringList splitClassScope(const AbstractMetaClass *scope)
{
- return scope->qualifiedCppName().split(QLatin1String("::"), QString::SkipEmptyParts);
+ return scope->qualifiedCppName().split(QLatin1String("::"), Qt::SkipEmptyParts);
}
static QString resolveScopePrefix(const AbstractMetaClass *scope, const QString &value)
@@ -322,6 +322,15 @@ bool ShibokenGenerator::shouldGenerateCppWrapper(const AbstractMetaClass *metaCl
return result;
}
+bool ShibokenGenerator::shouldWriteVirtualMethodNative(const AbstractMetaFunction *func)
+{
+ // PYSIDE-803: Extracted this because it is used multiple times.
+ const AbstractMetaClass *metaClass = func->ownerClass();
+ return (!avoidProtectedHack() || !metaClass->hasPrivateDestructor())
+ && ((func->isVirtual() || func->isAbstract())
+ && (func->attributes() & AbstractMetaAttributes::FinalCppMethod) == 0);
+}
+
void ShibokenGenerator::lookForEnumsInClassesNotToBeGenerated(AbstractMetaEnumList &enumList, const AbstractMetaClass *metaClass)
{
Q_ASSERT(metaClass);
@@ -355,6 +364,15 @@ QString ShibokenGenerator::wrapperName(const AbstractMetaType *metaType) const
return metaType->cppSignature();
}
+QString ShibokenGenerator::wrapperName(const TypeEntry *type) const
+{
+ QString name = type->name();
+ int pos = name.lastIndexOf(QLatin1String("::"));
+ if (pos >= 0)
+ name = name.remove(0, pos + 2);
+ return name + QLatin1String("Wrapper");
+}
+
QString ShibokenGenerator::fullPythonClassName(const AbstractMetaClass *metaClass)
{
QString fullClassName = metaClass->name();
@@ -2167,6 +2185,13 @@ bool ShibokenGenerator::injectedCodeUsesArgument(const AbstractMetaFunction *fun
return false;
}
+bool ShibokenGenerator::useOverrideCaching(const AbstractMetaClass *metaClass)
+{
+ return metaClass->isPolymorphic()
+ && !metaClass->typeEntry()->typeFlags().testFlag(ComplexTypeEntry::NoOverrideCaching);
+
+}
+
ShibokenGenerator::AttroCheck ShibokenGenerator::checkAttroFunctionNeeds(const AbstractMetaClass *metaClass) const
{
AttroCheck result;
@@ -2177,6 +2202,8 @@ ShibokenGenerator::AttroCheck ShibokenGenerator::checkAttroFunctionNeeds(const A
result |= AttroCheckFlag::GetattroOverloads;
if (usePySideExtensions() && metaClass->qualifiedCppName() == QLatin1String("QObject"))
result |= AttroCheckFlag::SetattroQObject;
+ if (useOverrideCaching(metaClass))
+ result |= AttroCheckFlag::SetattroMethodOverride;
}
return result;
}
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.h b/sources/shiboken2/generator/shiboken2/shibokengenerator.h
index 55622b7c2..d0e9073c8 100644
--- a/sources/shiboken2/generator/shiboken2/shibokengenerator.h
+++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.h
@@ -72,6 +72,7 @@ public:
GetattroMask = 0x0F,
SetattroQObject = 0x10,
SetattroSmartPointer = 0x20,
+ SetattroMethodOverride = 0x40,
SetattroMask = 0xF0,
};
Q_DECLARE_FLAGS(AttroCheck, AttroCheckFlag);
@@ -193,6 +194,7 @@ protected:
/// Returns the top-most class that has multiple inheritance in the ancestry.
static const AbstractMetaClass *getMultipleInheritingClass(const AbstractMetaClass *metaClass);
+ static bool useOverrideCaching(const AbstractMetaClass *metaClass);
AttroCheck checkAttroFunctionNeeds(const AbstractMetaClass *metaClass) const;
/// Returns a list of methods of the given class where each one is part of a different overload with both static and non-static method.
@@ -212,11 +214,15 @@ protected:
/// Verifies if the class should have a C++ wrapper generated for it, instead of only a Python wrapper.
bool shouldGenerateCppWrapper(const AbstractMetaClass *metaClass) const;
+ /// Condition to call WriteVirtualMethodNative. Was extracted because also used to count these calls.
+ bool shouldWriteVirtualMethodNative(const AbstractMetaFunction *func);
+
/// Adds enums eligible for generation from classes/namespaces marked not to be generated.
static void lookForEnumsInClassesNotToBeGenerated(AbstractMetaEnumList &enumList, const AbstractMetaClass *metaClass);
QString wrapperName(const AbstractMetaClass *metaClass) const;
QString wrapperName(const AbstractMetaType *metaType) const;
+ QString wrapperName(const TypeEntry *type) const;
QString fullPythonClassName(const AbstractMetaClass *metaClass);
QString fullPythonFunctionName(const AbstractMetaFunction *func);
diff --git a/sources/shiboken2/libshiboken/bindingmanager.cpp b/sources/shiboken2/libshiboken/bindingmanager.cpp
index 725150e87..1f18ed60a 100644
--- a/sources/shiboken2/libshiboken/bindingmanager.cpp
+++ b/sources/shiboken2/libshiboken/bindingmanager.cpp
@@ -37,6 +37,7 @@
**
****************************************************************************/
+#include "autodecref.h"
#include "basewrapper.h"
#include "basewrapper_p.h"
#include "bindingmanager.h"
@@ -288,7 +289,7 @@ PyObject *BindingManager::getOverride(const void *cptr, const char *methodName)
}
}
- PyObject *pyMethodName = Shiboken::String::fromCString(methodName);
+ Shiboken::AutoDecRef pyMethodName(Shiboken::String::fromCString(methodName));
PyObject *method = PyObject_GetAttr(reinterpret_cast<PyObject *>(wrapper), pyMethodName);
if (method && PyMethod_Check(method)
@@ -302,16 +303,13 @@ PyObject *BindingManager::getOverride(const void *cptr, const char *methodName)
auto *parent = reinterpret_cast<PyTypeObject *>(PyTuple_GET_ITEM(mro, i));
if (parent->tp_dict) {
defaultMethod = PyDict_GetItem(parent->tp_dict, pyMethodName);
- if (defaultMethod && PyMethod_GET_FUNCTION(method) != defaultMethod) {
- Py_DECREF(pyMethodName);
+ if (defaultMethod && PyMethod_GET_FUNCTION(method) != defaultMethod)
return method;
- }
}
}
}
Py_XDECREF(method);
- Py_DECREF(pyMethodName);
return nullptr;
}
diff --git a/sources/shiboken2/tests/py3kcompat.py b/sources/shiboken2/tests/py3kcompat.py
index 065208994..357ea4fba 100644
--- a/sources/shiboken2/tests/py3kcompat.py
+++ b/sources/shiboken2/tests/py3kcompat.py
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
-#
+
#############################################################################
##
-## Copyright (C) 2016 The Qt Company Ltd.
+## Copyright (C) 2020 The Qt Company Ltd.
## Contact: https://www.qt.io/licensing/
##
## This file is part of the test suite of Qt for Python.
@@ -28,21 +28,39 @@
##
#############################################################################
+# Copy of ../../pyside2/tests/util/py3kcompat.py
+
import sys
IS_PY3K = sys.version_info[0] == 3
if IS_PY3K:
- def unicode(s):
- return s
-
def b(s):
+ if type(s) == bytes:
+ return s
return bytes(s, "UTF8")
+ def buffer_(s):
+ if s == None:
+ return None
+ elif type(s) == str:
+ return bytes(s, "UTF8")
+ elif type(s) == bytes:
+ return s
+ else:
+ memoryview(s)
+
def l(n):
return n
+ def unicode_(s):
+ return s
+
+ unicode = str
+ unichr = chr
long = int
+ unichr = chr
+ buffer = buffer_
else:
def b(s):
return s
@@ -50,5 +68,15 @@ else:
def l(n):
return long(n)
+ def unicode_(s):
+ if type(s) == str:
+ import codecs
+ c = codecs.lookup('utf-8')
+ s2 = c.decode(s, 'ignore')
+ return s2[0]
+ return u'%s' % s
+
unicode = unicode
+ unichr = unichr
long = long
+ buffer = buffer
diff --git a/sources/shiboken2/tests/shiboken_paths.py b/sources/shiboken2/tests/shiboken_paths.py
index cf366a133..e5a8f2926 100644
--- a/sources/shiboken2/tests/shiboken_paths.py
+++ b/sources/shiboken2/tests/shiboken_paths.py
@@ -31,6 +31,20 @@ import os
import sys
+def get_dir_env_var(var_name):
+ """Return a directory set by an environment variable"""
+ result = os.environ.get(var_name)
+ if not result:
+ raise ValueError('{} is not set!'.format(var_name))
+ if not os.path.isdir(result):
+ raise ValueError('{} is not a directory!'.format(result))
+ return result
+
+
+def get_build_dir():
+ return get_dir_env_var('BUILD_DIR')
+
+
def _prepend_path_var(var_name, paths):
"""Prepend additional paths to a path environment variable
like PATH, LD_LIBRARY_PATH"""
@@ -41,29 +55,15 @@ def _prepend_path_var(var_name, paths):
os.environ[var_name] = new_paths
-def init_paths():
- """Sets the correct import paths (Python modules and C++ library
- paths) for testing shiboken depending on a single
- environment variable BUILD_DIR pointing to the build
- directory."""
- VAR_NAME = 'BUILD_DIR'
- build_dir = os.environ.get(VAR_NAME)
- if not build_dir:
- raise ValueError('{} is not set!'.format(VAR_NAME))
- if not os.path.isdir(build_dir):
- raise ValueError('{} is not a directory!'.format(build_dir))
- src_dir = os.path.dirname(os.path.abspath(__file__))
- if src_dir not in sys.path: # Might be present due to import of this file
- sys.path.append(src_dir) # For py3kcompat
- shiboken_dir = os.path.join(build_dir, 'shiboken2')
- sys.path.append(os.path.join(shiboken_dir, 'shibokenmodule'))
- lib_dirs = [os.path.join(shiboken_dir, 'libshiboken')]
- shiboken_test_dir = os.path.join(shiboken_dir, 'tests')
- for module in ['minimal', 'sample', 'smart', 'other']:
- module_dir = os.path.join(shiboken_test_dir, module + 'binding')
- sys.path.append(module_dir)
- lib_dir = os.path.join(shiboken_test_dir, 'lib' + module)
- lib_dirs.append(lib_dir)
+def add_python_dirs(python_dirs):
+ """Add directories to the Python path unless present."""
+ for python_dir in python_dirs:
+ if python_dir not in sys.path:
+ sys.path.append(python_dir)
+
+
+def add_lib_dirs(lib_dirs):
+ """Add directories to the platform's library path."""
if sys.platform == 'win32':
if sys.version_info >= (3, 8, 0):
for lib_dir in lib_dirs:
@@ -72,3 +72,35 @@ def init_paths():
_prepend_path_var('PATH', lib_dirs)
else:
_prepend_path_var('LD_LIBRARY_PATH', lib_dirs)
+
+
+def shiboken_paths(include_shiboken_tests=False):
+ """Return a tuple of python directories/lib directories to be set for
+ using the shiboken2 module from the build directory or running the
+ shiboken tests depending on a single environment variable BUILD_DIR
+ pointing to the build directory."""
+ src_dir = os.path.dirname(os.path.abspath(__file__))
+ python_dirs = []
+ if include_shiboken_tests:
+ python_dirs.append(src_dir) # For py3kcompat
+ shiboken_dir = os.path.join(get_build_dir(), 'shiboken2')
+ python_dirs.append(os.path.join(shiboken_dir, 'shibokenmodule'))
+ lib_dirs = [os.path.join(shiboken_dir, 'libshiboken')]
+ if include_shiboken_tests:
+ shiboken_test_dir = os.path.join(shiboken_dir, 'tests')
+ for module in ['minimal', 'sample', 'smart', 'other']:
+ module_dir = os.path.join(shiboken_test_dir, module + 'binding')
+ python_dirs.append(module_dir)
+ lib_dir = os.path.join(shiboken_test_dir, 'lib' + module)
+ lib_dirs.append(lib_dir)
+ return (python_dirs, lib_dirs)
+
+
+def init_paths():
+ """Sets the correct import paths (Python modules and C++ library
+ paths) for testing shiboken depending on a single
+ environment variable BUILD_DIR pointing to the build
+ directory."""
+ paths = shiboken_paths(True)
+ add_python_dirs(paths[0])
+ add_lib_dirs(paths[1])
diff --git a/tools/create_changelog.py b/tools/create_changelog.py
index d28af1a7f..7599cc6b9 100644
--- a/tools/create_changelog.py
+++ b/tools/create_changelog.py
@@ -41,9 +41,9 @@ import re
import sys
from argparse import ArgumentParser, Namespace, RawTextHelpFormatter
from subprocess import check_output, Popen, PIPE
-from typing import Dict, List
+from typing import Dict, List, Tuple
-content = """Qt for Python @VERSION is a @TYPE release.
+content_header = """Qt for Python @VERSION is a @TYPE release.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
@@ -61,14 +61,11 @@ information about a particular change.
****************************************************************************
* PySide2 *
****************************************************************************
+"""
-@PYSIDE
-
-****************************************************************************
+shiboken_header = """****************************************************************************
* Shiboken2 *
****************************************************************************
-
-@SHIBOKEN
"""
@@ -143,20 +140,22 @@ def get_commit_content(sha: str) -> str:
print(err, file=sys.stderr)
return out.decode("utf-8")
-
-def git_command(versions: List[str], pattern: str):
+def git_get_sha1s(versions: List[str], pattern: str):
+ """Return a list of SHA1s matching a pattern"""
command = "git rev-list --reverse --grep '^{}'".format(pattern)
command += " {}..{}".format(versions[0], versions[1])
command += " | git cat-file --batch"
command += " | grep -o -E \"^[0-9a-f]{40}\""
- task_number_re = re.compile(r'^.*-(\d+)\s*$')
print("{}: {}".format(git_command.__name__, command), file=sys.stderr)
out_sha1, err = Popen(command, stdout=PIPE, shell=True).communicate()
if err:
print(err, file=sys.stderr)
- sha1_list = [s.decode("utf-8") for s in out_sha1.splitlines()]
+ return [s.decode("utf-8") for s in out_sha1.splitlines()]
+
- for sha in sha1_list:
+def git_command(versions: List[str], pattern: str):
+ task_number_re = re.compile(r'^.*-(\d+)\s*$')
+ for sha in git_get_sha1s(versions, pattern):
content = get_commit_content(sha).splitlines()
# First line is title
title = content[0]
@@ -190,11 +189,43 @@ def create_task_log(versions: List[str]) -> None:
git_command(versions, "Task-number: ")
+def extract_change_log(commit_message: List[str]) -> Tuple[str, List[str]]:
+ """Extract a tuple of (component, change log lines) from a commit message
+ of the form [ChangeLog][shiboken2] description..."""
+ result = []
+ component = 'pyside'
+ within_changelog = False
+ for line in commit_message:
+ if within_changelog:
+ if line:
+ result.append(' ' + line.strip())
+ else:
+ break
+ else:
+ if line.startswith('[ChangeLog]'):
+ log_line = line[11:]
+ if log_line.startswith('['):
+ end = log_line.find(']')
+ if end > 0:
+ component = log_line[1:end]
+ log_line = log_line[end + 1:]
+ result.append(' * ' + log_line.strip())
+ within_changelog = True
+ return (component, result)
+
+
+def create_change_log(versions: List[str]) -> None:
+ for sha in git_get_sha1s(versions, r"\[ChangeLog\]"):
+ change_log = extract_change_log(get_commit_content(sha).splitlines())
+ if change_log[0].startswith('shiboken'):
+ shiboken2_changelogs.extend(change_log[1])
+ else:
+ pyside2_changelogs.extend(change_log[1])
+
+
def gen_list(d: Dict[str, Dict[str, str]]) -> str:
- if d:
- return "".join(" - [{}] {}\n".format(v["task"], v["title"])
- for _, v in d.items())
- return " - No changes"
+ return "".join(" - [{}] {}\n".format(v["task"], v["title"])
+ for _, v in d.items())
def sort_dict(d: Dict[str, Dict[str, str]]) -> Dict[str, Dict[str, str]]:
@@ -206,6 +237,8 @@ if __name__ == "__main__":
args = parse_options()
pyside2_commits: Dict[str, Dict[str, str]] = {}
shiboken2_commits: Dict[str, Dict[str, str]] = {}
+ pyside2_changelogs: List[str] = []
+ shiboken2_changelogs: List[str] = []
# Getting commits information
directory = args.directory if args.directory else "."
@@ -214,14 +247,21 @@ if __name__ == "__main__":
if check_tag(versions[0]) and check_tag(versions[1]):
create_fixes_log(versions)
create_task_log(versions)
+ create_change_log(versions)
# Sort commits
pyside2_commits = sort_dict(pyside2_commits)
shiboken2_commits = sort_dict(shiboken2_commits)
# Generate message
- print(content
- .replace("@VERSION", args.release)
- .replace("@TYPE", args.type)
- .replace("@PYSIDE", gen_list(pyside2_commits))
- .replace("@SHIBOKEN", gen_list(shiboken2_commits)))
+ print(content_header.replace("@VERSION", args.release).
+ replace("@TYPE", args.type))
+ print('\n'.join(pyside2_changelogs))
+ print(gen_list(pyside2_commits))
+ if not pyside2_changelogs and not pyside2_commits:
+ print(" - No changes")
+ print(shiboken_header)
+ print('\n'.join(shiboken2_changelogs))
+ print(gen_list(shiboken2_commits))
+ if not shiboken2_changelogs and not shiboken2_commits:
+ print(" - No changes")