diff options
| author | Christian Tismer <tismer@stackless.com> | 2022-03-09 19:00:02 +0100 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2022-03-11 10:18:16 +0100 |
| commit | 332b99ecda74e5d575d4ddcd2d86fa4ffc283e3c (patch) | |
| tree | 07ece950c1b89f586f80ee804d68cc5ab638a2a5 /sources/pyside6 | |
| parent | 6ffb2c3e852e2153b0c58ac659e7d8b60b691f19 (diff) | |
PyPySide: disable __feature__ completely, temporarily
PyPy is currently not able to handle feature switching.
This was disabled, internally only.
Be more consequent and avoid a misleading feature that
does not work.
This will be re-enabled as soon as PyPy is able to
exchange class dictionaries.
[ChangeLog][PySide6] Feature switching is not only disabled,
but also syntactically not allowed in PyPy.
Task-number: PYSIDE-535
Change-Id: Ic6a9ef3233db787e050a1ee5c913c24ae6650168
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6')
4 files changed, 27 insertions, 12 deletions
diff --git a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py index 91fa694fd..3ba65b071 100644 --- a/sources/pyside6/tests/QtCore/errormessages_with_features_test.py +++ b/sources/pyside6/tests/QtCore/errormessages_with_features_test.py @@ -48,7 +48,10 @@ init_test_paths(False) from PySide6 import QtCore from PySide6.QtWidgets import QApplication, QLabel -from PySide6.support import __feature__ + +is_pypy = hasattr(sys, "pypy_version_info") +if not is_pypy: + from PySide6.support import __feature__ import inspect @@ -64,8 +67,7 @@ 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") +@unittest.skipIf(is_pypy, "__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/multiple_feature_test.py b/sources/pyside6/tests/QtCore/multiple_feature_test.py index 9871baf5c..de26a09e1 100644 --- a/sources/pyside6/tests/QtCore/multiple_feature_test.py +++ b/sources/pyside6/tests/QtCore/multiple_feature_test.py @@ -47,7 +47,11 @@ from init_paths import init_test_paths init_test_paths(False) from PySide6.QtCore import QCborArray, QObject -from PySide6.support import __feature__ + +is_pypy = hasattr(sys, "pypy_version_info") +if not is_pypy: + from PySide6.support import __feature__ + from textwrap import dedent """ @@ -63,8 +67,7 @@ There is much more to come. MethodDescriptorType = type(str.split) -@unittest.skipIf(hasattr(sys, "pypy_version_info"), - "__feature__ cannot yet be used with PyPy") +@unittest.skipIf(is_pypy, "__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 754e853d5..ad28dbd0a 100644 --- a/sources/pyside6/tests/QtCore/snake_prop_feature_test.py +++ b/sources/pyside6/tests/QtCore/snake_prop_feature_test.py @@ -48,7 +48,10 @@ init_test_paths(False) from PySide6.QtCore import Property, QSize from PySide6.QtWidgets import QApplication, QMainWindow, QWidget -from PySide6.support import __feature__ + +is_pypy = hasattr(sys, "pypy_version_info") +if not is_pypy: + from PySide6.support import __feature__ """ snake_prop_feature_test.py @@ -65,8 +68,7 @@ class Window(QWidget): super().__init__() -@unittest.skipIf(hasattr(sys, "pypy_version_info"), - "__feature__ cannot yet be used with PyPy") +@unittest.skipIf(is_pypy, "__feature__ cannot yet be used with PyPy") class FeatureTest(unittest.TestCase): def setUp(self): qApp or QApplication() diff --git a/sources/pyside6/tests/pysidetest/constructor_properties_test.py b/sources/pyside6/tests/pysidetest/constructor_properties_test.py index 0ef016e9c..47d0d4eeb 100644 --- a/sources/pyside6/tests/pysidetest/constructor_properties_test.py +++ b/sources/pyside6/tests/pysidetest/constructor_properties_test.py @@ -50,17 +50,22 @@ from helper.usesqapplication import UsesQApplication from PySide6.QtCore import Qt from PySide6.QtGui import QColor, QAction from PySide6.QtWidgets import QApplication, QLabel, QFrame -from PySide6.support import __feature__ + +is_pypy = hasattr(sys, "pypy_version_info") +if not is_pypy: + from PySide6.support import __feature__ class ConstructorPropertiesTest(unittest.TestCase): def setUp(self): qApp or QApplication() - __feature__.set_selection(0x80) # FIXME: 0 is insecure + if not is_pypy: + __feature__.set_selection(0x80) # FIXME: 0 is insecure def tearDown(self): - __feature__.set_selection(0) + if not is_pypy: + __feature__.set_selection(0) qApp.shutdown() # PYSIDE-1019: First property extension was support by the constructor. @@ -77,6 +82,7 @@ class ConstructorPropertiesTest(unittest.TestCase): )) # PYSIDE-1705: The same with snake_case + @unittest.skipIf(is_pypy, "feature switching is not yet possible in PyPy") def testCallConstructor_snake(self): from __feature__ import snake_case @@ -92,6 +98,7 @@ class ConstructorPropertiesTest(unittest.TestCase): )) # PYSIDE-1705: The same with true_property + @unittest.skipIf(is_pypy, "feature switching is not yet possible in PyPy") def testCallConstructor_prop(self): from __feature__ import true_property @@ -107,6 +114,7 @@ class ConstructorPropertiesTest(unittest.TestCase): )) # PYSIDE-1705: The same with snake_case and true_property + @unittest.skipIf(is_pypy, "feature switching is not yet possible in PyPy") def testCallConstructor_prop_snake(self): from __feature__ import snake_case, true_property |
