diff options
| author | Christian Tismer <tismer@stackless.com> | 2020-05-04 17:38:04 +0200 |
|---|---|---|
| committer | Christian Tismer <tismer@stackless.com> | 2020-05-16 15:05:44 +0200 |
| commit | cde603ba2c4fe7db1711aaf033f796112a840e7d (patch) | |
| tree | 86419ff84b2926399c3b54faa154a8efa3a75e78 /sources/pyside2/tests/registry/existence_test.py | |
| parent | a49bc6164a95494b914d1428507e10ec16888229 (diff) | |
Implement __qualname__ and correct __module__ for classes
PyType_FromSpec breaks the name "A.B.C.D" in module "A.B.C"
and name = qualname = "D".
We fix that for PySide:
module = "A.B"
qualname = "C.D"
name = "D"
and for other prefixes like Shiboken:
module = "A"
qualname = "B.C.D"
name = "D"
This had quite some impact on the signature modules.
Change-Id: Ie94971ba737107b15adbfc2517e1ed32b65fda39
Fixes: PYSIDE-1286
Task-number: PYSIDE-15
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests/registry/existence_test.py')
| -rw-r--r-- | sources/pyside2/tests/registry/existence_test.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sources/pyside2/tests/registry/existence_test.py b/sources/pyside2/tests/registry/existence_test.py index 4bfd63cc3..b8a42058d 100644 --- a/sources/pyside2/tests/registry/existence_test.py +++ b/sources/pyside2/tests/registry/existence_test.py @@ -1,6 +1,6 @@ ############################################################################# ## -## Copyright (C) 2019 The Qt Company Ltd. +## Copyright (C) 2020 The Qt Company Ltd. ## Contact: https://www.qt.io/licensing/ ## ## This file is part of Qt for Python. @@ -67,6 +67,7 @@ List entry """ import os +import re import sys from textwrap import dedent import unittest @@ -144,8 +145,19 @@ class TestSignaturesExists(unittest.TestCase): name = key.rsplit(".", 1)[-1] if name in ("next", "__next__"): # ignore problematic cases continue + if "<" in key: + # Skip over remaining crap in "<...>" + continue + if key.startswith("sample.SampleNamespace"): + # We cannot work with sample namespaces after the change to __qualname__. + continue + if (key.startswith("smart.SharedPtr") or + re.match(r"PySide2\..*?\.QSharedPointer_", key)): + # These mangled names are not supported. + # We should fix them. + continue if key not in found_sigs: - warn("missing key: '{}'".format(key), stacklevel=3) + warn("missing key: '{} value={}'".format(key, value), stacklevel=3) else: found_val = found_sigs[key] if type(value) is list and ( |
