[tests] improve error message of multi type/value tests

improvement of 42070240ae
This commit is contained in:
Mike Fährmann
2025-03-14 18:59:57 +01:00
parent 31e57bafab
commit 5fa5a45f03

View File

@@ -241,7 +241,10 @@ class TestExtractorResults(unittest.TestCase):
elif isinstance(test, range):
self.assertRange(value, test, msg=path)
elif isinstance(test, set):
self.assertTrue(value in test or type(value) in test, msg=path)
try:
self.assertIn(value, test, msg=path)
except AssertionError:
self.assertIn(type(value), test, msg=path)
elif isinstance(test, list):
subtest = False
for idx, item in enumerate(test):