Permalink
Browse files

Passing 'worker_threads_set_size' to the ParallelStoryRunner.

  • Loading branch information...
1 parent 44882cd commit 368fc6e2ca8a23a8ea87cec460fa37c2113321f5 @guilhermechapiewski guilhermechapiewski committed Sep 21, 2009
Showing with 5 additions and 2 deletions.
  1. +1 −0 pyccuracy/common.py
  2. +1 −1 pyccuracy/core.py
  3. +1 −0 pyccuracy/pyccuracy_console.py
  4. +2 −1 pyccuracy/story_runner.py
View
@@ -150,6 +150,7 @@ def __init__(self,
self.browser_to_run = self.get_setting(settings, "browser_to_run", "chrome")
self.browser_driver = self.get_setting(settings, "browser_driver", "selenium")
self.worker_threads = int(self.get_setting(settings, "workers", 1))
+ self.worker_threads_set_size = int(self.get_setting(settings, "workers_set_size", 1))
self.extra_args = self.get_setting(settings, "extra_args", {})
self.on_scenario_started = self.get_setting(settings, "on_scenario_started", None)
self.on_scenario_completed = self.get_setting(settings, "on_scenario_completed", None)
View
@@ -57,7 +57,7 @@ def run_tests(self, context=None, fso=None, **kwargs):
context = Context(settings)
if not self.runner:
- self.runner = context.settings.worker_threads == 1 and StoryRunner() or ParallelStoryRunner(settings.worker_threads)
+ self.runner = context.settings.worker_threads == 1 and StoryRunner() or ParallelStoryRunner(settings.worker_threads, settings.self.worker_threads_set_size)
for directory in context.settings.pages_dir:
self.import_extra_content(directory, fso=fso)
@@ -123,6 +123,7 @@ def main():
browser_driver=options.browser_driver,
should_throw=options.should_throw,
workers=workers,
+ workers_set_size=workers_set_size,
extra_args=extra_args,
on_scenario_started=int(options.verbosity) > 1 and update_progress or None,
on_scenario_completed=update_progress,
@@ -101,8 +101,9 @@ def create_context_for(self, settings):
return Context(settings)
class ParallelStoryRunner(StoryRunner):
- def __init__(self, number_of_threads):
+ def __init__(self, number_of_threads, worker_threads_set_size):
self.number_of_threads = number_of_threads
+ self.worker_threads_set_size = worker_threads_set_size
self.test_queue = Queue()
def run_stories(self, settings, fixture, context=None):

0 comments on commit 368fc6e

Please sign in to comment.