aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/tests/pysidetest/enum_test.py
Commit message (Collapse)AuthorAgeFilesLines
* Lazy Load: Remove exclusion for testbindingFriedemann Kleint2025-08-051-2/+2
| | | | | | | | | Use .value to compare against the Enum value in a hidden namespace. Task-number: PYSIDE-2404 Change-Id: I2a7bda2aeac6aa69b3d38d2e377ac9b1127e1fee Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Enumerations: Enable the forgiveness feature ENOPT_NO_ZERODEFAULT for 3.14Friedemann Kleint2025-07-281-3/+26
| | | | | | | | | | | Adapt the op codes for detecting a parameterless __init__() call in enum code to 3.14. Pick-to: 6.9 6.8 Task-number: PYSIDE-3147 Task-number: PYSIDE-1735 Change-Id: I7dcaaae82b4c136db5dbd9ef36519783b73c15ce Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Disable GIL: Remove NoGIL codeFriedemann Kleint2025-07-091-1/+0
| | | | | | | | The new approach is disable-gil. Task-number: PYSIDE-2221 Change-Id: I1b1e783883aa2e94f62548385d3f19b61cf6d1ed Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6/Tests: Use fully qualified enumerationsFriedemann Kleint2024-12-201-6/+6
| | | | | | | | | As a drive-by fix flake errors. Pick-to: 6.8 Task-number: PYSIDE-1735 Change-Id: I9829b011fee78fc8edd1aefdd3066ae89e63644b Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Raise Python version to 3.8Friedemann Kleint2024-12-031-9/+0
| | | | | | | | | | | | | | Fix some oversights of previous changes: - Bump limited API - Fix CMake files - Remove outdated version checks from Python code - Adapt some documentation Pick-to: 6.8 Task-number: PYSIDE-2943 Change-Id: Id8d9c4c6bb0629948de28beb3c4274991f84ff08 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Python-3.10: Allow the new syntax for Python 3.9Christian Tismer2024-06-201-0/+1
| | | | | | | | Add a future statement to all Python source files. Task-number: PYSIDE-2786 Change-Id: Icd6688c7795a9e16fdcaa829686d57792df27690 Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
* Do the transition to Python 3.13, GIL-partChristian Tismer2024-06-121-12/+29
| | | | | | | | | | | | | * 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>
* Tests: Fix some flake warningsFriedemann Kleint2023-11-281-2/+4
| | | | | | | | Mostly spacing related. Pick-to: 6.6 Change-Id: I748a8a06f456c5d4bafb94c397c43b3b2ee9e3e9 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
* Support running PySide on Python 3.12Christian Tismer2023-10-091-1/+18
| | | | | | | | | | | | | | | | | | Builtin types no longer have tp_dict set. We need to use PyType_GetDict, instead. This works without Limited API at the moment. With some great cheating, this works with Limited API, too. We emulate PyType_GetDict by tp_dict if that is not 0. Otherwise we create an empty dict. Some small changes to Exception handling and longer warm-up in leaking tests were found, too. Pick-to: 6.6 6.5 6.2 Task-number: PYSIDE-2230 Change-Id: I8a56de6208ec00979255b39b5784dfc9b4b92def Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* NoGIL: Disable opcode tests in enum_test.pyChristian Tismer2023-02-091-0/+2
| | | | | | | | | | | | The enum_test.py uses opcode inspection to make sure that changed opcodes hopefully trigger an error. For the immature NoGIL Python version, this makes no sense. Task-number: PYSIDE-2221 Change-Id: If101f49f97c5120a84672581d24336999718611a Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PyEnum: Increase compatibility by allowing defaults and old flag namesChristian Tismer2022-07-141-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch supports to write Qt.Alignment() instead of Qt.AlignmentFlag(0) Also supported is Qt.AlignmentFlag() which is mapped to Qt.AlignmentFlag(0) This trickery was quite involved since the Python opcodes needed to be analyzed if we have a parameterless call. Only in that case, we insert a partial object which supplies the missing value=0 default. Changing the implementation of PyEnum was not desired because this is highly complicated, not portable and even not possible. The change has been tested with Python 3.6 to 3.11.0b3 . [ChangeLog][shiboken6] The new Python enums are made as compatible to the old ones as possible. It is again allowed to use Qt.Alignment() instead of Qt.AlignmentFlag(0), and a default of 0 is always allowed. Change-Id: If6a93f8210ff6cae4e38251420e1ad5fffbe42cb Pick-to: 6.3 Task-number: PYSIDE-1735 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Use SPDX license identifiersLucie Gérard2022-05-271-29/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: I065150015bdb84a3096b5b39c061cf0a20ab637d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* PySide6: Fix QFlags comparison to selfFriedemann Kleint2021-10-271-0/+23
| | | | | | | | | | The result was set to true unconditionally when self == other. Fix and rearrange the code. Fixes: PYSIDE-1696 Pick-to: 6.2 5.15 Change-Id: I8892d0f6439186d8629c5a24347fc1ce700ecb58 Reviewed-by: Christian Tismer <tismer@stackless.com>
* Tests: Fix some space-related flake8 warningsFriedemann Kleint2021-04-291-0/+2
| | | | | Change-Id: I9b0ad08839bf1246620c557ec304dfa90882907b Reviewed-by: Christian Tismer <tismer@stackless.com>
* Switch from os.path to pathlib.Path, systematic test changesChristian Tismer2021-02-081-1/+2
| | | | | | | | | | | | | | | | | | 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 <cristian.maureira-fredes@qt.io>
* Rename PySide2 to PySide6Friedemann Kleint2020-11-021-0/+51
Adapt CMake files, build scripts, tests and examples. Task-number: PYSIDE-904 Change-Id: I845f7b006e9ad274fed5444ec4c1f9dbe176ff88 Reviewed-by: Christian Tismer <tismer@stackless.com>