From 318cd6643c051c931c95ee094bbff31d49811002 Mon Sep 17 00:00:00 2001 From: Christian Tismer Date: Sun, 18 Apr 2021 18:58:18 +0200 Subject: PyPySide: skip tests which involve __feature__ The __feature__ option needs to be skipped in PyPy. Task-number: PYSIDE-535 Change-Id: I8606c8305c85f2a1418da536f6a937b6845d19fd Reviewed-by: Friedemann Kleint --- .../pyside6/tests/QtCore/errormessages_with_features_test.py | 2 ++ sources/pyside6/tests/QtCore/feature_with_uic_test.py | 12 ++++++++++-- sources/pyside6/tests/QtCore/multiple_feature_test.py | 2 ++ sources/pyside6/tests/QtCore/snake_prop_feature_test.py | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py index 72452a588..28b5e0d1d 100644 --- a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py +++ b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py @@ -61,6 +61,8 @@ This test is in its own file because combining it with """ +@unittest.skipIf(hasattr(sys, "pypy_version_info"), + "__feature__ cannot yet be used with PyPy") class ErrormessagesWithFeatures(unittest.TestCase): probe = "called with wrong argument types" probe_miss = "missing signature" diff --git a/sources/pyside6/tests/QtCore/feature_with_uic_test.py b/sources/pyside6/tests/QtCore/feature_with_uic_test.py index 09f25e585..bb6cc9b40 100644 --- a/sources/pyside6/tests/QtCore/feature_with_uic_test.py +++ b/sources/pyside6/tests/QtCore/feature_with_uic_test.py @@ -62,9 +62,15 @@ from helper.usesqapplication import UsesQApplication from PySide6.QtCore import QCoreApplication, QLibraryInfo, qVersion from PySide6.QtWidgets import QApplication, QMainWindow -from __feature__ import snake_case +# PYSIDE-535: We cannot use __feature__ in PyPy, yet +try: + from __feature__ import snake_case -from feature_with_uic.window import Ui_MainWindow + from feature_with_uic.window import Ui_MainWindow + have_feature = True +except ImportError: + Ui_MainWindow = object + have_feature = False class MainWindow(QMainWindow, Ui_MainWindow): @@ -74,6 +80,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.setupUi(self) +@unittest.skipIf(hasattr(sys, "pypy_version_info"), + "__feature__ cannot yet be used with PyPy") class FeatureTest(UsesQApplication): def testFeaturesWorkWithUIC(self): diff --git a/sources/pyside6/tests/QtCore/multiple_feature_test.py b/sources/pyside6/tests/QtCore/multiple_feature_test.py index 0a66075ae..9871baf5c 100644 --- a/sources/pyside6/tests/QtCore/multiple_feature_test.py +++ b/sources/pyside6/tests/QtCore/multiple_feature_test.py @@ -63,6 +63,8 @@ There is much more to come. MethodDescriptorType = type(str.split) +@unittest.skipIf(hasattr(sys, "pypy_version_info"), + "__feature__ cannot yet be used with PyPy") class FeaturesTest(unittest.TestCase): def testAllFeatureCombinations(self): diff --git a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py index 7925c4c0c..393570e4f 100644 --- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py +++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py @@ -64,6 +64,8 @@ class Window(QWidget): super().__init__() +@unittest.skipIf(hasattr(sys, "pypy_version_info"), + "__feature__ cannot yet be used with PyPy") class FeatureTest(unittest.TestCase): def setUp(self): qApp or QApplication() -- cgit v1.2.3