launcher: Cleanup the way we find python test command line
authorThibault Saunier <tsaunier@igalia.com>
Sat, 26 Jan 2019 01:06:14 +0000 (22:06 -0300)
committerThibault Saunier <tsaunier@gnome.org>
Sat, 26 Jan 2019 15:54:00 +0000 (15:54 +0000)
By setting it before the test base class adds the current testsuite name in the classname

validate/launcher/apps/pyunittest.py

index daeac62..08aef10 100644 (file)
@@ -26,9 +26,13 @@ from launcher.baseclasses import TestsManager
 
 class PythonTest(Test):
 
+    def __init__(self, *args, **kwargs):
+        super().__init__(*args, **kwargs)
+        self._testname = self.classname
+
     def build_arguments(self):
         """Builds subprocess arguments."""
-        self.add_arguments('-m', 'unittest', '.'.join(self.classname.split('.')[1:]))
+        self.add_arguments('-m', 'unittest', self._testname)
 
 
 class PythonTestsManager(TestsManager):