mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-02-17 09:33:05 -05:00
tests: Optimize run-tests.py test case dict iteration
Use a single iteration through the module dictionary rather than iterating over the keys and separately fetching values to get the function. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
4cfe369b98
commit
6ac593ec47
@ -161,10 +161,9 @@ def main():
|
|||||||
logger.debug("Import test cases from " + t)
|
logger.debug("Import test cases from " + t)
|
||||||
mod = __import__(m.group(1))
|
mod = __import__(m.group(1))
|
||||||
test_modules.append(mod.__name__.replace('test_', '', 1))
|
test_modules.append(mod.__name__.replace('test_', '', 1))
|
||||||
for s in dir(mod):
|
for key,val in mod.__dict__.iteritems():
|
||||||
if s.startswith("test_"):
|
if key.startswith("test_"):
|
||||||
func = mod.__dict__.get(s)
|
tests.append(val)
|
||||||
tests.append(func)
|
|
||||||
test_names = list(set([t.__name__.replace('test_', '', 1) for t in tests]))
|
test_names = list(set([t.__name__.replace('test_', '', 1) for t in tests]))
|
||||||
|
|
||||||
run = None
|
run = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user