[tests] allow testing for types + values

This commit is contained in:
Mike Fährmann
2025-01-12 19:17:46 +01:00
parent 2b46b82f9c
commit 42070240ae
2 changed files with 4 additions and 1 deletions

View File

@@ -50,7 +50,10 @@ __tests__ = (
"following" : False,
"hero" : bool,
"id" : int,
"last_name" : {str, None},
"location" : {str, None},
"slug" : str,
"username" : {str, None},
},
},

View File

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