diff options
Diffstat (limited to 'sources/pyside2/tests/registry/existence_test.py')
-rw-r--r-- | sources/pyside2/tests/registry/existence_test.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/sources/pyside2/tests/registry/existence_test.py b/sources/pyside2/tests/registry/existence_test.py index 0313bd9f8..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,9 +67,15 @@ List entry """ import os +import re import sys -import unittest from textwrap import dedent +import unittest + +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from init_paths import init_all_test_paths +init_all_test_paths() + from init_platform import enum_all, generate_all from util import (isolate_warnings, check_warnings, suppress_warnings, warn, is_ci, qt_version, get_script_dir, get_effective_refpath, @@ -100,6 +106,13 @@ except SyntaxError: print("*** not a python file, removed:", shortpath) os.unlink(effectiveRefPath) have_refmodule = False +except NameError as e: + if "recreate" in e.args[0]: + print("*** explicit request to recreate:", shortpath) + else: + print("*** unexpected NameError:", e, "- creating", shortpath) + os.unlink(effectiveRefPath) + have_refmodule = False dict_name = "sig_dict" if have_refmodule and not hasattr(sig_exists, dict_name): print("*** wrong module without '{dict_name}', removed:" @@ -132,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 ( |