From 11c443016275093e4c713a3fbafdaea8967fca7c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 25 Jun 2018 13:38:12 +0200 Subject: existence_test.py: Make multi signature mismatch message more verbose It now looks like: multi-signature count mismatch for 'QOpenGLShaderProgram.setAttributeArray'. Actual 10 [ (int,PySide2.QtGui.QVector2D,int) (int,PySide2.QtGui.QVector3D,int) (int,PySide2.QtGui.QVector4D,int) (int,float,int,int) (int,int,int,int,int) (str,PySide2.QtGui.QVector2D,int) (str,PySide2.QtGui.QVector3D,int) (str,PySide2.QtGui.QVector4D,int) (str,float,int,int) (str,int,int,int,int)] vs. expected 4 [ (int,float,int,int) (int,int,int,int,int) (str,float,int,int) (str,int,int,int,int)]') Change-Id: I6c99e1fceeeb1647c8b3b291564190b9a2c0dd32 Reviewed-by: Cristian Maureira-Fredes Reviewed-by: Christian Tismer --- sources/pyside2/tests/registry/existence_test.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'sources') diff --git a/sources/pyside2/tests/registry/existence_test.py b/sources/pyside2/tests/registry/existence_test.py index ef2a9b804..6e870385d 100644 --- a/sources/pyside2/tests/registry/existence_test.py +++ b/sources/pyside2/tests/registry/existence_test.py @@ -81,6 +81,16 @@ if have_refmodule and not hasattr(sig_exists, "dict"): os.unlink(effectiveRefPath) have_refmodule = False +def formatSignatures(signatures): + result = '' + for s in signatures: + result += ' ({})'.format(','.join(s)) + return result + +def msgMultiSignatureCount(key, actual, expected): + return "multi-signature count mismatch for '{}'. Actual {} [{}] vs. expected {} [{}]')".format(key, + len(actual), formatSignatures(actual), + len(expected), formatSignatures(expected)) @unittest.skipIf(not have_refmodule, "not activated for this platform or version") @@ -101,7 +111,7 @@ class TestSignaturesExists(unittest.TestCase): if key not in found_sigs: warn("missing key: '{}'".format(key)) elif isinstance(value, list) and len(value) != len(found_sigs[key]): - warn("multi-signature count mismatch: '{}'".format(key)) + warn(msgMultiSignatureCount(key, found_sigs[key], value)) if is_ci and check_warnings(): raise RuntimeError("There are errors, see above.") @@ -117,7 +127,7 @@ class TestSignaturesExists(unittest.TestCase): if key not in found_sigs: warn("missing key: '{}'".format(key)) elif isinstance(value, list) and len(value) != len(found_sigs[key]): - warn("multi-signature count mismatch: '{}'".format(key)) + warn(msgMultiSignatureCount(key, found_sigs[key], value)) self.assertTrue(check_warnings()) tested_versions = (5, 6), (5, 9), (5, 11) -- cgit v1.2.3