aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests
diff options
context:
space:
mode:
authorChristian Tismer <[email protected]>2021-02-07 18:51:57 +0100
committerChristian Tismer <[email protected]>2021-02-08 14:21:41 +0100
commite2c129373d4bde20382f91d11e51c75702732a43 (patch)
tree056cfca0341542cba3c6f578429b3c3cced235da /sources/pyside6/tests
parent95e3b2c7256c71b274be5f16e216116e5876ee87 (diff)
Switch from os.path to pathlib.Path, systematic test changes
This patch does the systematic changes on all tests. Note that there was a bug in principle: os.path was used without importing os.path This worked through the way how the os module initializes itself, but you always will find the explicit import in the python library. But the problem is going away anyway after the transition to pathlib.Path :) Change-Id: I95144d7f9bb07a38376c3aa428df663f2e64bcb7 Reviewed-by: Cristian Maureira-Fredes <[email protected]>
Diffstat (limited to 'sources/pyside6/tests')
-rw-r--r--sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py3
-rw-r--r--sources/pyside6/tests/QtCharts/qcharts_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/attr_cache_py3k.py5
-rw-r--r--sources/pyside6/tests/QtCore/blocking_signals_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_1019.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_1063.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_1069.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_1313.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_278_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_332.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_408.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_428.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_462.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_505.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_515.py5
-rw-r--r--sources/pyside6/tests/QtCore/bug_606.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_656.py5
-rw-r--r--sources/pyside6/tests/QtCore/bug_686.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_699.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_706.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_820.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_826.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_829.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_835.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_920.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_927.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_931.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_938.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_953.py5
-rw-r--r--sources/pyside6/tests/QtCore/bug_987.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_994.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-164.py3
-rw-r--r--sources/pyside6/tests/QtCore/bug_PYSIDE-42.py3
-rw-r--r--sources/pyside6/tests/QtCore/child_event_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/classinfo_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/deepcopy_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/deletelater_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/destroysignal_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/duck_punching_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/emoji_string_test.py5
-rw-r--r--sources/pyside6/tests/QtCore/errormessages_with_features_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/hash_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/inherits_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/max_signals.py3
-rw-r--r--sources/pyside6/tests/QtCore/missing_symbols_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/mockclass_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/multiple_feature_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/python_conversion.py3
-rw-r--r--sources/pyside6/tests/QtCore/qabs_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qabstractitemmodel_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qanimationgroup_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qbitarray_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_operator_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qbytearray_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qcalendar_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qcbor_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qcollator_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qcommandlineparser_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qcoreapplication_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qdatastream_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qdate_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qdatetime_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qeasingcurve_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qenum_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qevent_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qfile_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qfileinfo_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qfileread_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qflags_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qhandle_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qinstallmsghandler_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qjsondocument_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qlinef_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qlocale_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qlockfile_test.py5
-rw-r--r--sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qmetaobject_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qmimedatabase_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_children_segfault_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_connect_notify_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_destructor.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_event_filter_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_inherits_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_objectproperty_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_parent_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_property_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_protected_methods_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_timer_event_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qpoint_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qprocess_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qproperty_decorator.py3
-rw-r--r--sources/pyside6/tests/QtCore/qrandomgenerator_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qrect_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qregularexpression_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qresource_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qsettings_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qsize_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qslot_object_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qsocketnotifier_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qsrand_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qstandardpaths_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qstorageinfo_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qstring_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qsysinfo_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qtextstream_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qthread_prod_cons_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qthread_signal_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qthread_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qtimer_singleshot_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qtimer_timeout_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qtimezone_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qtnamespace_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qurl_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qurlquery_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/quuid_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/qversionnumber_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/repr_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/setprop_on_ctor_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/snake_prop_feature_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/staticMetaObject_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/static_method_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/thread_signals_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/tr_noop_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/translation_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/unaryoperator_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/unicode_test.py3
-rw-r--r--sources/pyside6/tests/QtCore/versioninfo_test.py3
-rw-r--r--sources/pyside6/tests/QtDataVisualization/datavisualization_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_1091.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_300_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_367.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_480.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_606.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_617.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_652.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_660.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_716.py5
-rw-r--r--sources/pyside6/tests/QtGui/bug_740.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_743.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_991.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_PYSIDE-344.py3
-rw-r--r--sources/pyside6/tests/QtGui/bug_PYSIDE-41.py3
-rw-r--r--sources/pyside6/tests/QtGui/deepcopy_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/pyside_reload_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qcolor_reduce_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qcolor_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qcursor_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qdesktopservices_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qfontmetrics_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qguiapplication_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qicon_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qitemselection_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qkeysequence_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qpainter_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qpdfwriter_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qpixelformat_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qpixmap_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qpixmapcache_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qpolygonf_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qradialgradient_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qrasterwindow_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qregion_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qstylehints_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qtextdocument_functions.py3
-rw-r--r--sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qtextline_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/qtransform_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/repr_test.py3
-rw-r--r--sources/pyside6/tests/QtGui/timed_app_and_patching_test.py3
-rw-r--r--sources/pyside6/tests/QtHelp/help_test.py3
-rw-r--r--sources/pyside6/tests/QtHelp/helpsearchengine_test.py3
-rw-r--r--sources/pyside6/tests/QtLocation/location.py3
-rw-r--r--sources/pyside6/tests/QtMultimedia/audio_test.py3
-rw-r--r--sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/accessManager_test.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/bug_1084.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/bug_446.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/dnslookup_test.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/qipv6address_test.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/tcpserver_test.py3
-rw-r--r--sources/pyside6/tests/QtNetwork/udpsocket_test.py3
-rw-r--r--sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py3
-rw-r--r--sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py3
-rw-r--r--sources/pyside6/tests/QtPositioning/positioning.py3
-rw-r--r--sources/pyside6/tests/QtPrintSupport/bug_500.py3
-rw-r--r--sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_1029.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_451.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_456.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_557.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_726.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_814.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_825.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_847.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_915.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_926.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_951.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_995.py3
-rw-r--r--sources/pyside6/tests/QtQml/bug_997.py3
-rw-r--r--sources/pyside6/tests/QtQml/connect_python_qml.py3
-rw-r--r--sources/pyside6/tests/QtQml/javascript_exceptions.py3
-rw-r--r--sources/pyside6/tests/QtQml/listproperty.py3
-rw-r--r--sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py3
-rw-r--r--sources/pyside6/tests/QtQml/qqmlnetwork_test.py3
-rw-r--r--sources/pyside6/tests/QtQml/qquickitem_grabToImage.py3
-rw-r--r--sources/pyside6/tests/QtQml/qquickview_test.py3
-rw-r--r--sources/pyside6/tests/QtQml/registersingletontype.py3
-rw-r--r--sources/pyside6/tests/QtQml/registertype.py3
-rw-r--r--sources/pyside6/tests/QtQml/registeruncreatabletype.py3
-rw-r--r--sources/pyside6/tests/QtQml/signal_arguments.py3
-rw-r--r--sources/pyside6/tests/QtScxml/test_dynamic.py3
-rw-r--r--sources/pyside6/tests/QtSensors/sensors.py3
-rw-r--r--sources/pyside6/tests/QtSerialPort/serial.py3
-rw-r--r--sources/pyside6/tests/QtSql/bug_1013.py3
-rw-r--r--sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py3
-rw-r--r--sources/pyside6/tests/QtSql/qvarianttype_test.py3
-rw-r--r--sources/pyside6/tests/QtStateMachine/bug_1031.py5
-rw-r--r--sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py3
-rw-r--r--sources/pyside6/tests/QtStateMachine/qstate_test.py3
-rw-r--r--sources/pyside6/tests/QtStateMachine/qstatemachine_test.py3
-rw-r--r--sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py3
-rw-r--r--sources/pyside6/tests/QtSvg/qsvggenerator_test.py3
-rw-r--r--sources/pyside6/tests/QtSvg/qsvgrenderer_test.py3
-rw-r--r--sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py3
-rw-r--r--sources/pyside6/tests/QtTest/click_test.py3
-rw-r--r--sources/pyside6/tests/QtTest/eventfilter_test.py3
-rw-r--r--sources/pyside6/tests/QtTest/qvalidator_test.py3
-rw-r--r--sources/pyside6/tests/QtTest/touchevent_test.py3
-rw-r--r--sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_1060.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_360.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_376.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_392.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_426.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_552.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_797.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_909.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_913.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_958.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/bug_965.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/loadUiType_test.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/ui_test.py3
-rw-r--r--sources/pyside6/tests/QtUiTools/uiloader_test.py3
-rw-r--r--sources/pyside6/tests/QtWebEngine/web_engine_initialize.py3
-rw-r--r--sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/action_clear.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/add_action_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/api2_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/application_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1002.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1006.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1048.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_1077.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_172.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_243.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_307.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_324.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_338.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_389.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_400.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_429.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_430.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_433.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_467.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_493.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_512.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_525.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_546.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_547.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_549.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_569.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_575.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_576.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_585.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_589.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_635.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_640.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_653.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_662.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_667.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_668.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_674.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_675.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_688.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_693.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_696.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_711.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_722.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_728.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_736.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_750.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_778.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_785.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_793.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_811.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_834.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_836.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_844.py4
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_854.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_860.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_862.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_871.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_879.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_919.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_921.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_941.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_964.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_967.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_972.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_979.py4
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_988.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/bug_998.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/customproxywidget_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/event_filter_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/grandparent_method_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/hashabletype_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/keep_reference_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/missing_symbols_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/paint_event_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/parent_method_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/private_mangle_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/python_properties_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qaction_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qapp_issue_585.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/qapp_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qapplication_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qbrush_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qcolormap_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qdynamic_signal.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qfontdialog_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qformlayout_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qimage_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qlabel_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qlayout_ref_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qlayout_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qlcdnumber_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qlistwidget_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qmainwindow_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qmenu_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qmenuadd_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qobject_mi_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qpen_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qpicture_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qpixmap_constructor.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qpushbutton_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qshortcut_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qsplitter_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qstyle_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtableview_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtabwidget_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtextedit_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtoolbar_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtoolbox_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtreeview_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtreewidget_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qvariant_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/qwidget_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/reference_count_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/signature_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/standardpixmap_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/test_module_template.py5
-rw-r--r--sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py3
-rw-r--r--sources/pyside6/tests/QtWidgets/wrong_return_test.py3
-rw-r--r--sources/pyside6/tests/QtXml/qdomdocument_test.py3
-rw-r--r--sources/pyside6/tests/mac/qmacstyle_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/all_modules_load_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/bug_1016.py3
-rw-r--r--sources/pyside6/tests/pysidetest/constructor_properties_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/decoratedslot_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/embedding_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/enum_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/iterable_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/list_signal_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/modelview_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/new_inherited_functions_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/notify_id.py3
-rw-r--r--sources/pyside6/tests/pysidetest/properties_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/property_python_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/qvariant_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/repr_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/signal_slot_warning.py3
-rw-r--r--sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/signalandnamespace_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/typedef_signal_test.py3
-rw-r--r--sources/pyside6/tests/pysidetest/version_test.py3
-rw-r--r--sources/pyside6/tests/registry/existence_test.py3
-rw-r--r--sources/pyside6/tests/signals/args_dont_match_test.py3
-rw-r--r--sources/pyside6/tests/signals/bug_189.py3
-rw-r--r--sources/pyside6/tests/signals/bug_311.py3
-rw-r--r--sources/pyside6/tests/signals/bug_312.py3
-rw-r--r--sources/pyside6/tests/signals/bug_319.py3
-rw-r--r--sources/pyside6/tests/signals/bug_79.py3
-rw-r--r--sources/pyside6/tests/signals/decorators_test.py3
-rw-r--r--sources/pyside6/tests/signals/disconnect_test.py3
-rw-r--r--sources/pyside6/tests/signals/invalid_callback_test.py3
-rw-r--r--sources/pyside6/tests/signals/lambda_gui_test.py3
-rw-r--r--sources/pyside6/tests/signals/lambda_test.py3
-rw-r--r--sources/pyside6/tests/signals/leaking_signal_test.py3
-rw-r--r--sources/pyside6/tests/signals/multiple_connections_gui_test.py3
-rw-r--r--sources/pyside6/tests/signals/multiple_connections_test.py3
-rw-r--r--sources/pyside6/tests/signals/pysignal_test.py3
-rw-r--r--sources/pyside6/tests/signals/qobject_destroyed_test.py3
-rw-r--r--sources/pyside6/tests/signals/qobject_receivers_test.py3
-rw-r--r--sources/pyside6/tests/signals/qobject_sender_test.py3
-rw-r--r--sources/pyside6/tests/signals/ref01_test.py3
-rw-r--r--sources/pyside6/tests/signals/ref02_test.py3
-rw-r--r--sources/pyside6/tests/signals/ref03_test.py3
-rw-r--r--sources/pyside6/tests/signals/ref04_test.py3
-rw-r--r--sources/pyside6/tests/signals/ref05_test.py3
-rw-r--r--sources/pyside6/tests/signals/ref06_test.py3
-rw-r--r--sources/pyside6/tests/signals/segfault_proxyparent_test.py3
-rw-r--r--sources/pyside6/tests/signals/self_connect_test.py3
-rw-r--r--sources/pyside6/tests/signals/short_circuit_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal2signal_connect_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_across_threads.py3
-rw-r--r--sources/pyside6/tests/signals/signal_autoconnect_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_connectiontype_support_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_emission_gui_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_emission_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_enum_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_func_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_manager_refcount_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_number_limit_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_object_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_signature_test.py3
-rw-r--r--sources/pyside6/tests/signals/signal_with_primitive_type_test.py3
-rw-r--r--sources/pyside6/tests/signals/slot_reference_count_test.py3
-rw-r--r--sources/pyside6/tests/signals/static_metaobject_test.py3
-rw-r--r--sources/pyside6/tests/support/voidptr_test.py3
463 files changed, 948 insertions, 487 deletions
diff --git a/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py b/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py
index 54b7e6e84..23940df71 100644
--- a/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py
+++ b/sources/pyside6/tests/Qt3DExtras/qt3dextras_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCharts/qcharts_test.py b/sources/pyside6/tests/QtCharts/qcharts_test.py
index 7ce355f75..c3e1ce805 100644
--- a/sources/pyside6/tests/QtCharts/qcharts_test.py
+++ b/sources/pyside6/tests/QtCharts/qcharts_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/attr_cache_py3k.py b/sources/pyside6/tests/QtCore/attr_cache_py3k.py
index e2046ee3d..4044b5f64 100644
--- a/sources/pyside6/tests/QtCore/attr_cache_py3k.py
+++ b/sources/pyside6/tests/QtCore/attr_cache_py3k.py
@@ -49,8 +49,9 @@ 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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtCore/blocking_signals_test.py b/sources/pyside6/tests/QtCore/blocking_signals_test.py
index 6ab5ba0cc..87d0701b8 100644
--- a/sources/pyside6/tests/QtCore/blocking_signals_test.py
+++ b/sources/pyside6/tests/QtCore/blocking_signals_test.py
@@ -33,7 +33,8 @@ import sys
from tempfile import mkstemp
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_1019.py b/sources/pyside6/tests/QtCore/bug_1019.py
index 14eff4155..349ccb2cb 100644
--- a/sources/pyside6/tests/QtCore/bug_1019.py
+++ b/sources/pyside6/tests/QtCore/bug_1019.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_1063.py b/sources/pyside6/tests/QtCore/bug_1063.py
index 9151c962c..8ccd9a593 100644
--- a/sources/pyside6/tests/QtCore/bug_1063.py
+++ b/sources/pyside6/tests/QtCore/bug_1063.py
@@ -33,7 +33,8 @@ import sys
import tempfile
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_1069.py b/sources/pyside6/tests/QtCore/bug_1069.py
index dd1bf2078..a62ff5530 100644
--- a/sources/pyside6/tests/QtCore/bug_1069.py
+++ b/sources/pyside6/tests/QtCore/bug_1069.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_1313.py b/sources/pyside6/tests/QtCore/bug_1313.py
index fd33495b2..01a76f5c9 100644
--- a/sources/pyside6/tests/QtCore/bug_1313.py
+++ b/sources/pyside6/tests/QtCore/bug_1313.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_278_test.py b/sources/pyside6/tests/QtCore/bug_278_test.py
index 50e0089fe..aadaaf4d9 100644
--- a/sources/pyside6/tests/QtCore/bug_278_test.py
+++ b/sources/pyside6/tests/QtCore/bug_278_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_332.py b/sources/pyside6/tests/QtCore/bug_332.py
index 11f8ad7b7..7d7be4d05 100644
--- a/sources/pyside6/tests/QtCore/bug_332.py
+++ b/sources/pyside6/tests/QtCore/bug_332.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_408.py b/sources/pyside6/tests/QtCore/bug_408.py
index d9809d216..96e1614e9 100644
--- a/sources/pyside6/tests/QtCore/bug_408.py
+++ b/sources/pyside6/tests/QtCore/bug_408.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_428.py b/sources/pyside6/tests/QtCore/bug_428.py
index 338e26d9b..da065c6de 100644
--- a/sources/pyside6/tests/QtCore/bug_428.py
+++ b/sources/pyside6/tests/QtCore/bug_428.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_462.py b/sources/pyside6/tests/QtCore/bug_462.py
index a267b2b02..da048c0fb 100644
--- a/sources/pyside6/tests/QtCore/bug_462.py
+++ b/sources/pyside6/tests/QtCore/bug_462.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_505.py b/sources/pyside6/tests/QtCore/bug_505.py
index b1e7a2101..5b3fba93d 100644
--- a/sources/pyside6/tests/QtCore/bug_505.py
+++ b/sources/pyside6/tests/QtCore/bug_505.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_515.py b/sources/pyside6/tests/QtCore/bug_515.py
index 8dd79c310..5a5264486 100644
--- a/sources/pyside6/tests/QtCore/bug_515.py
+++ b/sources/pyside6/tests/QtCore/bug_515.py
@@ -32,8 +32,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtCore/bug_606.py b/sources/pyside6/tests/QtCore/bug_606.py
index 12ae76901..abe4ab2ca 100644
--- a/sources/pyside6/tests/QtCore/bug_606.py
+++ b/sources/pyside6/tests/QtCore/bug_606.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_656.py b/sources/pyside6/tests/QtCore/bug_656.py
index 855c32291..b047875c2 100644
--- a/sources/pyside6/tests/QtCore/bug_656.py
+++ b/sources/pyside6/tests/QtCore/bug_656.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtCore/bug_686.py b/sources/pyside6/tests/QtCore/bug_686.py
index 7c36ceb95..d6394bb90 100644
--- a/sources/pyside6/tests/QtCore/bug_686.py
+++ b/sources/pyside6/tests/QtCore/bug_686.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_699.py b/sources/pyside6/tests/QtCore/bug_699.py
index 3185a17e2..fcba92def 100644
--- a/sources/pyside6/tests/QtCore/bug_699.py
+++ b/sources/pyside6/tests/QtCore/bug_699.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_706.py b/sources/pyside6/tests/QtCore/bug_706.py
index e9c03b541..47b25b641 100644
--- a/sources/pyside6/tests/QtCore/bug_706.py
+++ b/sources/pyside6/tests/QtCore/bug_706.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_820.py b/sources/pyside6/tests/QtCore/bug_820.py
index fd7ca27d8..501dd9ce1 100644
--- a/sources/pyside6/tests/QtCore/bug_820.py
+++ b/sources/pyside6/tests/QtCore/bug_820.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_826.py b/sources/pyside6/tests/QtCore/bug_826.py
index 79c9611cc..2b16c8288 100644
--- a/sources/pyside6/tests/QtCore/bug_826.py
+++ b/sources/pyside6/tests/QtCore/bug_826.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_829.py b/sources/pyside6/tests/QtCore/bug_829.py
index 2612331c6..54f461850 100644
--- a/sources/pyside6/tests/QtCore/bug_829.py
+++ b/sources/pyside6/tests/QtCore/bug_829.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_835.py b/sources/pyside6/tests/QtCore/bug_835.py
index ddcf8af17..e546cccea 100644
--- a/sources/pyside6/tests/QtCore/bug_835.py
+++ b/sources/pyside6/tests/QtCore/bug_835.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_920.py b/sources/pyside6/tests/QtCore/bug_920.py
index c4fade929..7caea3810 100644
--- a/sources/pyside6/tests/QtCore/bug_920.py
+++ b/sources/pyside6/tests/QtCore/bug_920.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_927.py b/sources/pyside6/tests/QtCore/bug_927.py
index 15dccf92d..80f332979 100644
--- a/sources/pyside6/tests/QtCore/bug_927.py
+++ b/sources/pyside6/tests/QtCore/bug_927.py
@@ -31,7 +31,8 @@ import sys
import time
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_931.py b/sources/pyside6/tests/QtCore/bug_931.py
index 0a5342ab3..1dcde427f 100644
--- a/sources/pyside6/tests/QtCore/bug_931.py
+++ b/sources/pyside6/tests/QtCore/bug_931.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_938.py b/sources/pyside6/tests/QtCore/bug_938.py
index 8b318ec12..2566efada 100644
--- a/sources/pyside6/tests/QtCore/bug_938.py
+++ b/sources/pyside6/tests/QtCore/bug_938.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_953.py b/sources/pyside6/tests/QtCore/bug_953.py
index 53979c24e..d13c219cd 100644
--- a/sources/pyside6/tests/QtCore/bug_953.py
+++ b/sources/pyside6/tests/QtCore/bug_953.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtCore/bug_987.py b/sources/pyside6/tests/QtCore/bug_987.py
index 04ba1a7b5..d5a2bcd33 100644
--- a/sources/pyside6/tests/QtCore/bug_987.py
+++ b/sources/pyside6/tests/QtCore/bug_987.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_994.py b/sources/pyside6/tests/QtCore/bug_994.py
index 6caed7fc2..1e1e137d8 100644
--- a/sources/pyside6/tests/QtCore/bug_994.py
+++ b/sources/pyside6/tests/QtCore/bug_994.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
index 29097c6d2..bab09033d 100644
--- a/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-164.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py b/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py
index 11a49649c..a64be8e05 100644
--- a/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py
+++ b/sources/pyside6/tests/QtCore/bug_PYSIDE-42.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/child_event_test.py b/sources/pyside6/tests/QtCore/child_event_test.py
index 47e437f6b..1172f6027 100644
--- a/sources/pyside6/tests/QtCore/child_event_test.py
+++ b/sources/pyside6/tests/QtCore/child_event_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/classinfo_test.py b/sources/pyside6/tests/QtCore/classinfo_test.py
index 405efb3c9..e6a0a9256 100644
--- a/sources/pyside6/tests/QtCore/classinfo_test.py
+++ b/sources/pyside6/tests/QtCore/classinfo_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/deepcopy_test.py b/sources/pyside6/tests/QtCore/deepcopy_test.py
index 779a64549..711b023a9 100644
--- a/sources/pyside6/tests/QtCore/deepcopy_test.py
+++ b/sources/pyside6/tests/QtCore/deepcopy_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/deletelater_test.py b/sources/pyside6/tests/QtCore/deletelater_test.py
index fa48d6e0b..1d8dff895 100644
--- a/sources/pyside6/tests/QtCore/deletelater_test.py
+++ b/sources/pyside6/tests/QtCore/deletelater_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/destroysignal_test.py b/sources/pyside6/tests/QtCore/destroysignal_test.py
index 825a4e372..fe91d5340 100644
--- a/sources/pyside6/tests/QtCore/destroysignal_test.py
+++ b/sources/pyside6/tests/QtCore/destroysignal_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/duck_punching_test.py b/sources/pyside6/tests/QtCore/duck_punching_test.py
index 40246f9fd..2dc67b509 100644
--- a/sources/pyside6/tests/QtCore/duck_punching_test.py
+++ b/sources/pyside6/tests/QtCore/duck_punching_test.py
@@ -35,7 +35,8 @@ import sys
import types
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/emoji_string_test.py b/sources/pyside6/tests/QtCore/emoji_string_test.py
index 2a4209086..553864088 100644
--- a/sources/pyside6/tests/QtCore/emoji_string_test.py
+++ b/sources/pyside6/tests/QtCore/emoji_string_test.py
@@ -53,8 +53,9 @@ 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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
index 0e55c2e49..bbad67a77 100644
--- a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
+++ b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/hash_test.py b/sources/pyside6/tests/QtCore/hash_test.py
index 917bcb43d..71fb9cde9 100644
--- a/sources/pyside6/tests/QtCore/hash_test.py
+++ b/sources/pyside6/tests/QtCore/hash_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/inherits_test.py b/sources/pyside6/tests/QtCore/inherits_test.py
index c9a76e679..a176cbd44 100644
--- a/sources/pyside6/tests/QtCore/inherits_test.py
+++ b/sources/pyside6/tests/QtCore/inherits_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/max_signals.py b/sources/pyside6/tests/QtCore/max_signals.py
index 349b62925..2122aa738 100644
--- a/sources/pyside6/tests/QtCore/max_signals.py
+++ b/sources/pyside6/tests/QtCore/max_signals.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/missing_symbols_test.py b/sources/pyside6/tests/QtCore/missing_symbols_test.py
index 18456529b..a0ad4749c 100644
--- a/sources/pyside6/tests/QtCore/missing_symbols_test.py
+++ b/sources/pyside6/tests/QtCore/missing_symbols_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/mockclass_test.py b/sources/pyside6/tests/QtCore/mockclass_test.py
index c759fd0c3..51d980e74 100644
--- a/sources/pyside6/tests/QtCore/mockclass_test.py
+++ b/sources/pyside6/tests/QtCore/mockclass_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/multiple_feature_test.py b/sources/pyside6/tests/QtCore/multiple_feature_test.py
index 267b4a6cd..0f25e2f5c 100644
--- a/sources/pyside6/tests/QtCore/multiple_feature_test.py
+++ b/sources/pyside6/tests/QtCore/multiple_feature_test.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/python_conversion.py b/sources/pyside6/tests/QtCore/python_conversion.py
index f34637cce..451a54bac 100644
--- a/sources/pyside6/tests/QtCore/python_conversion.py
+++ b/sources/pyside6/tests/QtCore/python_conversion.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qabs_test.py b/sources/pyside6/tests/QtCore/qabs_test.py
index 71a3426af..a711ba9fb 100644
--- a/sources/pyside6/tests/QtCore/qabs_test.py
+++ b/sources/pyside6/tests/QtCore/qabs_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py b/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py
index 918bb7842..71d72b10e 100644
--- a/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py
+++ b/sources/pyside6/tests/QtCore/qabstractitemmodel_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qanimationgroup_test.py b/sources/pyside6/tests/QtCore/qanimationgroup_test.py
index 9e8b50a93..6c07113e0 100644
--- a/sources/pyside6/tests/QtCore/qanimationgroup_test.py
+++ b/sources/pyside6/tests/QtCore/qanimationgroup_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qbitarray_test.py b/sources/pyside6/tests/QtCore/qbitarray_test.py
index 2db36f48d..1fee4f69c 100644
--- a/sources/pyside6/tests/QtCore/qbitarray_test.py
+++ b/sources/pyside6/tests/QtCore/qbitarray_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py b/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py
index 086835868..dcc3a059b 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_concatenation_operator_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py b/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py
index f31e10cb5..a65f76775 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_operator_iadd_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qbytearray_operator_test.py b/sources/pyside6/tests/QtCore/qbytearray_operator_test.py
index 9303faf39..77678d199 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_operator_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_operator_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qbytearray_test.py b/sources/pyside6/tests/QtCore/qbytearray_test.py
index 62c8e6839..69e608d98 100644
--- a/sources/pyside6/tests/QtCore/qbytearray_test.py
+++ b/sources/pyside6/tests/QtCore/qbytearray_test.py
@@ -37,7 +37,8 @@ import pickle
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qcalendar_test.py b/sources/pyside6/tests/QtCore/qcalendar_test.py
index e589e7973..0f9bfaf56 100644
--- a/sources/pyside6/tests/QtCore/qcalendar_test.py
+++ b/sources/pyside6/tests/QtCore/qcalendar_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qcbor_test.py b/sources/pyside6/tests/QtCore/qcbor_test.py
index aa54eb231..06ba2d4d1 100644
--- a/sources/pyside6/tests/QtCore/qcbor_test.py
+++ b/sources/pyside6/tests/QtCore/qcbor_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qcollator_test.py b/sources/pyside6/tests/QtCore/qcollator_test.py
index cc212f175..b67b5ff2c 100644
--- a/sources/pyside6/tests/QtCore/qcollator_test.py
+++ b/sources/pyside6/tests/QtCore/qcollator_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qcommandlineparser_test.py b/sources/pyside6/tests/QtCore/qcommandlineparser_test.py
index 8dbdb7bfe..0c254f1d7 100644
--- a/sources/pyside6/tests/QtCore/qcommandlineparser_test.py
+++ b/sources/pyside6/tests/QtCore/qcommandlineparser_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py b/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py
index a9ae44857..f3f4bfd8c 100644
--- a/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py
+++ b/sources/pyside6/tests/QtCore/qcoreapplication_instance_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qcoreapplication_test.py b/sources/pyside6/tests/QtCore/qcoreapplication_test.py
index 014b60ce0..8809c2a8e 100644
--- a/sources/pyside6/tests/QtCore/qcoreapplication_test.py
+++ b/sources/pyside6/tests/QtCore/qcoreapplication_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qdatastream_test.py b/sources/pyside6/tests/QtCore/qdatastream_test.py
index 32af56499..fd1dcfd46 100644
--- a/sources/pyside6/tests/QtCore/qdatastream_test.py
+++ b/sources/pyside6/tests/QtCore/qdatastream_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qdate_test.py b/sources/pyside6/tests/QtCore/qdate_test.py
index bf8ca16b1..91f445e83 100644
--- a/sources/pyside6/tests/QtCore/qdate_test.py
+++ b/sources/pyside6/tests/QtCore/qdate_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qdatetime_test.py b/sources/pyside6/tests/QtCore/qdatetime_test.py
index 4f4bd3728..5342f40b0 100644
--- a/sources/pyside6/tests/QtCore/qdatetime_test.py
+++ b/sources/pyside6/tests/QtCore/qdatetime_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qeasingcurve_test.py b/sources/pyside6/tests/QtCore/qeasingcurve_test.py
index b27489c30..4966b207c 100644
--- a/sources/pyside6/tests/QtCore/qeasingcurve_test.py
+++ b/sources/pyside6/tests/QtCore/qeasingcurve_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qenum_test.py b/sources/pyside6/tests/QtCore/qenum_test.py
index 546e023c8..146773094 100644
--- a/sources/pyside6/tests/QtCore/qenum_test.py
+++ b/sources/pyside6/tests/QtCore/qenum_test.py
@@ -36,7 +36,8 @@ import sys
import pickle
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qevent_test.py b/sources/pyside6/tests/QtCore/qevent_test.py
index cdf8881c8..8251c5814 100644
--- a/sources/pyside6/tests/QtCore/qevent_test.py
+++ b/sources/pyside6/tests/QtCore/qevent_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qfile_test.py b/sources/pyside6/tests/QtCore/qfile_test.py
index a2885ffe6..d00ac72a7 100644
--- a/sources/pyside6/tests/QtCore/qfile_test.py
+++ b/sources/pyside6/tests/QtCore/qfile_test.py
@@ -31,7 +31,8 @@ import sys
import tempfile
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qfileinfo_test.py b/sources/pyside6/tests/QtCore/qfileinfo_test.py
index 756366e5d..3049a8fc1 100644
--- a/sources/pyside6/tests/QtCore/qfileinfo_test.py
+++ b/sources/pyside6/tests/QtCore/qfileinfo_test.py
@@ -31,7 +31,8 @@ import sys
import tempfile
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qfileread_test.py b/sources/pyside6/tests/QtCore/qfileread_test.py
index 04037b0cf..0e4e670e5 100644
--- a/sources/pyside6/tests/QtCore/qfileread_test.py
+++ b/sources/pyside6/tests/QtCore/qfileread_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qflags_test.py b/sources/pyside6/tests/QtCore/qflags_test.py
index f7bb5033f..4b368681f 100644
--- a/sources/pyside6/tests/QtCore/qflags_test.py
+++ b/sources/pyside6/tests/QtCore/qflags_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qhandle_test.py b/sources/pyside6/tests/QtCore/qhandle_test.py
index 54a364c66..08e53633c 100644
--- a/sources/pyside6/tests/QtCore/qhandle_test.py
+++ b/sources/pyside6/tests/QtCore/qhandle_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py b/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py
index 685a26485..ca6e5afba 100644
--- a/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py
+++ b/sources/pyside6/tests/QtCore/qinstallmsghandler_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qjsondocument_test.py b/sources/pyside6/tests/QtCore/qjsondocument_test.py
index bb80bed24..334ba07ec 100644
--- a/sources/pyside6/tests/QtCore/qjsondocument_test.py
+++ b/sources/pyside6/tests/QtCore/qjsondocument_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qlinef_test.py b/sources/pyside6/tests/QtCore/qlinef_test.py
index 3451ef333..663310716 100644
--- a/sources/pyside6/tests/QtCore/qlinef_test.py
+++ b/sources/pyside6/tests/QtCore/qlinef_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qlocale_test.py b/sources/pyside6/tests/QtCore/qlocale_test.py
index 33129a5de..d2ba4bf5e 100644
--- a/sources/pyside6/tests/QtCore/qlocale_test.py
+++ b/sources/pyside6/tests/QtCore/qlocale_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qlockfile_test.py b/sources/pyside6/tests/QtCore/qlockfile_test.py
index 52c517465..2508b3f7b 100644
--- a/sources/pyside6/tests/QtCore/qlockfile_test.py
+++ b/sources/pyside6/tests/QtCore/qlockfile_test.py
@@ -34,8 +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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py b/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py
index dfa1c3cf9..d312fe412 100644
--- a/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py
+++ b/sources/pyside6/tests/QtCore/qmessageauthenticationcode_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qmetaobject_test.py b/sources/pyside6/tests/QtCore/qmetaobject_test.py
index 6179b0d21..e4773afbb 100644
--- a/sources/pyside6/tests/QtCore/qmetaobject_test.py
+++ b/sources/pyside6/tests/QtCore/qmetaobject_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qmimedatabase_test.py b/sources/pyside6/tests/QtCore/qmimedatabase_test.py
index 98493a222..ee16142e0 100644
--- a/sources/pyside6/tests/QtCore/qmimedatabase_test.py
+++ b/sources/pyside6/tests/QtCore/qmimedatabase_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py b/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py
index bb29eea63..9e7febdf5 100644
--- a/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py
+++ b/sources/pyside6/tests/QtCore/qmodelindex_internalpointer_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py b/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py
index 426c38f21..f1d7fff1c 100644
--- a/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_children_segfault_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py b/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py
index 77954663a..714c47189 100644
--- a/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_connect_notify_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_destructor.py b/sources/pyside6/tests/QtCore/qobject_destructor.py
index da4f882ee..50f2ffc10 100644
--- a/sources/pyside6/tests/QtCore/qobject_destructor.py
+++ b/sources/pyside6/tests/QtCore/qobject_destructor.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_event_filter_test.py b/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
index a0900f795..112f21103 100644
--- a/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_event_filter_test.py
@@ -33,7 +33,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_inherits_test.py b/sources/pyside6/tests/QtCore/qobject_inherits_test.py
index c3a34e69e..0d0b0d174 100644
--- a/sources/pyside6/tests/QtCore/qobject_inherits_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_inherits_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py b/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py
index 1011e2400..ac86ed8d1 100644
--- a/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_objectproperty_test.py
@@ -37,7 +37,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_parent_test.py b/sources/pyside6/tests/QtCore/qobject_parent_test.py
index 2a599ff45..776d34461 100644
--- a/sources/pyside6/tests/QtCore/qobject_parent_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_parent_test.py
@@ -33,7 +33,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_property_test.py b/sources/pyside6/tests/QtCore/qobject_property_test.py
index 40d8bf9e5..7abe3ede0 100644
--- a/sources/pyside6/tests/QtCore/qobject_property_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_property_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py b/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py
index 9e9f56117..baa62ac1e 100644
--- a/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_protected_methods_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_test.py b/sources/pyside6/tests/QtCore/qobject_test.py
index 879888794..d452e828e 100644
--- a/sources/pyside6/tests/QtCore/qobject_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_timer_event_test.py b/sources/pyside6/tests/QtCore/qobject_timer_event_test.py
index c04093d2d..0ddf77c10 100644
--- a/sources/pyside6/tests/QtCore/qobject_timer_event_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_timer_event_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py b/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py
index 50a4329e3..4647a2c4b 100644
--- a/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py
+++ b/sources/pyside6/tests/QtCore/qobject_tr_as_instance_test.py
@@ -36,7 +36,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py b/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py
index 0e27e68d3..0b336ca01 100644
--- a/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py
+++ b/sources/pyside6/tests/QtCore/qoperatingsystemversion_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qpoint_test.py b/sources/pyside6/tests/QtCore/qpoint_test.py
index 343e21df4..49a4d8c25 100644
--- a/sources/pyside6/tests/QtCore/qpoint_test.py
+++ b/sources/pyside6/tests/QtCore/qpoint_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qprocess_test.py b/sources/pyside6/tests/QtCore/qprocess_test.py
index 06ca4b7ac..691e2befc 100644
--- a/sources/pyside6/tests/QtCore/qprocess_test.py
+++ b/sources/pyside6/tests/QtCore/qprocess_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qproperty_decorator.py b/sources/pyside6/tests/QtCore/qproperty_decorator.py
index 557e91dcc..021bbed56 100644
--- a/sources/pyside6/tests/QtCore/qproperty_decorator.py
+++ b/sources/pyside6/tests/QtCore/qproperty_decorator.py
@@ -31,7 +31,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qrandomgenerator_test.py b/sources/pyside6/tests/QtCore/qrandomgenerator_test.py
index ee7e9a5d9..fc1c7b872 100644
--- a/sources/pyside6/tests/QtCore/qrandomgenerator_test.py
+++ b/sources/pyside6/tests/QtCore/qrandomgenerator_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qrect_test.py b/sources/pyside6/tests/QtCore/qrect_test.py
index f73ae39cc..8420f0246 100644
--- a/sources/pyside6/tests/QtCore/qrect_test.py
+++ b/sources/pyside6/tests/QtCore/qrect_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qregularexpression_test.py b/sources/pyside6/tests/QtCore/qregularexpression_test.py
index 3abdb84ca..457ff7460 100644
--- a/sources/pyside6/tests/QtCore/qregularexpression_test.py
+++ b/sources/pyside6/tests/QtCore/qregularexpression_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qresource_test.py b/sources/pyside6/tests/QtCore/qresource_test.py
index d8d3ff76b..40d90c65c 100644
--- a/sources/pyside6/tests/QtCore/qresource_test.py
+++ b/sources/pyside6/tests/QtCore/qresource_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qsettings_test.py b/sources/pyside6/tests/QtCore/qsettings_test.py
index 466d7d33b..00eec2679 100644
--- a/sources/pyside6/tests/QtCore/qsettings_test.py
+++ b/sources/pyside6/tests/QtCore/qsettings_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qsize_test.py b/sources/pyside6/tests/QtCore/qsize_test.py
index 3767c47f4..2429352c9 100644
--- a/sources/pyside6/tests/QtCore/qsize_test.py
+++ b/sources/pyside6/tests/QtCore/qsize_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qslot_object_test.py b/sources/pyside6/tests/QtCore/qslot_object_test.py
index 4ece2116f..56cd462ee 100644
--- a/sources/pyside6/tests/QtCore/qslot_object_test.py
+++ b/sources/pyside6/tests/QtCore/qslot_object_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
from PySide6 import QtCore
diff --git a/sources/pyside6/tests/QtCore/qsocketnotifier_test.py b/sources/pyside6/tests/QtCore/qsocketnotifier_test.py
index 2414e1d13..b348d5aa7 100644
--- a/sources/pyside6/tests/QtCore/qsocketnotifier_test.py
+++ b/sources/pyside6/tests/QtCore/qsocketnotifier_test.py
@@ -35,7 +35,8 @@ import socket
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qsrand_test.py b/sources/pyside6/tests/QtCore/qsrand_test.py
index c97036831..4db29e24f 100644
--- a/sources/pyside6/tests/QtCore/qsrand_test.py
+++ b/sources/pyside6/tests/QtCore/qsrand_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qstandardpaths_test.py b/sources/pyside6/tests/QtCore/qstandardpaths_test.py
index 0def7f451..0e5e7358d 100644
--- a/sources/pyside6/tests/QtCore/qstandardpaths_test.py
+++ b/sources/pyside6/tests/QtCore/qstandardpaths_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qstorageinfo_test.py b/sources/pyside6/tests/QtCore/qstorageinfo_test.py
index 8dd1da73d..b86b85c1c 100644
--- a/sources/pyside6/tests/QtCore/qstorageinfo_test.py
+++ b/sources/pyside6/tests/QtCore/qstorageinfo_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qstring_test.py b/sources/pyside6/tests/QtCore/qstring_test.py
index 86f55649f..a07a559a3 100644
--- a/sources/pyside6/tests/QtCore/qstring_test.py
+++ b/sources/pyside6/tests/QtCore/qstring_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qsysinfo_test.py b/sources/pyside6/tests/QtCore/qsysinfo_test.py
index 31c6f04a4..90e241775 100644
--- a/sources/pyside6/tests/QtCore/qsysinfo_test.py
+++ b/sources/pyside6/tests/QtCore/qsysinfo_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qtextstream_test.py b/sources/pyside6/tests/QtCore/qtextstream_test.py
index 1a60f8535..b48f716bc 100644
--- a/sources/pyside6/tests/QtCore/qtextstream_test.py
+++ b/sources/pyside6/tests/QtCore/qtextstream_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py b/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py
index c055794f8..05ea4da04 100644
--- a/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py
+++ b/sources/pyside6/tests/QtCore/qthread_prod_cons_test.py
@@ -36,7 +36,8 @@ from random import random
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qthread_signal_test.py b/sources/pyside6/tests/QtCore/qthread_signal_test.py
index de795d740..c50ec0101 100644
--- a/sources/pyside6/tests/QtCore/qthread_signal_test.py
+++ b/sources/pyside6/tests/QtCore/qthread_signal_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qthread_test.py b/sources/pyside6/tests/QtCore/qthread_test.py
index 951c89819..e3f7c7f19 100644
--- a/sources/pyside6/tests/QtCore/qthread_test.py
+++ b/sources/pyside6/tests/QtCore/qthread_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py b/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py
index 891e37a65..7119ccd40 100644
--- a/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py
+++ b/sources/pyside6/tests/QtCore/qtimer_singleshot_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qtimer_timeout_test.py b/sources/pyside6/tests/QtCore/qtimer_timeout_test.py
index 048555dd7..255ef9d25 100644
--- a/sources/pyside6/tests/QtCore/qtimer_timeout_test.py
+++ b/sources/pyside6/tests/QtCore/qtimer_timeout_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qtimezone_test.py b/sources/pyside6/tests/QtCore/qtimezone_test.py
index 0a0ec99a9..d143d0c94 100644
--- a/sources/pyside6/tests/QtCore/qtimezone_test.py
+++ b/sources/pyside6/tests/QtCore/qtimezone_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qtnamespace_test.py b/sources/pyside6/tests/QtCore/qtnamespace_test.py
index 06287cb09..7244fd89e 100644
--- a/sources/pyside6/tests/QtCore/qtnamespace_test.py
+++ b/sources/pyside6/tests/QtCore/qtnamespace_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qurl_test.py b/sources/pyside6/tests/QtCore/qurl_test.py
index 91924e7db..75f74fbbc 100644
--- a/sources/pyside6/tests/QtCore/qurl_test.py
+++ b/sources/pyside6/tests/QtCore/qurl_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qurlquery_test.py b/sources/pyside6/tests/QtCore/qurlquery_test.py
index 698912630..4e2a8fc14 100644
--- a/sources/pyside6/tests/QtCore/qurlquery_test.py
+++ b/sources/pyside6/tests/QtCore/qurlquery_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/quuid_test.py b/sources/pyside6/tests/QtCore/quuid_test.py
index 8e02687e0..215ab68e8 100644
--- a/sources/pyside6/tests/QtCore/quuid_test.py
+++ b/sources/pyside6/tests/QtCore/quuid_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/qversionnumber_test.py b/sources/pyside6/tests/QtCore/qversionnumber_test.py
index 3621bb69d..d08a64d25 100644
--- a/sources/pyside6/tests/QtCore/qversionnumber_test.py
+++ b/sources/pyside6/tests/QtCore/qversionnumber_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/repr_test.py b/sources/pyside6/tests/QtCore/repr_test.py
index 34797de0a..72a5e3a9a 100644
--- a/sources/pyside6/tests/QtCore/repr_test.py
+++ b/sources/pyside6/tests/QtCore/repr_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py b/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py
index a619a29ec..a5cded3ac 100644
--- a/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py
+++ b/sources/pyside6/tests/QtCore/setprop_on_ctor_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
index 5f9328329..ba58d52d1 100644
--- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
+++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/staticMetaObject_test.py b/sources/pyside6/tests/QtCore/staticMetaObject_test.py
index 617fb639b..29ab9a358 100644
--- a/sources/pyside6/tests/QtCore/staticMetaObject_test.py
+++ b/sources/pyside6/tests/QtCore/staticMetaObject_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/static_method_test.py b/sources/pyside6/tests/QtCore/static_method_test.py
index 6233f1cc3..c395f3770 100644
--- a/sources/pyside6/tests/QtCore/static_method_test.py
+++ b/sources/pyside6/tests/QtCore/static_method_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/thread_signals_test.py b/sources/pyside6/tests/QtCore/thread_signals_test.py
index 76ebc09da..21e4d7043 100644
--- a/sources/pyside6/tests/QtCore/thread_signals_test.py
+++ b/sources/pyside6/tests/QtCore/thread_signals_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/tr_noop_test.py b/sources/pyside6/tests/QtCore/tr_noop_test.py
index 7a3cd8dc3..5743c94a3 100644
--- a/sources/pyside6/tests/QtCore/tr_noop_test.py
+++ b/sources/pyside6/tests/QtCore/tr_noop_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/translation_test.py b/sources/pyside6/tests/QtCore/translation_test.py
index b5473694e..28e618534 100644
--- a/sources/pyside6/tests/QtCore/translation_test.py
+++ b/sources/pyside6/tests/QtCore/translation_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/unaryoperator_test.py b/sources/pyside6/tests/QtCore/unaryoperator_test.py
index ad0e4a94e..fada917ee 100644
--- a/sources/pyside6/tests/QtCore/unaryoperator_test.py
+++ b/sources/pyside6/tests/QtCore/unaryoperator_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/unicode_test.py b/sources/pyside6/tests/QtCore/unicode_test.py
index ba59d0dd3..1d3a729fa 100644
--- a/sources/pyside6/tests/QtCore/unicode_test.py
+++ b/sources/pyside6/tests/QtCore/unicode_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtCore/versioninfo_test.py b/sources/pyside6/tests/QtCore/versioninfo_test.py
index 89020953e..9a31dfc00 100644
--- a/sources/pyside6/tests/QtCore/versioninfo_test.py
+++ b/sources/pyside6/tests/QtCore/versioninfo_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py b/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py
index 5e2be8d1e..3497ae676 100644
--- a/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py
+++ b/sources/pyside6/tests/QtDataVisualization/datavisualization_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_1091.py b/sources/pyside6/tests/QtGui/bug_1091.py
index 78645589b..22788fea0 100644
--- a/sources/pyside6/tests/QtGui/bug_1091.py
+++ b/sources/pyside6/tests/QtGui/bug_1091.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_300_test.py b/sources/pyside6/tests/QtGui/bug_300_test.py
index 8f734780f..8d944840c 100644
--- a/sources/pyside6/tests/QtGui/bug_300_test.py
+++ b/sources/pyside6/tests/QtGui/bug_300_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_367.py b/sources/pyside6/tests/QtGui/bug_367.py
index 07b229d51..0fd676d8b 100644
--- a/sources/pyside6/tests/QtGui/bug_367.py
+++ b/sources/pyside6/tests/QtGui/bug_367.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_480.py b/sources/pyside6/tests/QtGui/bug_480.py
index bedf1ae07..a7c863ba6 100644
--- a/sources/pyside6/tests/QtGui/bug_480.py
+++ b/sources/pyside6/tests/QtGui/bug_480.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_606.py b/sources/pyside6/tests/QtGui/bug_606.py
index 332798a14..918960612 100644
--- a/sources/pyside6/tests/QtGui/bug_606.py
+++ b/sources/pyside6/tests/QtGui/bug_606.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_617.py b/sources/pyside6/tests/QtGui/bug_617.py
index 3c8786cea..008ab488f 100644
--- a/sources/pyside6/tests/QtGui/bug_617.py
+++ b/sources/pyside6/tests/QtGui/bug_617.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_652.py b/sources/pyside6/tests/QtGui/bug_652.py
index c70055b3b..50aa7e7c7 100644
--- a/sources/pyside6/tests/QtGui/bug_652.py
+++ b/sources/pyside6/tests/QtGui/bug_652.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_660.py b/sources/pyside6/tests/QtGui/bug_660.py
index e625f2981..9fb2cd6db 100644
--- a/sources/pyside6/tests/QtGui/bug_660.py
+++ b/sources/pyside6/tests/QtGui/bug_660.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_716.py b/sources/pyside6/tests/QtGui/bug_716.py
index f49b909fa..cb30ff42e 100644
--- a/sources/pyside6/tests/QtGui/bug_716.py
+++ b/sources/pyside6/tests/QtGui/bug_716.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtGui/bug_740.py b/sources/pyside6/tests/QtGui/bug_740.py
index 1d32fe5bd..91aa23c86 100644
--- a/sources/pyside6/tests/QtGui/bug_740.py
+++ b/sources/pyside6/tests/QtGui/bug_740.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_743.py b/sources/pyside6/tests/QtGui/bug_743.py
index ce2664a6e..e74b32ba3 100644
--- a/sources/pyside6/tests/QtGui/bug_743.py
+++ b/sources/pyside6/tests/QtGui/bug_743.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_991.py b/sources/pyside6/tests/QtGui/bug_991.py
index 63a4a5760..4738f4f04 100644
--- a/sources/pyside6/tests/QtGui/bug_991.py
+++ b/sources/pyside6/tests/QtGui/bug_991.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py b/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py
index 7b571cfe2..ce937c9a9 100644
--- a/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py
+++ b/sources/pyside6/tests/QtGui/bug_PYSIDE-344.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/bug_PYSIDE-41.py b/sources/pyside6/tests/QtGui/bug_PYSIDE-41.py
index 46173b171..fff11779d 100644
--- a/sources/pyside6/tests/QtGui/bug_PYSIDE-41.py
+++ b/sources/pyside6/tests/QtGui/bug_PYSIDE-41.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/deepcopy_test.py b/sources/pyside6/tests/QtGui/deepcopy_test.py
index 8cffe2b3f..e1f0240b0 100644
--- a/sources/pyside6/tests/QtGui/deepcopy_test.py
+++ b/sources/pyside6/tests/QtGui/deepcopy_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py b/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py
index cc381c20a..2537bc5b2 100644
--- a/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py
+++ b/sources/pyside6/tests/QtGui/float_to_int_implicit_conversion_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/pyside_reload_test.py b/sources/pyside6/tests/QtGui/pyside_reload_test.py
index 75994f4e4..87d311596 100644
--- a/sources/pyside6/tests/QtGui/pyside_reload_test.py
+++ b/sources/pyside6/tests/QtGui/pyside_reload_test.py
@@ -33,7 +33,8 @@ import shutil
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qcolor_reduce_test.py b/sources/pyside6/tests/QtGui/qcolor_reduce_test.py
index a508dad50..ce855dba1 100644
--- a/sources/pyside6/tests/QtGui/qcolor_reduce_test.py
+++ b/sources/pyside6/tests/QtGui/qcolor_reduce_test.py
@@ -31,7 +31,8 @@ import pickle
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qcolor_test.py b/sources/pyside6/tests/QtGui/qcolor_test.py
index aef9c24e0..6eaaa94a9 100644
--- a/sources/pyside6/tests/QtGui/qcolor_test.py
+++ b/sources/pyside6/tests/QtGui/qcolor_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qcursor_test.py b/sources/pyside6/tests/QtGui/qcursor_test.py
index aede84498..fcab714a9 100644
--- a/sources/pyside6/tests/QtGui/qcursor_test.py
+++ b/sources/pyside6/tests/QtGui/qcursor_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py b/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py
index 9bcb03753..580d962c3 100644
--- a/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py
+++ b/sources/pyside6/tests/QtGui/qdatastream_gui_operators_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qdesktopservices_test.py b/sources/pyside6/tests/QtGui/qdesktopservices_test.py
index 089465c6c..fb635e142 100644
--- a/sources/pyside6/tests/QtGui/qdesktopservices_test.py
+++ b/sources/pyside6/tests/QtGui/qdesktopservices_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qfontmetrics_test.py b/sources/pyside6/tests/QtGui/qfontmetrics_test.py
index 3a3520003..44ae75a0d 100644
--- a/sources/pyside6/tests/QtGui/qfontmetrics_test.py
+++ b/sources/pyside6/tests/QtGui/qfontmetrics_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qguiapplication_test.py b/sources/pyside6/tests/QtGui/qguiapplication_test.py
index 68f7b8591..35b9574ea 100644
--- a/sources/pyside6/tests/QtGui/qguiapplication_test.py
+++ b/sources/pyside6/tests/QtGui/qguiapplication_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qicon_test.py b/sources/pyside6/tests/QtGui/qicon_test.py
index cb95d02db..24378b844 100644
--- a/sources/pyside6/tests/QtGui/qicon_test.py
+++ b/sources/pyside6/tests/QtGui/qicon_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qitemselection_test.py b/sources/pyside6/tests/QtGui/qitemselection_test.py
index 5c913fa08..157c1bacb 100644
--- a/sources/pyside6/tests/QtGui/qitemselection_test.py
+++ b/sources/pyside6/tests/QtGui/qitemselection_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qkeysequence_test.py b/sources/pyside6/tests/QtGui/qkeysequence_test.py
index 9c8097415..896447740 100644
--- a/sources/pyside6/tests/QtGui/qkeysequence_test.py
+++ b/sources/pyside6/tests/QtGui/qkeysequence_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qpainter_test.py b/sources/pyside6/tests/QtGui/qpainter_test.py
index 05af83d4f..3efb6df8b 100644
--- a/sources/pyside6/tests/QtGui/qpainter_test.py
+++ b/sources/pyside6/tests/QtGui/qpainter_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qpdfwriter_test.py b/sources/pyside6/tests/QtGui/qpdfwriter_test.py
index 6e567a48e..a58b9242e 100644
--- a/sources/pyside6/tests/QtGui/qpdfwriter_test.py
+++ b/sources/pyside6/tests/QtGui/qpdfwriter_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qpixelformat_test.py b/sources/pyside6/tests/QtGui/qpixelformat_test.py
index d9d98ade3..30241f50d 100644
--- a/sources/pyside6/tests/QtGui/qpixelformat_test.py
+++ b/sources/pyside6/tests/QtGui/qpixelformat_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qpixmap_test.py b/sources/pyside6/tests/QtGui/qpixmap_test.py
index aa8ade833..496bed5dc 100644
--- a/sources/pyside6/tests/QtGui/qpixmap_test.py
+++ b/sources/pyside6/tests/QtGui/qpixmap_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qpixmapcache_test.py b/sources/pyside6/tests/QtGui/qpixmapcache_test.py
index 19b5c99ee..3b45b1b91 100644
--- a/sources/pyside6/tests/QtGui/qpixmapcache_test.py
+++ b/sources/pyside6/tests/QtGui/qpixmapcache_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qpolygonf_test.py b/sources/pyside6/tests/QtGui/qpolygonf_test.py
index df2586b75..8a888d08a 100644
--- a/sources/pyside6/tests/QtGui/qpolygonf_test.py
+++ b/sources/pyside6/tests/QtGui/qpolygonf_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qradialgradient_test.py b/sources/pyside6/tests/QtGui/qradialgradient_test.py
index 92ed0e91c..61a9fc3ef 100644
--- a/sources/pyside6/tests/QtGui/qradialgradient_test.py
+++ b/sources/pyside6/tests/QtGui/qradialgradient_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qrasterwindow_test.py b/sources/pyside6/tests/QtGui/qrasterwindow_test.py
index 154c85b93..07d81c813 100644
--- a/sources/pyside6/tests/QtGui/qrasterwindow_test.py
+++ b/sources/pyside6/tests/QtGui/qrasterwindow_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qregion_test.py b/sources/pyside6/tests/QtGui/qregion_test.py
index b6614c9c1..bd843e162 100644
--- a/sources/pyside6/tests/QtGui/qregion_test.py
+++ b/sources/pyside6/tests/QtGui/qregion_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qstylehints_test.py b/sources/pyside6/tests/QtGui/qstylehints_test.py
index f1afc8f3f..b7b2e9471 100644
--- a/sources/pyside6/tests/QtGui/qstylehints_test.py
+++ b/sources/pyside6/tests/QtGui/qstylehints_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qtextdocument_functions.py b/sources/pyside6/tests/QtGui/qtextdocument_functions.py
index 45e74c3ec..c001c5da9 100644
--- a/sources/pyside6/tests/QtGui/qtextdocument_functions.py
+++ b/sources/pyside6/tests/QtGui/qtextdocument_functions.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py b/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py
index 03e0aa3b7..caeb0e7cc 100644
--- a/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py
+++ b/sources/pyside6/tests/QtGui/qtextdocument_undoredo_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py b/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py
index fdf2385aa..cf3721684 100644
--- a/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py
+++ b/sources/pyside6/tests/QtGui/qtextdocumentwriter_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qtextline_test.py b/sources/pyside6/tests/QtGui/qtextline_test.py
index 16e3794ce..58bd48620 100644
--- a/sources/pyside6/tests/QtGui/qtextline_test.py
+++ b/sources/pyside6/tests/QtGui/qtextline_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/qtransform_test.py b/sources/pyside6/tests/QtGui/qtransform_test.py
index c2d3b9b6c..8fcddf3ec 100644
--- a/sources/pyside6/tests/QtGui/qtransform_test.py
+++ b/sources/pyside6/tests/QtGui/qtransform_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/repr_test.py b/sources/pyside6/tests/QtGui/repr_test.py
index d7c4693e5..3b732ce77 100644
--- a/sources/pyside6/tests/QtGui/repr_test.py
+++ b/sources/pyside6/tests/QtGui/repr_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py b/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py
index 8646151b1..1290fed90 100644
--- a/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py
+++ b/sources/pyside6/tests/QtGui/timed_app_and_patching_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtHelp/help_test.py b/sources/pyside6/tests/QtHelp/help_test.py
index 809a77c2d..3cb6f51cb 100644
--- a/sources/pyside6/tests/QtHelp/help_test.py
+++ b/sources/pyside6/tests/QtHelp/help_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtHelp/helpsearchengine_test.py b/sources/pyside6/tests/QtHelp/helpsearchengine_test.py
index 0067f8f8c..ddde3d308 100644
--- a/sources/pyside6/tests/QtHelp/helpsearchengine_test.py
+++ b/sources/pyside6/tests/QtHelp/helpsearchengine_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtLocation/location.py b/sources/pyside6/tests/QtLocation/location.py
index 94d0ac552..03e5c1b24 100644
--- a/sources/pyside6/tests/QtLocation/location.py
+++ b/sources/pyside6/tests/QtLocation/location.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtMultimedia/audio_test.py b/sources/pyside6/tests/QtMultimedia/audio_test.py
index 0389c252c..6c9e44e57 100644
--- a/sources/pyside6/tests/QtMultimedia/audio_test.py
+++ b/sources/pyside6/tests/QtMultimedia/audio_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py b/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py
index 26350fa8d..ebdad6de7 100644
--- a/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py
+++ b/sources/pyside6/tests/QtMultimediaWidgets/qmultimediawidgets.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/accessManager_test.py b/sources/pyside6/tests/QtNetwork/accessManager_test.py
index ebc7a2ed8..cea54f8d3 100644
--- a/sources/pyside6/tests/QtNetwork/accessManager_test.py
+++ b/sources/pyside6/tests/QtNetwork/accessManager_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/bug_1084.py b/sources/pyside6/tests/QtNetwork/bug_1084.py
index 924c5a4f9..a4bdbd9e2 100644
--- a/sources/pyside6/tests/QtNetwork/bug_1084.py
+++ b/sources/pyside6/tests/QtNetwork/bug_1084.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/bug_446.py b/sources/pyside6/tests/QtNetwork/bug_446.py
index 0ad620c8c..d2f7fd28d 100644
--- a/sources/pyside6/tests/QtNetwork/bug_446.py
+++ b/sources/pyside6/tests/QtNetwork/bug_446.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/dnslookup_test.py b/sources/pyside6/tests/QtNetwork/dnslookup_test.py
index f5bcbe252..0f6664924 100644
--- a/sources/pyside6/tests/QtNetwork/dnslookup_test.py
+++ b/sources/pyside6/tests/QtNetwork/dnslookup_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/qipv6address_test.py b/sources/pyside6/tests/QtNetwork/qipv6address_test.py
index 9d2fa2244..b23122b92 100644
--- a/sources/pyside6/tests/QtNetwork/qipv6address_test.py
+++ b/sources/pyside6/tests/QtNetwork/qipv6address_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py b/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py
index d7d543c03..9a7611e42 100644
--- a/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py
+++ b/sources/pyside6/tests/QtNetwork/qpassworddigestor_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/tcpserver_test.py b/sources/pyside6/tests/QtNetwork/tcpserver_test.py
index 4f9f43143..d19274e13 100644
--- a/sources/pyside6/tests/QtNetwork/tcpserver_test.py
+++ b/sources/pyside6/tests/QtNetwork/tcpserver_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtNetwork/udpsocket_test.py b/sources/pyside6/tests/QtNetwork/udpsocket_test.py
index 843aef5e6..73fcbd7fa 100644
--- a/sources/pyside6/tests/QtNetwork/udpsocket_test.py
+++ b/sources/pyside6/tests/QtNetwork/udpsocket_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py b/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py
index 27df4d8dc..7567000c5 100644
--- a/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py
+++ b/sources/pyside6/tests/QtOpenGL/qopenglbuffer_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py b/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py
index 5f76d9f60..eae7e50ea 100644
--- a/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py
+++ b/sources/pyside6/tests/QtOpenGL/qopenglwindow_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtPositioning/positioning.py b/sources/pyside6/tests/QtPositioning/positioning.py
index 70480e61d..733aedbc6 100644
--- a/sources/pyside6/tests/QtPositioning/positioning.py
+++ b/sources/pyside6/tests/QtPositioning/positioning.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtPrintSupport/bug_500.py b/sources/pyside6/tests/QtPrintSupport/bug_500.py
index 5ddaaa848..4cf6014a5 100644
--- a/sources/pyside6/tests/QtPrintSupport/bug_500.py
+++ b/sources/pyside6/tests/QtPrintSupport/bug_500.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py b/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
index 5a50f2224..2cb62d614 100644
--- a/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
+++ b/sources/pyside6/tests/QtPrintSupport/returnquadruplesofnumbers_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_1029.py b/sources/pyside6/tests/QtQml/bug_1029.py
index a64614390..23dc8c26e 100644
--- a/sources/pyside6/tests/QtQml/bug_1029.py
+++ b/sources/pyside6/tests/QtQml/bug_1029.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_451.py b/sources/pyside6/tests/QtQml/bug_451.py
index f328b7bb8..9924ee854 100644
--- a/sources/pyside6/tests/QtQml/bug_451.py
+++ b/sources/pyside6/tests/QtQml/bug_451.py
@@ -37,7 +37,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_456.py b/sources/pyside6/tests/QtQml/bug_456.py
index 4c7019806..8a5c54478 100644
--- a/sources/pyside6/tests/QtQml/bug_456.py
+++ b/sources/pyside6/tests/QtQml/bug_456.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_557.py b/sources/pyside6/tests/QtQml/bug_557.py
index 21a445b72..88366a5bf 100644
--- a/sources/pyside6/tests/QtQml/bug_557.py
+++ b/sources/pyside6/tests/QtQml/bug_557.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_726.py b/sources/pyside6/tests/QtQml/bug_726.py
index 6c6a78a3b..9d1f9cd82 100644
--- a/sources/pyside6/tests/QtQml/bug_726.py
+++ b/sources/pyside6/tests/QtQml/bug_726.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_814.py b/sources/pyside6/tests/QtQml/bug_814.py
index 13c97154f..4c6b1f488 100644
--- a/sources/pyside6/tests/QtQml/bug_814.py
+++ b/sources/pyside6/tests/QtQml/bug_814.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_825.py b/sources/pyside6/tests/QtQml/bug_825.py
index 6ebdaf6d4..f3315c6ed 100644
--- a/sources/pyside6/tests/QtQml/bug_825.py
+++ b/sources/pyside6/tests/QtQml/bug_825.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_847.py b/sources/pyside6/tests/QtQml/bug_847.py
index 4054dc8a2..35acea051 100644
--- a/sources/pyside6/tests/QtQml/bug_847.py
+++ b/sources/pyside6/tests/QtQml/bug_847.py
@@ -38,7 +38,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_915.py b/sources/pyside6/tests/QtQml/bug_915.py
index d8707582e..7074a503c 100644
--- a/sources/pyside6/tests/QtQml/bug_915.py
+++ b/sources/pyside6/tests/QtQml/bug_915.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_926.py b/sources/pyside6/tests/QtQml/bug_926.py
index 837406b7a..63d2107c8 100644
--- a/sources/pyside6/tests/QtQml/bug_926.py
+++ b/sources/pyside6/tests/QtQml/bug_926.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_951.py b/sources/pyside6/tests/QtQml/bug_951.py
index 700c23ae9..59776c327 100644
--- a/sources/pyside6/tests/QtQml/bug_951.py
+++ b/sources/pyside6/tests/QtQml/bug_951.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_995.py b/sources/pyside6/tests/QtQml/bug_995.py
index 8cb9306ef..0f9a7449f 100644
--- a/sources/pyside6/tests/QtQml/bug_995.py
+++ b/sources/pyside6/tests/QtQml/bug_995.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/bug_997.py b/sources/pyside6/tests/QtQml/bug_997.py
index b5532ea90..a66db98bc 100644
--- a/sources/pyside6/tests/QtQml/bug_997.py
+++ b/sources/pyside6/tests/QtQml/bug_997.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/connect_python_qml.py b/sources/pyside6/tests/QtQml/connect_python_qml.py
index 305077ee7..47e0fdae0 100644
--- a/sources/pyside6/tests/QtQml/connect_python_qml.py
+++ b/sources/pyside6/tests/QtQml/connect_python_qml.py
@@ -37,7 +37,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/javascript_exceptions.py b/sources/pyside6/tests/QtQml/javascript_exceptions.py
index 49b15320c..fbf84fcf6 100644
--- a/sources/pyside6/tests/QtQml/javascript_exceptions.py
+++ b/sources/pyside6/tests/QtQml/javascript_exceptions.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/listproperty.py b/sources/pyside6/tests/QtQml/listproperty.py
index ed0705e47..17b9ecce5 100644
--- a/sources/pyside6/tests/QtQml/listproperty.py
+++ b/sources/pyside6/tests/QtQml/listproperty.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py b/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py
index d76af81b2..dee5601e6 100644
--- a/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py
+++ b/sources/pyside6/tests/QtQml/qqmlincubator_incubateWhile.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/qqmlnetwork_test.py b/sources/pyside6/tests/QtQml/qqmlnetwork_test.py
index 8a665a827..5f9b18d6d 100644
--- a/sources/pyside6/tests/QtQml/qqmlnetwork_test.py
+++ b/sources/pyside6/tests/QtQml/qqmlnetwork_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py b/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py
index e3a5a0699..0aae8e974 100644
--- a/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py
+++ b/sources/pyside6/tests/QtQml/qquickitem_grabToImage.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/qquickview_test.py b/sources/pyside6/tests/QtQml/qquickview_test.py
index cd983f26a..56d71cb5f 100644
--- a/sources/pyside6/tests/QtQml/qquickview_test.py
+++ b/sources/pyside6/tests/QtQml/qquickview_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/registersingletontype.py b/sources/pyside6/tests/QtQml/registersingletontype.py
index 0ac2162aa..72b5238d0 100644
--- a/sources/pyside6/tests/QtQml/registersingletontype.py
+++ b/sources/pyside6/tests/QtQml/registersingletontype.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/registertype.py b/sources/pyside6/tests/QtQml/registertype.py
index 76657b749..6d8ad47eb 100644
--- a/sources/pyside6/tests/QtQml/registertype.py
+++ b/sources/pyside6/tests/QtQml/registertype.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/registeruncreatabletype.py b/sources/pyside6/tests/QtQml/registeruncreatabletype.py
index 3c2435f52..06a18970a 100644
--- a/sources/pyside6/tests/QtQml/registeruncreatabletype.py
+++ b/sources/pyside6/tests/QtQml/registeruncreatabletype.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtQml/signal_arguments.py b/sources/pyside6/tests/QtQml/signal_arguments.py
index 41f0acc7e..65dedce45 100644
--- a/sources/pyside6/tests/QtQml/signal_arguments.py
+++ b/sources/pyside6/tests/QtQml/signal_arguments.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtScxml/test_dynamic.py b/sources/pyside6/tests/QtScxml/test_dynamic.py
index bf8739087..18f8c89c8 100644
--- a/sources/pyside6/tests/QtScxml/test_dynamic.py
+++ b/sources/pyside6/tests/QtScxml/test_dynamic.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSensors/sensors.py b/sources/pyside6/tests/QtSensors/sensors.py
index e9d6df8b7..101f7fa42 100644
--- a/sources/pyside6/tests/QtSensors/sensors.py
+++ b/sources/pyside6/tests/QtSensors/sensors.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSerialPort/serial.py b/sources/pyside6/tests/QtSerialPort/serial.py
index 84ad98af5..29799a03e 100644
--- a/sources/pyside6/tests/QtSerialPort/serial.py
+++ b/sources/pyside6/tests/QtSerialPort/serial.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSql/bug_1013.py b/sources/pyside6/tests/QtSql/bug_1013.py
index 5d0767938..b07baa033 100644
--- a/sources/pyside6/tests/QtSql/bug_1013.py
+++ b/sources/pyside6/tests/QtSql/bug_1013.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py b/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py
index c5a736e07..3123e027d 100644
--- a/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py
+++ b/sources/pyside6/tests/QtSql/qsqldatabaseandqueries_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSql/qvarianttype_test.py b/sources/pyside6/tests/QtSql/qvarianttype_test.py
index a15cc9504..6d44de451 100644
--- a/sources/pyside6/tests/QtSql/qvarianttype_test.py
+++ b/sources/pyside6/tests/QtSql/qvarianttype_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtStateMachine/bug_1031.py b/sources/pyside6/tests/QtStateMachine/bug_1031.py
index de623c419..7425a7208 100644
--- a/sources/pyside6/tests/QtStateMachine/bug_1031.py
+++ b/sources/pyside6/tests/QtStateMachine/bug_1031.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py b/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py
index e5f1bc7fb..fa833bda8 100644
--- a/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py
+++ b/sources/pyside6/tests/QtStateMachine/qabstracttransition_test.py
@@ -33,7 +33,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtStateMachine/qstate_test.py b/sources/pyside6/tests/QtStateMachine/qstate_test.py
index ab9fa1abd..9c3ce2ba4 100644
--- a/sources/pyside6/tests/QtStateMachine/qstate_test.py
+++ b/sources/pyside6/tests/QtStateMachine/qstate_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py b/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py
index 895b8f2cc..751743027 100644
--- a/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py
+++ b/sources/pyside6/tests/QtStateMachine/qstatemachine_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py b/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py
index 345ec40b9..529a51479 100644
--- a/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py
+++ b/sources/pyside6/tests/QtStateMachine/setprop_on_ctor_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSvg/qsvggenerator_test.py b/sources/pyside6/tests/QtSvg/qsvggenerator_test.py
index a5eeaf403..3553667a7 100644
--- a/sources/pyside6/tests/QtSvg/qsvggenerator_test.py
+++ b/sources/pyside6/tests/QtSvg/qsvggenerator_test.py
@@ -33,7 +33,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py b/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py
index 985db23fa..60ccbabfe 100644
--- a/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py
+++ b/sources/pyside6/tests/QtSvg/qsvgrenderer_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py b/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py
index 3d15e948c..ae8f756ea 100644
--- a/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py
+++ b/sources/pyside6/tests/QtSvgWidgets/qsvgwidget_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtTest/click_test.py b/sources/pyside6/tests/QtTest/click_test.py
index 2ee43156a..77ef0c772 100644
--- a/sources/pyside6/tests/QtTest/click_test.py
+++ b/sources/pyside6/tests/QtTest/click_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtTest/eventfilter_test.py b/sources/pyside6/tests/QtTest/eventfilter_test.py
index 4a5fc4cab..50c264e35 100644
--- a/sources/pyside6/tests/QtTest/eventfilter_test.py
+++ b/sources/pyside6/tests/QtTest/eventfilter_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtTest/qvalidator_test.py b/sources/pyside6/tests/QtTest/qvalidator_test.py
index 5cdebcfe9..0f69e38d6 100644
--- a/sources/pyside6/tests/QtTest/qvalidator_test.py
+++ b/sources/pyside6/tests/QtTest/qvalidator_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtTest/touchevent_test.py b/sources/pyside6/tests/QtTest/touchevent_test.py
index cb4a11181..d3e5f3078 100644
--- a/sources/pyside6/tests/QtTest/touchevent_test.py
+++ b/sources/pyside6/tests/QtTest/touchevent_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py b/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py
index d9502d7cd..b2bafef7c 100644
--- a/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py
+++ b/sources/pyside6/tests/QtTextToSpeech/qtexttospeech_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_1060.py b/sources/pyside6/tests/QtUiTools/bug_1060.py
index 2fe0163c9..317e33345 100644
--- a/sources/pyside6/tests/QtUiTools/bug_1060.py
+++ b/sources/pyside6/tests/QtUiTools/bug_1060.py
@@ -31,7 +31,8 @@
import os
import sys
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_360.py b/sources/pyside6/tests/QtUiTools/bug_360.py
index ce33b4c6d..12327f813 100644
--- a/sources/pyside6/tests/QtUiTools/bug_360.py
+++ b/sources/pyside6/tests/QtUiTools/bug_360.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_376.py b/sources/pyside6/tests/QtUiTools/bug_376.py
index db74b927a..05948118f 100644
--- a/sources/pyside6/tests/QtUiTools/bug_376.py
+++ b/sources/pyside6/tests/QtUiTools/bug_376.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_392.py b/sources/pyside6/tests/QtUiTools/bug_392.py
index da6750d92..eb351dedc 100644
--- a/sources/pyside6/tests/QtUiTools/bug_392.py
+++ b/sources/pyside6/tests/QtUiTools/bug_392.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_426.py b/sources/pyside6/tests/QtUiTools/bug_426.py
index 07a490389..9f9ca2a1e 100644
--- a/sources/pyside6/tests/QtUiTools/bug_426.py
+++ b/sources/pyside6/tests/QtUiTools/bug_426.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_552.py b/sources/pyside6/tests/QtUiTools/bug_552.py
index bd6ec57c7..8d4ca4536 100644
--- a/sources/pyside6/tests/QtUiTools/bug_552.py
+++ b/sources/pyside6/tests/QtUiTools/bug_552.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_797.py b/sources/pyside6/tests/QtUiTools/bug_797.py
index bc46af65f..8956c31b0 100644
--- a/sources/pyside6/tests/QtUiTools/bug_797.py
+++ b/sources/pyside6/tests/QtUiTools/bug_797.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_909.py b/sources/pyside6/tests/QtUiTools/bug_909.py
index 79ad5d095..8aab7d27a 100644
--- a/sources/pyside6/tests/QtUiTools/bug_909.py
+++ b/sources/pyside6/tests/QtUiTools/bug_909.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_913.py b/sources/pyside6/tests/QtUiTools/bug_913.py
index 0352764ca..637769daa 100644
--- a/sources/pyside6/tests/QtUiTools/bug_913.py
+++ b/sources/pyside6/tests/QtUiTools/bug_913.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_958.py b/sources/pyside6/tests/QtUiTools/bug_958.py
index cfef1f5f4..5084a1262 100644
--- a/sources/pyside6/tests/QtUiTools/bug_958.py
+++ b/sources/pyside6/tests/QtUiTools/bug_958.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/bug_965.py b/sources/pyside6/tests/QtUiTools/bug_965.py
index 97668a36b..98fe2fa28 100644
--- a/sources/pyside6/tests/QtUiTools/bug_965.py
+++ b/sources/pyside6/tests/QtUiTools/bug_965.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/loadUiType_test.py b/sources/pyside6/tests/QtUiTools/loadUiType_test.py
index 8cbbe4cb9..1fe30b79e 100644
--- a/sources/pyside6/tests/QtUiTools/loadUiType_test.py
+++ b/sources/pyside6/tests/QtUiTools/loadUiType_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/ui_test.py b/sources/pyside6/tests/QtUiTools/ui_test.py
index 6f35637ad..70b916b44 100644
--- a/sources/pyside6/tests/QtUiTools/ui_test.py
+++ b/sources/pyside6/tests/QtUiTools/ui_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtUiTools/uiloader_test.py b/sources/pyside6/tests/QtUiTools/uiloader_test.py
index 9addb3f69..3e02e41d4 100644
--- a/sources/pyside6/tests/QtUiTools/uiloader_test.py
+++ b/sources/pyside6/tests/QtUiTools/uiloader_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWebEngine/web_engine_initialize.py b/sources/pyside6/tests/QtWebEngine/web_engine_initialize.py
index 35ad526a7..2db107565 100644
--- a/sources/pyside6/tests/QtWebEngine/web_engine_initialize.py
+++ b/sources/pyside6/tests/QtWebEngine/web_engine_initialize.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py b/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py
index 27f8291b8..936924d19 100644
--- a/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py
+++ b/sources/pyside6/tests/QtWebEngineCore/web_engine_custom_scheme.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/action_clear.py b/sources/pyside6/tests/QtWidgets/action_clear.py
index b476b068a..ae5a6988b 100644
--- a/sources/pyside6/tests/QtWidgets/action_clear.py
+++ b/sources/pyside6/tests/QtWidgets/action_clear.py
@@ -31,7 +31,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/add_action_test.py b/sources/pyside6/tests/QtWidgets/add_action_test.py
index a719b960a..1465f5a99 100644
--- a/sources/pyside6/tests/QtWidgets/add_action_test.py
+++ b/sources/pyside6/tests/QtWidgets/add_action_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/api2_test.py b/sources/pyside6/tests/QtWidgets/api2_test.py
index 90450dca4..cd60d8a4d 100644
--- a/sources/pyside6/tests/QtWidgets/api2_test.py
+++ b/sources/pyside6/tests/QtWidgets/api2_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/application_test.py b/sources/pyside6/tests/QtWidgets/application_test.py
index a76cbb9ae..95f36f671 100644
--- a/sources/pyside6/tests/QtWidgets/application_test.py
+++ b/sources/pyside6/tests/QtWidgets/application_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/QtWidgets/bug_1002.py b/sources/pyside6/tests/QtWidgets/bug_1002.py
index b7549c7f7..3bf85e718 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1002.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1002.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_1006.py b/sources/pyside6/tests/QtWidgets/bug_1006.py
index ac84c4a36..b8d59284e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1006.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1006.py
@@ -31,7 +31,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_1048.py b/sources/pyside6/tests/QtWidgets/bug_1048.py
index 05d956a1d..18fc62782 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1048.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1048.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_1077.py b/sources/pyside6/tests/QtWidgets/bug_1077.py
index 4dc9628a3..b736a558a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_1077.py
+++ b/sources/pyside6/tests/QtWidgets/bug_1077.py
@@ -32,8 +32,9 @@ 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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_172.py b/sources/pyside6/tests/QtWidgets/bug_172.py
index 6b943061f..683abd76c 100644
--- a/sources/pyside6/tests/QtWidgets/bug_172.py
+++ b/sources/pyside6/tests/QtWidgets/bug_172.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_243.py b/sources/pyside6/tests/QtWidgets/bug_243.py
index 4f4526691..9a551b88d 100644
--- a/sources/pyside6/tests/QtWidgets/bug_243.py
+++ b/sources/pyside6/tests/QtWidgets/bug_243.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_307.py b/sources/pyside6/tests/QtWidgets/bug_307.py
index 914227de5..2a149c13e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_307.py
+++ b/sources/pyside6/tests/QtWidgets/bug_307.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_324.py b/sources/pyside6/tests/QtWidgets/bug_324.py
index 16130f895..4b312e9e3 100644
--- a/sources/pyside6/tests/QtWidgets/bug_324.py
+++ b/sources/pyside6/tests/QtWidgets/bug_324.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_338.py b/sources/pyside6/tests/QtWidgets/bug_338.py
index f46508cbe..cd3602b08 100644
--- a/sources/pyside6/tests/QtWidgets/bug_338.py
+++ b/sources/pyside6/tests/QtWidgets/bug_338.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_389.py b/sources/pyside6/tests/QtWidgets/bug_389.py
index 87758ee4e..fc8460a6b 100644
--- a/sources/pyside6/tests/QtWidgets/bug_389.py
+++ b/sources/pyside6/tests/QtWidgets/bug_389.py
@@ -32,7 +32,8 @@ import sys
import os
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_400.py b/sources/pyside6/tests/QtWidgets/bug_400.py
index 96beaec5b..1e308db11 100644
--- a/sources/pyside6/tests/QtWidgets/bug_400.py
+++ b/sources/pyside6/tests/QtWidgets/bug_400.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_429.py b/sources/pyside6/tests/QtWidgets/bug_429.py
index fe81266a1..a461ee320 100644
--- a/sources/pyside6/tests/QtWidgets/bug_429.py
+++ b/sources/pyside6/tests/QtWidgets/bug_429.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_430.py b/sources/pyside6/tests/QtWidgets/bug_430.py
index fc96d6ab3..1d124c7c4 100644
--- a/sources/pyside6/tests/QtWidgets/bug_430.py
+++ b/sources/pyside6/tests/QtWidgets/bug_430.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_433.py b/sources/pyside6/tests/QtWidgets/bug_433.py
index 53ec18582..1c8313d2a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_433.py
+++ b/sources/pyside6/tests/QtWidgets/bug_433.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_467.py b/sources/pyside6/tests/QtWidgets/bug_467.py
index ce178bfef..d3bc98230 100644
--- a/sources/pyside6/tests/QtWidgets/bug_467.py
+++ b/sources/pyside6/tests/QtWidgets/bug_467.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_493.py b/sources/pyside6/tests/QtWidgets/bug_493.py
index 559d71f60..7a2442f9d 100644
--- a/sources/pyside6/tests/QtWidgets/bug_493.py
+++ b/sources/pyside6/tests/QtWidgets/bug_493.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_512.py b/sources/pyside6/tests/QtWidgets/bug_512.py
index 3474aa32b..125333327 100644
--- a/sources/pyside6/tests/QtWidgets/bug_512.py
+++ b/sources/pyside6/tests/QtWidgets/bug_512.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_525.py b/sources/pyside6/tests/QtWidgets/bug_525.py
index c3863207c..d35b41c0a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_525.py
+++ b/sources/pyside6/tests/QtWidgets/bug_525.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_546.py b/sources/pyside6/tests/QtWidgets/bug_546.py
index 91c8d4637..5f1f314c0 100644
--- a/sources/pyside6/tests/QtWidgets/bug_546.py
+++ b/sources/pyside6/tests/QtWidgets/bug_546.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_547.py b/sources/pyside6/tests/QtWidgets/bug_547.py
index d232aba8e..a431f2dad 100644
--- a/sources/pyside6/tests/QtWidgets/bug_547.py
+++ b/sources/pyside6/tests/QtWidgets/bug_547.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_549.py b/sources/pyside6/tests/QtWidgets/bug_549.py
index a000c8df4..ad12d2fc0 100644
--- a/sources/pyside6/tests/QtWidgets/bug_549.py
+++ b/sources/pyside6/tests/QtWidgets/bug_549.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_569.py b/sources/pyside6/tests/QtWidgets/bug_569.py
index 3e53ccca3..0c7a7b58a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_569.py
+++ b/sources/pyside6/tests/QtWidgets/bug_569.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_575.py b/sources/pyside6/tests/QtWidgets/bug_575.py
index a6f0c006a..d6de17dd1 100644
--- a/sources/pyside6/tests/QtWidgets/bug_575.py
+++ b/sources/pyside6/tests/QtWidgets/bug_575.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_576.py b/sources/pyside6/tests/QtWidgets/bug_576.py
index 9bd36e5f8..784741b5e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_576.py
+++ b/sources/pyside6/tests/QtWidgets/bug_576.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_585.py b/sources/pyside6/tests/QtWidgets/bug_585.py
index 9b489fd29..01e593349 100644
--- a/sources/pyside6/tests/QtWidgets/bug_585.py
+++ b/sources/pyside6/tests/QtWidgets/bug_585.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_589.py b/sources/pyside6/tests/QtWidgets/bug_589.py
index 4a535d388..249894c33 100644
--- a/sources/pyside6/tests/QtWidgets/bug_589.py
+++ b/sources/pyside6/tests/QtWidgets/bug_589.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_635.py b/sources/pyside6/tests/QtWidgets/bug_635.py
index d410d4e28..7cce5b32a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_635.py
+++ b/sources/pyside6/tests/QtWidgets/bug_635.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_640.py b/sources/pyside6/tests/QtWidgets/bug_640.py
index 00ba7fc69..4c1fe14f2 100644
--- a/sources/pyside6/tests/QtWidgets/bug_640.py
+++ b/sources/pyside6/tests/QtWidgets/bug_640.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_653.py b/sources/pyside6/tests/QtWidgets/bug_653.py
index 4f7dcf85c..7d61612e4 100644
--- a/sources/pyside6/tests/QtWidgets/bug_653.py
+++ b/sources/pyside6/tests/QtWidgets/bug_653.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_662.py b/sources/pyside6/tests/QtWidgets/bug_662.py
index 19070f584..cc36c6c99 100644
--- a/sources/pyside6/tests/QtWidgets/bug_662.py
+++ b/sources/pyside6/tests/QtWidgets/bug_662.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
from PySide6.QtGui import QTextCharFormat
diff --git a/sources/pyside6/tests/QtWidgets/bug_667.py b/sources/pyside6/tests/QtWidgets/bug_667.py
index 8a94fd173..2fa306a9c 100644
--- a/sources/pyside6/tests/QtWidgets/bug_667.py
+++ b/sources/pyside6/tests/QtWidgets/bug_667.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_668.py b/sources/pyside6/tests/QtWidgets/bug_668.py
index cd5b95e0a..39744e2c0 100644
--- a/sources/pyside6/tests/QtWidgets/bug_668.py
+++ b/sources/pyside6/tests/QtWidgets/bug_668.py
@@ -31,8 +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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_674.py b/sources/pyside6/tests/QtWidgets/bug_674.py
index d9aed3b6c..d24cca1c2 100644
--- a/sources/pyside6/tests/QtWidgets/bug_674.py
+++ b/sources/pyside6/tests/QtWidgets/bug_674.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_675.py b/sources/pyside6/tests/QtWidgets/bug_675.py
index b5b3af617..bdbd20197 100644
--- a/sources/pyside6/tests/QtWidgets/bug_675.py
+++ b/sources/pyside6/tests/QtWidgets/bug_675.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_688.py b/sources/pyside6/tests/QtWidgets/bug_688.py
index 21dbcabb2..4b1bfbd73 100644
--- a/sources/pyside6/tests/QtWidgets/bug_688.py
+++ b/sources/pyside6/tests/QtWidgets/bug_688.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_693.py b/sources/pyside6/tests/QtWidgets/bug_693.py
index 6d2b89be3..4d687509c 100644
--- a/sources/pyside6/tests/QtWidgets/bug_693.py
+++ b/sources/pyside6/tests/QtWidgets/bug_693.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_696.py b/sources/pyside6/tests/QtWidgets/bug_696.py
index 11bab1e3c..f7f4f6d90 100644
--- a/sources/pyside6/tests/QtWidgets/bug_696.py
+++ b/sources/pyside6/tests/QtWidgets/bug_696.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_711.py b/sources/pyside6/tests/QtWidgets/bug_711.py
index 9ed49019e..71f56144e 100644
--- a/sources/pyside6/tests/QtWidgets/bug_711.py
+++ b/sources/pyside6/tests/QtWidgets/bug_711.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_722.py b/sources/pyside6/tests/QtWidgets/bug_722.py
index c833533ff..4a00e035d 100644
--- a/sources/pyside6/tests/QtWidgets/bug_722.py
+++ b/sources/pyside6/tests/QtWidgets/bug_722.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_728.py b/sources/pyside6/tests/QtWidgets/bug_728.py
index 694e21ded..69b4da643 100644
--- a/sources/pyside6/tests/QtWidgets/bug_728.py
+++ b/sources/pyside6/tests/QtWidgets/bug_728.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_736.py b/sources/pyside6/tests/QtWidgets/bug_736.py
index 439dd69f4..44652ced9 100644
--- a/sources/pyside6/tests/QtWidgets/bug_736.py
+++ b/sources/pyside6/tests/QtWidgets/bug_736.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
from PySide6.QtCore import *
diff --git a/sources/pyside6/tests/QtWidgets/bug_750.py b/sources/pyside6/tests/QtWidgets/bug_750.py
index 4c63d77f1..1c96e3e1f 100644
--- a/sources/pyside6/tests/QtWidgets/bug_750.py
+++ b/sources/pyside6/tests/QtWidgets/bug_750.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_778.py b/sources/pyside6/tests/QtWidgets/bug_778.py
index 9816c4c35..f1325d9a2 100644
--- a/sources/pyside6/tests/QtWidgets/bug_778.py
+++ b/sources/pyside6/tests/QtWidgets/bug_778.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_785.py b/sources/pyside6/tests/QtWidgets/bug_785.py
index 36cac24cd..27b552e3c 100644
--- a/sources/pyside6/tests/QtWidgets/bug_785.py
+++ b/sources/pyside6/tests/QtWidgets/bug_785.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_793.py b/sources/pyside6/tests/QtWidgets/bug_793.py
index d1080d93f..0741617d6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_793.py
+++ b/sources/pyside6/tests/QtWidgets/bug_793.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_811.py b/sources/pyside6/tests/QtWidgets/bug_811.py
index 671c3bcbb..1ba027dd0 100644
--- a/sources/pyside6/tests/QtWidgets/bug_811.py
+++ b/sources/pyside6/tests/QtWidgets/bug_811.py
@@ -31,7 +31,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_834.py b/sources/pyside6/tests/QtWidgets/bug_834.py
index 2cac4b496..232d71c19 100644
--- a/sources/pyside6/tests/QtWidgets/bug_834.py
+++ b/sources/pyside6/tests/QtWidgets/bug_834.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_836.py b/sources/pyside6/tests/QtWidgets/bug_836.py
index 6106cd838..34ca0b608 100644
--- a/sources/pyside6/tests/QtWidgets/bug_836.py
+++ b/sources/pyside6/tests/QtWidgets/bug_836.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_844.py b/sources/pyside6/tests/QtWidgets/bug_844.py
index b17a6df14..4b98cf155 100644
--- a/sources/pyside6/tests/QtWidgets/bug_844.py
+++ b/sources/pyside6/tests/QtWidgets/bug_844.py
@@ -29,8 +29,8 @@
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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_854.py b/sources/pyside6/tests/QtWidgets/bug_854.py
index 218691312..103018754 100644
--- a/sources/pyside6/tests/QtWidgets/bug_854.py
+++ b/sources/pyside6/tests/QtWidgets/bug_854.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_860.py b/sources/pyside6/tests/QtWidgets/bug_860.py
index 6fb511762..4a208257a 100644
--- a/sources/pyside6/tests/QtWidgets/bug_860.py
+++ b/sources/pyside6/tests/QtWidgets/bug_860.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_862.py b/sources/pyside6/tests/QtWidgets/bug_862.py
index 9bbc84844..997f212e7 100644
--- a/sources/pyside6/tests/QtWidgets/bug_862.py
+++ b/sources/pyside6/tests/QtWidgets/bug_862.py
@@ -52,7 +52,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_871.py b/sources/pyside6/tests/QtWidgets/bug_871.py
index 9f2481d8e..758d3ece4 100644
--- a/sources/pyside6/tests/QtWidgets/bug_871.py
+++ b/sources/pyside6/tests/QtWidgets/bug_871.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_879.py b/sources/pyside6/tests/QtWidgets/bug_879.py
index 17c6013af..4089fa590 100644
--- a/sources/pyside6/tests/QtWidgets/bug_879.py
+++ b/sources/pyside6/tests/QtWidgets/bug_879.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_919.py b/sources/pyside6/tests/QtWidgets/bug_919.py
index 10767e778..fd51ec9ef 100644
--- a/sources/pyside6/tests/QtWidgets/bug_919.py
+++ b/sources/pyside6/tests/QtWidgets/bug_919.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_921.py b/sources/pyside6/tests/QtWidgets/bug_921.py
index fd095cd2b..a7b0e99d4 100644
--- a/sources/pyside6/tests/QtWidgets/bug_921.py
+++ b/sources/pyside6/tests/QtWidgets/bug_921.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_941.py b/sources/pyside6/tests/QtWidgets/bug_941.py
index 0b540e8ec..004730cfd 100644
--- a/sources/pyside6/tests/QtWidgets/bug_941.py
+++ b/sources/pyside6/tests/QtWidgets/bug_941.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_964.py b/sources/pyside6/tests/QtWidgets/bug_964.py
index 32bc584ef..905f92ad6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_964.py
+++ b/sources/pyside6/tests/QtWidgets/bug_964.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_967.py b/sources/pyside6/tests/QtWidgets/bug_967.py
index 6ee4fed99..e39aac1ba 100644
--- a/sources/pyside6/tests/QtWidgets/bug_967.py
+++ b/sources/pyside6/tests/QtWidgets/bug_967.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_972.py b/sources/pyside6/tests/QtWidgets/bug_972.py
index 686bd2ecc..12110edee 100644
--- a/sources/pyside6/tests/QtWidgets/bug_972.py
+++ b/sources/pyside6/tests/QtWidgets/bug_972.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_979.py b/sources/pyside6/tests/QtWidgets/bug_979.py
index b98ce6918..aa2a610a6 100644
--- a/sources/pyside6/tests/QtWidgets/bug_979.py
+++ b/sources/pyside6/tests/QtWidgets/bug_979.py
@@ -29,8 +29,8 @@
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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/bug_988.py b/sources/pyside6/tests/QtWidgets/bug_988.py
index e362f1fb3..710891680 100644
--- a/sources/pyside6/tests/QtWidgets/bug_988.py
+++ b/sources/pyside6/tests/QtWidgets/bug_988.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/bug_998.py b/sources/pyside6/tests/QtWidgets/bug_998.py
index f72092945..735de74bc 100644
--- a/sources/pyside6/tests/QtWidgets/bug_998.py
+++ b/sources/pyside6/tests/QtWidgets/bug_998.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/customproxywidget_test.py b/sources/pyside6/tests/QtWidgets/customproxywidget_test.py
index c605dd91f..d63391125 100644
--- a/sources/pyside6/tests/QtWidgets/customproxywidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/customproxywidget_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/event_filter_test.py b/sources/pyside6/tests/QtWidgets/event_filter_test.py
index 8e9932cc0..37333506f 100644
--- a/sources/pyside6/tests/QtWidgets/event_filter_test.py
+++ b/sources/pyside6/tests/QtWidgets/event_filter_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/grandparent_method_test.py b/sources/pyside6/tests/QtWidgets/grandparent_method_test.py
index a3c5a1e07..b1a8742d0 100644
--- a/sources/pyside6/tests/QtWidgets/grandparent_method_test.py
+++ b/sources/pyside6/tests/QtWidgets/grandparent_method_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/hashabletype_test.py b/sources/pyside6/tests/QtWidgets/hashabletype_test.py
index c443d0505..93eba5486 100644
--- a/sources/pyside6/tests/QtWidgets/hashabletype_test.py
+++ b/sources/pyside6/tests/QtWidgets/hashabletype_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/keep_reference_test.py b/sources/pyside6/tests/QtWidgets/keep_reference_test.py
index 1c634c396..5c7c0d48f 100644
--- a/sources/pyside6/tests/QtWidgets/keep_reference_test.py
+++ b/sources/pyside6/tests/QtWidgets/keep_reference_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/missing_symbols_test.py b/sources/pyside6/tests/QtWidgets/missing_symbols_test.py
index a51fbfa27..a4b0cb12d 100644
--- a/sources/pyside6/tests/QtWidgets/missing_symbols_test.py
+++ b/sources/pyside6/tests/QtWidgets/missing_symbols_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/paint_event_test.py b/sources/pyside6/tests/QtWidgets/paint_event_test.py
index 115f14b4a..19a082f71 100644
--- a/sources/pyside6/tests/QtWidgets/paint_event_test.py
+++ b/sources/pyside6/tests/QtWidgets/paint_event_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/parent_method_test.py b/sources/pyside6/tests/QtWidgets/parent_method_test.py
index 455ec46ee..29e4d1db3 100644
--- a/sources/pyside6/tests/QtWidgets/parent_method_test.py
+++ b/sources/pyside6/tests/QtWidgets/parent_method_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/private_mangle_test.py b/sources/pyside6/tests/QtWidgets/private_mangle_test.py
index d1520a44f..f46d11778 100644
--- a/sources/pyside6/tests/QtWidgets/private_mangle_test.py
+++ b/sources/pyside6/tests/QtWidgets/private_mangle_test.py
@@ -46,7 +46,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/python_properties_test.py b/sources/pyside6/tests/QtWidgets/python_properties_test.py
index f37881c2a..c12052315 100644
--- a/sources/pyside6/tests/QtWidgets/python_properties_test.py
+++ b/sources/pyside6/tests/QtWidgets/python_properties_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py b/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py
index 212cff0ff..7bbdedadd 100644
--- a/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qabstracttextdocumentlayout_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qaction_test.py b/sources/pyside6/tests/QtWidgets/qaction_test.py
index 558295adc..42130a598 100644
--- a/sources/pyside6/tests/QtWidgets/qaction_test.py
+++ b/sources/pyside6/tests/QtWidgets/qaction_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qapp_issue_585.py b/sources/pyside6/tests/QtWidgets/qapp_issue_585.py
index 1c86a1cc3..1b859db53 100644
--- a/sources/pyside6/tests/QtWidgets/qapp_issue_585.py
+++ b/sources/pyside6/tests/QtWidgets/qapp_issue_585.py
@@ -61,8 +61,9 @@ 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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/qapp_test.py b/sources/pyside6/tests/QtWidgets/qapp_test.py
index edff491e1..cc5d1ea0d 100644
--- a/sources/pyside6/tests/QtWidgets/qapp_test.py
+++ b/sources/pyside6/tests/QtWidgets/qapp_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py b/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py
index 951fc3193..4008aa743 100644
--- a/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py
+++ b/sources/pyside6/tests/QtWidgets/qapplication_exit_segfault_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qapplication_test.py b/sources/pyside6/tests/QtWidgets/qapplication_test.py
index 49b216043..4c5c56dfa 100644
--- a/sources/pyside6/tests/QtWidgets/qapplication_test.py
+++ b/sources/pyside6/tests/QtWidgets/qapplication_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qbrush_test.py b/sources/pyside6/tests/QtWidgets/qbrush_test.py
index 6d568da42..838bfc9e5 100644
--- a/sources/pyside6/tests/QtWidgets/qbrush_test.py
+++ b/sources/pyside6/tests/QtWidgets/qbrush_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qcolormap_test.py b/sources/pyside6/tests/QtWidgets/qcolormap_test.py
index bbde8357e..a6999de95 100644
--- a/sources/pyside6/tests/QtWidgets/qcolormap_test.py
+++ b/sources/pyside6/tests/QtWidgets/qcolormap_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qdynamic_signal.py b/sources/pyside6/tests/QtWidgets/qdynamic_signal.py
index 5fec6836a..d1fe42151 100644
--- a/sources/pyside6/tests/QtWidgets/qdynamic_signal.py
+++ b/sources/pyside6/tests/QtWidgets/qdynamic_signal.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qfontdialog_test.py b/sources/pyside6/tests/QtWidgets/qfontdialog_test.py
index 8473854ec..e0f834932 100644
--- a/sources/pyside6/tests/QtWidgets/qfontdialog_test.py
+++ b/sources/pyside6/tests/QtWidgets/qfontdialog_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qformlayout_test.py b/sources/pyside6/tests/QtWidgets/qformlayout_test.py
index 87bff138e..15cb7432f 100644
--- a/sources/pyside6/tests/QtWidgets/qformlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qformlayout_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py
index 642fab27b..c03dde0c0 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsitem_isblocked_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py
index 961d016c0..583a54709 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsitem_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py
index e9b509a65..f7ec876bb 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsobjectreimpl_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py
index ac9124f6c..b4e62bc13 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsproxywidget_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py b/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py
index 6a563e590..a87ddd142 100644
--- a/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py
+++ b/sources/pyside6/tests/QtWidgets/qgraphicsscene_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qimage_test.py b/sources/pyside6/tests/QtWidgets/qimage_test.py
index 778b339d6..dc7f4854f 100644
--- a/sources/pyside6/tests/QtWidgets/qimage_test.py
+++ b/sources/pyside6/tests/QtWidgets/qimage_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py b/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py
index a2df8e863..f71434126 100644
--- a/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py
+++ b/sources/pyside6/tests/QtWidgets/qinputdialog_get_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py b/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py
index 8591b4979..61f56f2d2 100644
--- a/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py
+++ b/sources/pyside6/tests/QtWidgets/qkeysequenceedit_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qlabel_test.py b/sources/pyside6/tests/QtWidgets/qlabel_test.py
index b24c08690..15618eec7 100644
--- a/sources/pyside6/tests/QtWidgets/qlabel_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlabel_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py b/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py
index 717cd67b8..d10141098 100644
--- a/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlayout_ref_test.py
@@ -33,7 +33,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qlayout_test.py b/sources/pyside6/tests/QtWidgets/qlayout_test.py
index f90627d0b..7b9bc549a 100644
--- a/sources/pyside6/tests/QtWidgets/qlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlayout_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py b/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py
index d4ed8e5dd..55b289e2c 100644
--- a/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlcdnumber_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qlistwidget_test.py b/sources/pyside6/tests/QtWidgets/qlistwidget_test.py
index 912b2e74b..f0f0790a3 100644
--- a/sources/pyside6/tests/QtWidgets/qlistwidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlistwidget_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py b/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py
index 550d77b41..99744c8ea 100644
--- a/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py
+++ b/sources/pyside6/tests/QtWidgets/qlistwidgetitem_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qmainwindow_test.py b/sources/pyside6/tests/QtWidgets/qmainwindow_test.py
index a25e4504b..fd60754fb 100644
--- a/sources/pyside6/tests/QtWidgets/qmainwindow_test.py
+++ b/sources/pyside6/tests/QtWidgets/qmainwindow_test.py
@@ -31,7 +31,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qmenu_test.py b/sources/pyside6/tests/QtWidgets/qmenu_test.py
index 40cae96b1..20d43069b 100644
--- a/sources/pyside6/tests/QtWidgets/qmenu_test.py
+++ b/sources/pyside6/tests/QtWidgets/qmenu_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qmenuadd_test.py b/sources/pyside6/tests/QtWidgets/qmenuadd_test.py
index c74ba8adf..6b9dad488 100644
--- a/sources/pyside6/tests/QtWidgets/qmenuadd_test.py
+++ b/sources/pyside6/tests/QtWidgets/qmenuadd_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qobject_mi_test.py b/sources/pyside6/tests/QtWidgets/qobject_mi_test.py
index 2bd6947af..6ed39e8f5 100644
--- a/sources/pyside6/tests/QtWidgets/qobject_mi_test.py
+++ b/sources/pyside6/tests/QtWidgets/qobject_mi_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qpen_test.py b/sources/pyside6/tests/QtWidgets/qpen_test.py
index 6bff44740..fc365ff07 100644
--- a/sources/pyside6/tests/QtWidgets/qpen_test.py
+++ b/sources/pyside6/tests/QtWidgets/qpen_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qpicture_test.py b/sources/pyside6/tests/QtWidgets/qpicture_test.py
index 704a22d75..c8f485142 100644
--- a/sources/pyside6/tests/QtWidgets/qpicture_test.py
+++ b/sources/pyside6/tests/QtWidgets/qpicture_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py b/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py
index 4502885b7..10d873abe 100644
--- a/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py
+++ b/sources/pyside6/tests/QtWidgets/qpixmap_constructor.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qpushbutton_test.py b/sources/pyside6/tests/QtWidgets/qpushbutton_test.py
index 0c73670a5..bcec339c8 100644
--- a/sources/pyside6/tests/QtWidgets/qpushbutton_test.py
+++ b/sources/pyside6/tests/QtWidgets/qpushbutton_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qshortcut_test.py b/sources/pyside6/tests/QtWidgets/qshortcut_test.py
index 8f9c8a465..e09af1ac0 100644
--- a/sources/pyside6/tests/QtWidgets/qshortcut_test.py
+++ b/sources/pyside6/tests/QtWidgets/qshortcut_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qsplitter_test.py b/sources/pyside6/tests/QtWidgets/qsplitter_test.py
index 413bd7a30..20d0209bb 100644
--- a/sources/pyside6/tests/QtWidgets/qsplitter_test.py
+++ b/sources/pyside6/tests/QtWidgets/qsplitter_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py b/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py
index caf945725..7e55246bf 100644
--- a/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py
+++ b/sources/pyside6/tests/QtWidgets/qstandarditemmodel_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py b/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py
index 3445db447..c8f6c2dbc 100644
--- a/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py
+++ b/sources/pyside6/tests/QtWidgets/qstring_qkeysequence_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qstyle_test.py b/sources/pyside6/tests/QtWidgets/qstyle_test.py
index 5d86e3d71..1b0208a62 100644
--- a/sources/pyside6/tests/QtWidgets/qstyle_test.py
+++ b/sources/pyside6/tests/QtWidgets/qstyle_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtableview_test.py b/sources/pyside6/tests/QtWidgets/qtableview_test.py
index a6117f180..a8b524527 100644
--- a/sources/pyside6/tests/QtWidgets/qtableview_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtableview_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtabwidget_test.py b/sources/pyside6/tests/QtWidgets/qtabwidget_test.py
index b5f5bb463..6e0038ee6 100644
--- a/sources/pyside6/tests/QtWidgets/qtabwidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtabwidget_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py b/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py
index 6177c2452..b4250c2c1 100644
--- a/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtabwidgetclear_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py b/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py
index 78507a61a..9c7e51a40 100644
--- a/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtextedit_signal_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtextedit_test.py b/sources/pyside6/tests/QtWidgets/qtextedit_test.py
index 80ca9bb82..241197f45 100644
--- a/sources/pyside6/tests/QtWidgets/qtextedit_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtextedit_test.py
@@ -33,7 +33,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtoolbar_test.py b/sources/pyside6/tests/QtWidgets/qtoolbar_test.py
index 95ef3dc83..3e5ae7194 100644
--- a/sources/pyside6/tests/QtWidgets/qtoolbar_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtoolbar_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtoolbox_test.py b/sources/pyside6/tests/QtWidgets/qtoolbox_test.py
index 1ad8fdc6d..e9b69821a 100644
--- a/sources/pyside6/tests/QtWidgets/qtoolbox_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtoolbox_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtreeview_test.py b/sources/pyside6/tests/QtWidgets/qtreeview_test.py
index d9ad48227..cbaed8c83 100644
--- a/sources/pyside6/tests/QtWidgets/qtreeview_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtreeview_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtreewidget_test.py b/sources/pyside6/tests/QtWidgets/qtreewidget_test.py
index 23ee01919..dbbad1c6d 100644
--- a/sources/pyside6/tests/QtWidgets/qtreewidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtreewidget_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py b/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py
index 9edd6bee6..28dfb07b5 100644
--- a/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py
+++ b/sources/pyside6/tests/QtWidgets/qtreewidgetitem_test.py
@@ -44,7 +44,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qvariant_test.py b/sources/pyside6/tests/QtWidgets/qvariant_test.py
index 51ee27ec0..49091502f 100644
--- a/sources/pyside6/tests/QtWidgets/qvariant_test.py
+++ b/sources/pyside6/tests/QtWidgets/qvariant_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py b/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py
index 6bb292f26..807965e20 100644
--- a/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py
+++ b/sources/pyside6/tests/QtWidgets/qwidget_setlayout_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/qwidget_test.py b/sources/pyside6/tests/QtWidgets/qwidget_test.py
index a2b8e8b94..6ff904201 100644
--- a/sources/pyside6/tests/QtWidgets/qwidget_test.py
+++ b/sources/pyside6/tests/QtWidgets/qwidget_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/reference_count_test.py b/sources/pyside6/tests/QtWidgets/reference_count_test.py
index 113d5b5b6..8ca382561 100644
--- a/sources/pyside6/tests/QtWidgets/reference_count_test.py
+++ b/sources/pyside6/tests/QtWidgets/reference_count_test.py
@@ -34,7 +34,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/signature_test.py b/sources/pyside6/tests/QtWidgets/signature_test.py
index aec530595..6842055a0 100644
--- a/sources/pyside6/tests/QtWidgets/signature_test.py
+++ b/sources/pyside6/tests/QtWidgets/signature_test.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/standardpixmap_test.py b/sources/pyside6/tests/QtWidgets/standardpixmap_test.py
index d3e2ee7ce..900d5fb75 100644
--- a/sources/pyside6/tests/QtWidgets/standardpixmap_test.py
+++ b/sources/pyside6/tests/QtWidgets/standardpixmap_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/test_module_template.py b/sources/pyside6/tests/QtWidgets/test_module_template.py
index 74defe7ea..0f080fe99 100644
--- a/sources/pyside6/tests/QtWidgets/test_module_template.py
+++ b/sources/pyside6/tests/QtWidgets/test_module_template.py
@@ -29,8 +29,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 pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1] / "util"))
from init_paths import init_test_paths
init_test_paths()
diff --git a/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py b/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py
index 24d0ec01c..220a6e31a 100644
--- a/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py
+++ b/sources/pyside6/tests/QtWidgets/virtual_protected_inheritance_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py b/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py
index 8acc2128f..f6c29425b 100644
--- a/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py
+++ b/sources/pyside6/tests/QtWidgets/virtual_pure_override_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtWidgets/wrong_return_test.py b/sources/pyside6/tests/QtWidgets/wrong_return_test.py
index 5761c3f5e..df0368599 100644
--- a/sources/pyside6/tests/QtWidgets/wrong_return_test.py
+++ b/sources/pyside6/tests/QtWidgets/wrong_return_test.py
@@ -33,7 +33,8 @@ import sys
import unittest
import warnings
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/QtXml/qdomdocument_test.py b/sources/pyside6/tests/QtXml/qdomdocument_test.py
index 7fb0de69d..5ce902438 100644
--- a/sources/pyside6/tests/QtXml/qdomdocument_test.py
+++ b/sources/pyside6/tests/QtXml/qdomdocument_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/mac/qmacstyle_test.py b/sources/pyside6/tests/mac/qmacstyle_test.py
index f3508423a..9b745cb1b 100644
--- a/sources/pyside6/tests/mac/qmacstyle_test.py
+++ b/sources/pyside6/tests/mac/qmacstyle_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/all_modules_load_test.py b/sources/pyside6/tests/pysidetest/all_modules_load_test.py
index 08a78aa40..70da51eb7 100644
--- a/sources/pyside6/tests/pysidetest/all_modules_load_test.py
+++ b/sources/pyside6/tests/pysidetest/all_modules_load_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/bug_1016.py b/sources/pyside6/tests/pysidetest/bug_1016.py
index 234bfe0e5..42ca55e71 100644
--- a/sources/pyside6/tests/pysidetest/bug_1016.py
+++ b/sources/pyside6/tests/pysidetest/bug_1016.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/constructor_properties_test.py b/sources/pyside6/tests/pysidetest/constructor_properties_test.py
index fbfbdffeb..e3e1d0f75 100644
--- a/sources/pyside6/tests/pysidetest/constructor_properties_test.py
+++ b/sources/pyside6/tests/pysidetest/constructor_properties_test.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/decoratedslot_test.py b/sources/pyside6/tests/pysidetest/decoratedslot_test.py
index 439d8acbc..3c9df7769 100644
--- a/sources/pyside6/tests/pysidetest/decoratedslot_test.py
+++ b/sources/pyside6/tests/pysidetest/decoratedslot_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py b/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py
index 6f6b98305..acbf5828e 100644
--- a/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py
+++ b/sources/pyside6/tests/pysidetest/delegatecreateseditor_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/embedding_test.py b/sources/pyside6/tests/pysidetest/embedding_test.py
index 14cc1b4b5..e4b5cb9f6 100644
--- a/sources/pyside6/tests/pysidetest/embedding_test.py
+++ b/sources/pyside6/tests/pysidetest/embedding_test.py
@@ -41,7 +41,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/enum_test.py b/sources/pyside6/tests/pysidetest/enum_test.py
index d179d6248..6dbd2fb47 100644
--- a/sources/pyside6/tests/pysidetest/enum_test.py
+++ b/sources/pyside6/tests/pysidetest/enum_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py b/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py
index 1566b4a82..0ca946541 100644
--- a/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py
+++ b/sources/pyside6/tests/pysidetest/homonymoussignalandmethod_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/iterable_test.py b/sources/pyside6/tests/pysidetest/iterable_test.py
index 91c12de8c..e8a85acf8 100644
--- a/sources/pyside6/tests/pysidetest/iterable_test.py
+++ b/sources/pyside6/tests/pysidetest/iterable_test.py
@@ -36,7 +36,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/list_signal_test.py b/sources/pyside6/tests/pysidetest/list_signal_test.py
index ee68227a2..58e849df9 100644
--- a/sources/pyside6/tests/pysidetest/list_signal_test.py
+++ b/sources/pyside6/tests/pysidetest/list_signal_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py b/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py
index 7a01a00fa..b192a5180 100644
--- a/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py
+++ b/sources/pyside6/tests/pysidetest/mixin_signal_slots_test.py
@@ -37,7 +37,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/modelview_test.py b/sources/pyside6/tests/pysidetest/modelview_test.py
index 1db9f8d66..1aa72d98a 100644
--- a/sources/pyside6/tests/pysidetest/modelview_test.py
+++ b/sources/pyside6/tests/pysidetest/modelview_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py b/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py
index 7a8e03fe8..a4e996f96 100644
--- a/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py
+++ b/sources/pyside6/tests/pysidetest/new_inherited_functions_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/notify_id.py b/sources/pyside6/tests/pysidetest/notify_id.py
index fbb520d0f..870ee144a 100644
--- a/sources/pyside6/tests/pysidetest/notify_id.py
+++ b/sources/pyside6/tests/pysidetest/notify_id.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/properties_test.py b/sources/pyside6/tests/pysidetest/properties_test.py
index b54144562..9333feb75 100644
--- a/sources/pyside6/tests/pysidetest/properties_test.py
+++ b/sources/pyside6/tests/pysidetest/properties_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/property_python_test.py b/sources/pyside6/tests/pysidetest/property_python_test.py
index 26cd9a5bd..4b55ee311 100644
--- a/sources/pyside6/tests/pysidetest/property_python_test.py
+++ b/sources/pyside6/tests/pysidetest/property_python_test.py
@@ -43,7 +43,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py b/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py
index 2233b1b33..5acefefa1 100644
--- a/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py
+++ b/sources/pyside6/tests/pysidetest/qapp_like_a_macro_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/qvariant_test.py b/sources/pyside6/tests/pysidetest/qvariant_test.py
index e2a8a5f6e..eadc2aad0 100644
--- a/sources/pyside6/tests/pysidetest/qvariant_test.py
+++ b/sources/pyside6/tests/pysidetest/qvariant_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/repr_test.py b/sources/pyside6/tests/pysidetest/repr_test.py
index 356d11911..587caddcc 100644
--- a/sources/pyside6/tests/pysidetest/repr_test.py
+++ b/sources/pyside6/tests/pysidetest/repr_test.py
@@ -44,7 +44,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/signal_slot_warning.py b/sources/pyside6/tests/pysidetest/signal_slot_warning.py
index 78255f5a1..ef4419b6d 100644
--- a/sources/pyside6/tests/pysidetest/signal_slot_warning.py
+++ b/sources/pyside6/tests/pysidetest/signal_slot_warning.py
@@ -36,7 +36,8 @@ import sys
import unittest
import warnings
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py b/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py
index 1a39d7150..037862fb6 100644
--- a/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py
+++ b/sources/pyside6/tests/pysidetest/signal_tp_descr_get_test.py
@@ -47,7 +47,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/pysidetest/signalandnamespace_test.py b/sources/pyside6/tests/pysidetest/signalandnamespace_test.py
index f56beaf84..f78d05ed6 100644
--- a/sources/pyside6/tests/pysidetest/signalandnamespace_test.py
+++ b/sources/pyside6/tests/pysidetest/signalandnamespace_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py b/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py
index 568564d6b..4a3f8a178 100644
--- a/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py
+++ b/sources/pyside6/tests/pysidetest/signalemissionfrompython_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py b/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py
index ac95ed71a..1e715da38 100644
--- a/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py
+++ b/sources/pyside6/tests/pysidetest/signalwithdefaultvalue_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/typedef_signal_test.py b/sources/pyside6/tests/pysidetest/typedef_signal_test.py
index f70eda0b2..7357caee0 100644
--- a/sources/pyside6/tests/pysidetest/typedef_signal_test.py
+++ b/sources/pyside6/tests/pysidetest/typedef_signal_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/pysidetest/version_test.py b/sources/pyside6/tests/pysidetest/version_test.py
index 03d84e73c..15e126c1d 100644
--- a/sources/pyside6/tests/pysidetest/version_test.py
+++ b/sources/pyside6/tests/pysidetest/version_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/registry/existence_test.py b/sources/pyside6/tests/registry/existence_test.py
index 7f8213cb2..38bba4576 100644
--- a/sources/pyside6/tests/registry/existence_test.py
+++ b/sources/pyside6/tests/registry/existence_test.py
@@ -70,7 +70,8 @@ import sys
from textwrap import dedent
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_all_test_paths
init_all_test_paths()
diff --git a/sources/pyside6/tests/signals/args_dont_match_test.py b/sources/pyside6/tests/signals/args_dont_match_test.py
index 71edff1ae..42ca492a8 100644
--- a/sources/pyside6/tests/signals/args_dont_match_test.py
+++ b/sources/pyside6/tests/signals/args_dont_match_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/bug_189.py b/sources/pyside6/tests/signals/bug_189.py
index 2e62ffe45..f13a9c2cc 100644
--- a/sources/pyside6/tests/signals/bug_189.py
+++ b/sources/pyside6/tests/signals/bug_189.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/bug_311.py b/sources/pyside6/tests/signals/bug_311.py
index ef59dafa1..6772f89b7 100644
--- a/sources/pyside6/tests/signals/bug_311.py
+++ b/sources/pyside6/tests/signals/bug_311.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/bug_312.py b/sources/pyside6/tests/signals/bug_312.py
index 71f4ae6da..d0543b68f 100644
--- a/sources/pyside6/tests/signals/bug_312.py
+++ b/sources/pyside6/tests/signals/bug_312.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/bug_319.py b/sources/pyside6/tests/signals/bug_319.py
index 62a74abd7..563447cfe 100644
--- a/sources/pyside6/tests/signals/bug_319.py
+++ b/sources/pyside6/tests/signals/bug_319.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/bug_79.py b/sources/pyside6/tests/signals/bug_79.py
index da91fcf2e..3b97e036c 100644
--- a/sources/pyside6/tests/signals/bug_79.py
+++ b/sources/pyside6/tests/signals/bug_79.py
@@ -31,7 +31,8 @@ import gc
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/decorators_test.py b/sources/pyside6/tests/signals/decorators_test.py
index 1ea3e37a6..f8d51383f 100644
--- a/sources/pyside6/tests/signals/decorators_test.py
+++ b/sources/pyside6/tests/signals/decorators_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/disconnect_test.py b/sources/pyside6/tests/signals/disconnect_test.py
index 9aa5bdba1..5eaf6fad7 100644
--- a/sources/pyside6/tests/signals/disconnect_test.py
+++ b/sources/pyside6/tests/signals/disconnect_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(True)
diff --git a/sources/pyside6/tests/signals/invalid_callback_test.py b/sources/pyside6/tests/signals/invalid_callback_test.py
index 15ee3e84b..33a43204f 100644
--- a/sources/pyside6/tests/signals/invalid_callback_test.py
+++ b/sources/pyside6/tests/signals/invalid_callback_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/lambda_gui_test.py b/sources/pyside6/tests/signals/lambda_gui_test.py
index 7311627b3..0de00d7aa 100644
--- a/sources/pyside6/tests/signals/lambda_gui_test.py
+++ b/sources/pyside6/tests/signals/lambda_gui_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/lambda_test.py b/sources/pyside6/tests/signals/lambda_test.py
index e22042933..3d23d0ea7 100644
--- a/sources/pyside6/tests/signals/lambda_test.py
+++ b/sources/pyside6/tests/signals/lambda_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/leaking_signal_test.py b/sources/pyside6/tests/signals/leaking_signal_test.py
index fb0ffd1f3..170637d93 100644
--- a/sources/pyside6/tests/signals/leaking_signal_test.py
+++ b/sources/pyside6/tests/signals/leaking_signal_test.py
@@ -31,7 +31,8 @@ import sys
import unittest
import weakref
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/multiple_connections_gui_test.py b/sources/pyside6/tests/signals/multiple_connections_gui_test.py
index 827a64248..fe879e624 100644
--- a/sources/pyside6/tests/signals/multiple_connections_gui_test.py
+++ b/sources/pyside6/tests/signals/multiple_connections_gui_test.py
@@ -32,7 +32,8 @@ import random
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/multiple_connections_test.py b/sources/pyside6/tests/signals/multiple_connections_test.py
index 3cb8c9c5c..1f9d95c41 100644
--- a/sources/pyside6/tests/signals/multiple_connections_test.py
+++ b/sources/pyside6/tests/signals/multiple_connections_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/pysignal_test.py b/sources/pyside6/tests/signals/pysignal_test.py
index 3f5cd63d6..bc6310f5a 100644
--- a/sources/pyside6/tests/signals/pysignal_test.py
+++ b/sources/pyside6/tests/signals/pysignal_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/qobject_destroyed_test.py b/sources/pyside6/tests/signals/qobject_destroyed_test.py
index 5f5e08e68..02298164a 100644
--- a/sources/pyside6/tests/signals/qobject_destroyed_test.py
+++ b/sources/pyside6/tests/signals/qobject_destroyed_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/qobject_receivers_test.py b/sources/pyside6/tests/signals/qobject_receivers_test.py
index ce73c3229..4b6ae021e 100644
--- a/sources/pyside6/tests/signals/qobject_receivers_test.py
+++ b/sources/pyside6/tests/signals/qobject_receivers_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/qobject_sender_test.py b/sources/pyside6/tests/signals/qobject_sender_test.py
index 3679e45c8..5aff3248a 100644
--- a/sources/pyside6/tests/signals/qobject_sender_test.py
+++ b/sources/pyside6/tests/signals/qobject_sender_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/ref01_test.py b/sources/pyside6/tests/signals/ref01_test.py
index 9ad8bcaa7..1692a8079 100644
--- a/sources/pyside6/tests/signals/ref01_test.py
+++ b/sources/pyside6/tests/signals/ref01_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/ref02_test.py b/sources/pyside6/tests/signals/ref02_test.py
index 7d6b33f13..775d66b37 100644
--- a/sources/pyside6/tests/signals/ref02_test.py
+++ b/sources/pyside6/tests/signals/ref02_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/ref03_test.py b/sources/pyside6/tests/signals/ref03_test.py
index ffd63e498..a17d2eaa5 100644
--- a/sources/pyside6/tests/signals/ref03_test.py
+++ b/sources/pyside6/tests/signals/ref03_test.py
@@ -34,7 +34,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/ref04_test.py b/sources/pyside6/tests/signals/ref04_test.py
index afed28f4f..f395033c0 100644
--- a/sources/pyside6/tests/signals/ref04_test.py
+++ b/sources/pyside6/tests/signals/ref04_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/ref05_test.py b/sources/pyside6/tests/signals/ref05_test.py
index f75d26428..3358c3521 100644
--- a/sources/pyside6/tests/signals/ref05_test.py
+++ b/sources/pyside6/tests/signals/ref05_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/ref06_test.py b/sources/pyside6/tests/signals/ref06_test.py
index df3d1e453..9d8495e38 100644
--- a/sources/pyside6/tests/signals/ref06_test.py
+++ b/sources/pyside6/tests/signals/ref06_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/segfault_proxyparent_test.py b/sources/pyside6/tests/signals/segfault_proxyparent_test.py
index ea2435bea..4a5847634 100644
--- a/sources/pyside6/tests/signals/segfault_proxyparent_test.py
+++ b/sources/pyside6/tests/signals/segfault_proxyparent_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/self_connect_test.py b/sources/pyside6/tests/signals/self_connect_test.py
index 4feae21bc..0d89d535d 100644
--- a/sources/pyside6/tests/signals/self_connect_test.py
+++ b/sources/pyside6/tests/signals/self_connect_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/short_circuit_test.py b/sources/pyside6/tests/signals/short_circuit_test.py
index e3dd5b947..8a9483331 100644
--- a/sources/pyside6/tests/signals/short_circuit_test.py
+++ b/sources/pyside6/tests/signals/short_circuit_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal2signal_connect_test.py b/sources/pyside6/tests/signals/signal2signal_connect_test.py
index 43d0ef237..1a0e67aaf 100644
--- a/sources/pyside6/tests/signals/signal2signal_connect_test.py
+++ b/sources/pyside6/tests/signals/signal2signal_connect_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_across_threads.py b/sources/pyside6/tests/signals/signal_across_threads.py
index 399093e96..c16ec4db7 100644
--- a/sources/pyside6/tests/signals/signal_across_threads.py
+++ b/sources/pyside6/tests/signals/signal_across_threads.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_autoconnect_test.py b/sources/pyside6/tests/signals/signal_autoconnect_test.py
index 4f8a5cb76..864f3ead5 100644
--- a/sources/pyside6/tests/signals/signal_autoconnect_test.py
+++ b/sources/pyside6/tests/signals/signal_autoconnect_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_connectiontype_support_test.py b/sources/pyside6/tests/signals/signal_connectiontype_support_test.py
index a66ff3915..e984492b6 100644
--- a/sources/pyside6/tests/signals/signal_connectiontype_support_test.py
+++ b/sources/pyside6/tests/signals/signal_connectiontype_support_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_emission_gui_test.py b/sources/pyside6/tests/signals/signal_emission_gui_test.py
index 93e30d5d8..f4aa7c856 100644
--- a/sources/pyside6/tests/signals/signal_emission_gui_test.py
+++ b/sources/pyside6/tests/signals/signal_emission_gui_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_emission_test.py b/sources/pyside6/tests/signals/signal_emission_test.py
index c580be200..550804c12 100644
--- a/sources/pyside6/tests/signals/signal_emission_test.py
+++ b/sources/pyside6/tests/signals/signal_emission_test.py
@@ -35,7 +35,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_enum_test.py b/sources/pyside6/tests/signals/signal_enum_test.py
index d5b5fa179..d7e67052f 100644
--- a/sources/pyside6/tests/signals/signal_enum_test.py
+++ b/sources/pyside6/tests/signals/signal_enum_test.py
@@ -31,7 +31,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_func_test.py b/sources/pyside6/tests/signals/signal_func_test.py
index 41a360711..7e8c8f762 100644
--- a/sources/pyside6/tests/signals/signal_func_test.py
+++ b/sources/pyside6/tests/signals/signal_func_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_manager_refcount_test.py b/sources/pyside6/tests/signals/signal_manager_refcount_test.py
index b33cdfe76..5bc1b30db 100644
--- a/sources/pyside6/tests/signals/signal_manager_refcount_test.py
+++ b/sources/pyside6/tests/signals/signal_manager_refcount_test.py
@@ -34,7 +34,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_number_limit_test.py b/sources/pyside6/tests/signals/signal_number_limit_test.py
index 7c42e01d5..edf3ec077 100644
--- a/sources/pyside6/tests/signals/signal_number_limit_test.py
+++ b/sources/pyside6/tests/signals/signal_number_limit_test.py
@@ -33,7 +33,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_object_test.py b/sources/pyside6/tests/signals/signal_object_test.py
index d32bd4360..629a2e7f8 100644
--- a/sources/pyside6/tests/signals/signal_object_test.py
+++ b/sources/pyside6/tests/signals/signal_object_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_signature_test.py b/sources/pyside6/tests/signals/signal_signature_test.py
index d5f44f5b8..0e05494a1 100644
--- a/sources/pyside6/tests/signals/signal_signature_test.py
+++ b/sources/pyside6/tests/signals/signal_signature_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/signal_with_primitive_type_test.py b/sources/pyside6/tests/signals/signal_with_primitive_type_test.py
index e3c6c7f39..6afb762f6 100644
--- a/sources/pyside6/tests/signals/signal_with_primitive_type_test.py
+++ b/sources/pyside6/tests/signals/signal_with_primitive_type_test.py
@@ -32,7 +32,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/slot_reference_count_test.py b/sources/pyside6/tests/signals/slot_reference_count_test.py
index d319624e0..419cf9fb3 100644
--- a/sources/pyside6/tests/signals/slot_reference_count_test.py
+++ b/sources/pyside6/tests/signals/slot_reference_count_test.py
@@ -33,7 +33,8 @@ import sys
from sys import getrefcount
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/signals/static_metaobject_test.py b/sources/pyside6/tests/signals/static_metaobject_test.py
index a93475336..280a8b49c 100644
--- a/sources/pyside6/tests/signals/static_metaobject_test.py
+++ b/sources/pyside6/tests/signals/static_metaobject_test.py
@@ -34,7 +34,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)
diff --git a/sources/pyside6/tests/support/voidptr_test.py b/sources/pyside6/tests/support/voidptr_test.py
index 75692eb84..72bdeb8d4 100644
--- a/sources/pyside6/tests/support/voidptr_test.py
+++ b/sources/pyside6/tests/support/voidptr_test.py
@@ -30,7 +30,8 @@ import os
import sys
import unittest
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+from pathlib import Path
+sys.path.append(os.fspath(Path(__file__).resolve().parents[1]))
from init_paths import init_test_paths
init_test_paths(False)