diff --git a/src/e3/testsuite/__init__.py b/src/e3/testsuite/__init__.py index 2307e74..a7984e7 100644 --- a/src/e3/testsuite/__init__.py +++ b/src/e3/testsuite/__init__.py @@ -73,7 +73,7 @@ class TestAbort(Exception): class TestsuiteCore: """Testsuite Core driver. - This class is the base of Testsuite class and should not be instanciated. + This class is the base of Testsuite class and should not be instantiated. It's not recommended to override any of the functions declared in it. See documentation of Testsuite class for overridable methods and @@ -1071,9 +1071,14 @@ def collect_result(job: Job) -> bool: return False # Create a scheduler to run all fragments for the testsuite main loop + + jobs = self.main.args.jobs + if self.main.args.jobs <= 0: + jobs = os.cpu_count() or 1 + scheduler = Scheduler( job_provider=job_factory, - tokens=self.main.args.jobs, + tokens=jobs, collect=collect_result, )