jenkins-bot merged this change.
[tests] Give a better failure message for paraminfo_tests
Currently we get an assertion error listing two sets when the first set
is not greater or equal than the second.
Now calculate the difference which values are in the second and not
in the first set as expected.
This is an improvement to detect the missing parameter in the first.
Bug: T218506
Change-Id: Ibcdffd5050c136805d48bf5dddd67011d81d84d7
---
M tests/paraminfo_tests.py
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/paraminfo_tests.py b/tests/paraminfo_tests.py
index 8ae81d0..63e501a 100644
--- a/tests/paraminfo_tests.py
+++ b/tests/paraminfo_tests.py
@@ -49,7 +49,12 @@
def _check_param_superset(self, site, module, parameter, expected):
"""Check that a parameter only contains entries in expected list."""
values = self._get_param_values(site, module, parameter)
- self.assertGreaterEqual(set(expected), set(values))
+ exp = set(expected)
+ val = set(values)
+ if not exp.issuperset(val):
+ diff = val - exp
+ self.fail('Unexpected param{} {} in values'
+ .format('s' if len(diff) > 1 else '', diff))
class MediaWikiKnownTypesTestCase(KnownTypesTestBase,
To view, visit change 497101. To unsubscribe, or for help writing mail filters, visit settings.