From 48e007cb29666991f1f3b7bc8849a765bab1f566 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 17 Feb 2020 10:32:48 -0300 Subject: [PATCH] validate:launcher: Never try to load a testsuite with the same name from different locations --- validate/launcher/baseclasses.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/validate/launcher/baseclasses.py b/validate/launcher/baseclasses.py index bdb1b6c267..9553a8d67f 100644 --- a/validate/launcher/baseclasses.py +++ b/validate/launcher/baseclasses.py @@ -1664,7 +1664,7 @@ class _TestsLauncher(Loggable): return (None, exceptions) def _load_testsuites(self): - testsuites = set() + testsuites = {} for testsuite in self.options.testsuites: if testsuite.endswith('.py') and os.path.exists(testsuite): testsuite = os.path.abspath(os.path.expanduser(testsuite)) @@ -1686,13 +1686,17 @@ class _TestsLauncher(Loggable): testsuite, loaded_module[1]), Colors.FAIL) continue - testsuites.add(module) + if module.__name__ in testsuites: + self.info("Trying to load testsuite '%s' a second time?", module.__name__) + continue + + testsuites[module.__name__] = module if not hasattr(module, "TEST_MANAGER"): module.TEST_MANAGER = [tester.name for tester in self.testers] elif not isinstance(module.TEST_MANAGER, list): module.TEST_MANAGER = [module.TEST_MANAGER] - self.options.testsuites = list(testsuites) + self.options.testsuites = list(testsuites.values()) def _setup_testsuites(self): for testsuite in self.options.testsuites: