Skip to content

Commit

Permalink
new: dev: @refactor Turned runner into a package to allow multiple im…
Browse files Browse the repository at this point in the history
…plementations

Right now, only the old runner (pyvows.runner.gevent) is the only one that works.

However, it passes tests for me, and the ABC class for runners will (in the future) allow pyvows to use the best available means to run tests according to the users’ system.
  • Loading branch information
Zearin committed May 27, 2013
1 parent 83d12bd commit 6bf8345
Show file tree
Hide file tree
Showing 9 changed files with 406 additions and 341 deletions.
2 changes: 1 addition & 1 deletion pyvows/cli.py
Expand Up @@ -125,7 +125,7 @@ def __init__(self, description=Messages.summary, **kwargs):
def run(path, pattern, verbosity, show_progress, exclusion_patterns=None):
# FIXME: Add Docstring

# This calls Vows.run(), which then calls VowsParallelRunner.run()
# This calls Vows.run(), which then calls VowsRunner.run()

# needs to be imported here, else the no-color option won't work
from pyvows.core import Vows
Expand Down
4 changes: 2 additions & 2 deletions pyvows/core.py
Expand Up @@ -18,7 +18,7 @@
from pyvows import utils
from pyvows.async_topic import VowsAsyncTopic, VowsAsyncTopicValue
from pyvows.decorators import _batch, async_topic
from pyvows.runner import VowsParallelRunner
from pyvows.runner import VowsRunner

#-------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -168,7 +168,7 @@ def run(cls, on_vow_success, on_vow_error):
#
# * Used by `run()` in `cli.py`
# * Please add a useful description if you wrote this! :)
runner = VowsParallelRunner(cls.suites,
runner = VowsRunner(cls.suites,
cls.Context,
on_vow_success,
on_vow_error,
Expand Down
330 changes: 0 additions & 330 deletions pyvows/runner.py

This file was deleted.

15 changes: 15 additions & 0 deletions pyvows/runner/__init__.py
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
'''This package contains different runtime implementations for PyVows. PyVows will
select the fastest possible runner, using fallbacks if unavailable.
'''


try:
## GEvent
from pyvows.runner.gevent import VowsParallelRunner as VowsRunner
except ImportError as e:
## Sequential
from pyvows.runner.sequential import VowsSequentialRunner as VowsRunner
finally:
__all__ = ('VowsRunner')

0 comments on commit 6bf8345

Please sign in to comment.