Permalink
Browse files

Provide an option for WidgetTest to exclude engines.

  • Loading branch information...
ralphbean committed May 26, 2012
1 parent d130c3c commit c822b2a6699c98a87bf7dbe9510d7709c023b5d0
Showing with 10 additions and 1 deletion.
  1. +1 −1 setup.py
  2. +9 −0 tw2/core/testbase/base.py
@@ -51,7 +51,7 @@ def get_description(fname='README.rst'):
setup(
name='tw2.core',
version='2.1.0a2',
version='2.1.0a3',
description="Web widget creation toolkit based on TurboGears widgets",
long_description = get_description(),
install_requires=requires,
@@ -160,6 +160,10 @@ class WidgetTest(object):
`wrap`
Wrap expected and the result in an element. Useful if the template
generates an xml snippet with more than one top level element.
`engines`
A list of engines to try tests with. Defaults to all of them.
"""
template_engine = 'string'
@@ -172,6 +176,8 @@ class WidgetTest(object):
validate_params = None
wrap = False
engines = templating.rendering_extension_lookup.keys()
def request(self, requestid, mw=None):
if mw is None:
mw = self.mw
@@ -194,13 +200,16 @@ def setup(self):
)
if self.declarative:
self.widget = TW2WidgetBuilder(self.widget, **self.attrs)
return self.request(1)
def _get_all_possible_engines(self):
for engine in templating.rendering_extension_lookup:
yield engine
def _check_rendering_vs_expected(self, engine, attrs, params, expected):
if self.engines and engine not in self.engines:
raise SkipTest("%r not in engines %r" % (engine, self.engines))
_request_id = None
templating.engine_name_cache = {}
mw = tmw.make_middleware(None, preferred_rendering_engines=[engine])

0 comments on commit c822b2a

Please sign in to comment.