diff options
Diffstat (limited to 'sources/pyside2/tests/pysidetest/signature_test.py')
-rw-r--r-- | sources/pyside2/tests/pysidetest/signature_test.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sources/pyside2/tests/pysidetest/signature_test.py b/sources/pyside2/tests/pysidetest/signature_test.py index 7fa0ab6fc..583b793eb 100644 --- a/sources/pyside2/tests/pysidetest/signature_test.py +++ b/sources/pyside2/tests/pysidetest/signature_test.py @@ -45,7 +45,6 @@ import unittest from collections import OrderedDict from pprint import pprint import PySide2 -from PySide2 import * """ This test shows that we have over 14500 signatures, @@ -55,7 +54,6 @@ and that they all can be created. all_modules = list("PySide2." + x for x in PySide2.__all__) from PySide2.support.signature import parser, inspect -parser._BREAK_ON_ERROR = True _do_print = True if os.isatty(sys.stdout.fileno()) else False @@ -64,6 +62,7 @@ def dprint(*args, **kw): print(*args, **kw) def enum_module(mod_name): + __import__(mod_name) count = 0 module = sys.modules[mod_name] dprint() @@ -114,7 +113,11 @@ class PySideSignatureTest(unittest.TestCase): result = enum_all() # We omit the number of functions test. This is too vague. for mod_name, count in result.items(): - pass #self.assertGreaterEqual(count, ref_result[mod_name]) + pass + # If an attribute could not be computed, then we will have a warning + # in the warningregistry. + if hasattr(parser, "__warningregistry__"): + raise RuntimeError("There are errors, see above.") def testSignatureExist(self): t1 = type(PySide2.QtCore.QObject.children.__signature__) @@ -144,7 +147,7 @@ class PySideSignatureTest(unittest.TestCase): self.assertTrue(ob1 is ob2) def testModuleIsInitialized(self): - assert QtWidgets.QApplication.__signature__ is not None + assert PySide2.QtWidgets.QApplication.__signature__ is not None if __name__ == "__main__": unittest.main() |