diff options
| author | Christian Tismer <tismer@stackless.com> | 2024-06-07 14:57:14 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2024-06-12 09:41:45 +0200 |
| commit | ad18260e583a30505e42b04fd242c52ff36f735c (patch) | |
| tree | b214b18e06b9df8df41e61b9c043c8b5f8324e5b /sources/pyside6/tests/pysidetest/enum_test.py | |
| parent | 70b083842b95f3e11f315a2a0bdd5fe6b2ee705d (diff) | |
Do the transition to Python 3.13, GIL-part
* opcodes have changed numbers. That made "import *" etc. fail.
* PUSH_NULL is sometimes inserted before a call.
* enum_test needed an overhaul due to opcode changes.
Python 3.13 works fine.
Supporting --disable-gil is a different issue.
Task-number: PYSIDE-2751
Change-Id: I37b447148787e2923a58c091a5c8ac808d579bc0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6/tests/pysidetest/enum_test.py')
| -rw-r--r-- | sources/pyside6/tests/pysidetest/enum_test.py | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/sources/pyside6/tests/pysidetest/enum_test.py b/sources/pyside6/tests/pysidetest/enum_test.py index 832834530..7afc5b948 100644 --- a/sources/pyside6/tests/pysidetest/enum_test.py +++ b/sources/pyside6/tests/pysidetest/enum_test.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 The Qt Company Ltd. +# Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import os @@ -50,6 +50,8 @@ class ListConnectionTest(unittest.TestCase): # PYSIDE-1735: We are testing that opcodes do what they are supposed to do. # This is needed in the PyEnum forgiveness mode where we need # to introspect the code if an Enum was called with no args. + +# flake8: noqa class InvestigateOpcodesTest(unittest.TestCase): def probe_function1(self): @@ -162,25 +164,40 @@ class InvestigateOpcodesTest(unittest.TestCase): self.assertEqual(self.read_code(self.probe_function2, adaptive=True), result_3) self.assertEqual(self.get_sizes(self.probe_function2, adaptive=True), sizes_3) - if sys.version_info[:2] >= (3, 12): + if sys.version_info[:2] == (3, 12): - result_1 = [('RESUME', 151, 0), - ('LOAD_GLOBAL', 116, 0), - ('LOAD_ATTR', 106, 2), - ('STORE_FAST', 125, 1), + result_1 = [('RESUME', 151, 0), + ('LOAD_GLOBAL', 116, 0), + ('LOAD_ATTR', 106, 2), + ('STORE_FAST', 125, 1), ('RETURN_CONST', 121, 0)] - result_2 = [('RESUME', 151, 0), - ('LOAD_GLOBAL', 116, 1), - ('LOAD_ATTR', 106, 2), - ('CALL', 171, 0), - ('STORE_FAST', 125, 1), + result_2 = [('RESUME', 151, 0), + ('LOAD_GLOBAL', 116, 1), + ('LOAD_ATTR', 106, 2), + ('CALL', 171, 0), + ('STORE_FAST', 125, 1), ('RETURN_CONST', 121, 0)] + if sys.version_info[:2] >= (3, 13): + + result_1 = [('RESUME', 149, 0), + ('LOAD_GLOBAL', 91, 0), + ('LOAD_ATTR', 82, 2), + ('STORE_FAST', 110, 1), + ('RETURN_CONST', 103, 0)] + + result_2 = [('RESUME', 149, 0), + ('LOAD_GLOBAL', 91, 0), + ('LOAD_ATTR', 82, 2), + ('PUSH_NULL', 34, None), + ('CALL', 53, 0), + ('STORE_FAST', 110, 1), + ('RETURN_CONST', 103, 0)] + self.assertEqual(self.read_code(self.probe_function1), result_1) self.assertEqual(self.read_code(self.probe_function2), result_2) if __name__ == '__main__': unittest.main() - |
