diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-04-06 11:14:25 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-04-06 15:29:32 +0200 |
commit | 04d45f0429c6c6d8eae9c4fcf269ffbcc7d074d8 (patch) | |
tree | 8ad179ccdec7bd45042e15619542b704eac3e867 /sources/pyside6/tests/QtWidgets | |
parent | 27bb3f7839d9673b125f8b1b775c4398293932e2 (diff) |
Port tests to pathlib
Replace test helper function adjust_filename() by pathlib
handling. Add asserts on the existence everywhere. Add error
handling with helper functions to QML loading, printing the
error message in the assert statements.
Task-number: PYSIDE-1499
Task-number: PYSIDE-1532
Change-Id: I206929effb37f21d1f621be921bb996162398b4d
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/tests/QtWidgets')
-rw-r--r-- | sources/pyside6/tests/QtWidgets/qimage_test.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sources/pyside6/tests/QtWidgets/qimage_test.py b/sources/pyside6/tests/QtWidgets/qimage_test.py index dc7f4854f..38b71a7af 100644 --- a/sources/pyside6/tests/QtWidgets/qimage_test.py +++ b/sources/pyside6/tests/QtWidgets/qimage_test.py @@ -39,7 +39,6 @@ init_test_paths(False) from PySide6.QtGui import * from PySide6.QtWidgets import * -from helper.helper import adjust_filename from helper.usesqapplication import UsesQApplication xpm = [ @@ -279,7 +278,9 @@ class QImageTest(UsesQApplication): def testQImageStringBuffer(self): '''Test if the QImage signatures receiving string buffers exist.''' - img0 = QImage(adjust_filename('sample.png', __file__)) + file = Path(__file__).resolve().parent / 'sample.png' + self.assertTrue(file.is_file()) + img0 = QImage(os.fspath(file)) # btw let's test the bits() method img1 = QImage(img0.bits(), img0.width(), img0.height(), img0.format()) |