- When a configuration conflict is encountered during scanning, the conflict
exception now shows the decorator information that caused the conflict.
- Depend on Venusian >= 0.5 (for scanning conflict exception decoration).
| | |
| | | - Make it possible to succesfully run all tests via ``nosetests`` command |
| | | directly (rather than indirectly via ``python setup.py nosetests``). |
| | | |
| | | - When a configuration conflict is encountered during scanning, the conflict |
| | | exception now shows the decorator information that caused the conflict. |
| | | |
| | | Features |
| | | -------- |
| | | |
| | |
| | | |
| | | - Added ``debug_routematch = false`` to all paster templates. |
| | | |
| | | Dependencies |
| | | ------------ |
| | | |
| | | - Depend on Venusian >= 0.5 (for scanning conflict exception decoration). |
| | | |
| | | 1.0a6 (2010-12-15) |
| | | ================== |
| | | |
| | |
| | | def wrapper(self, *arg, **kw): |
| | | if self._ainfo is None: |
| | | self._ainfo = [] |
| | | try: |
| | | f = traceback.extract_stack(limit=3) |
| | | info = f[-2] |
| | | except: # pragma: no cover |
| | | info = '' |
| | | info = kw.pop('_info', None) |
| | | if info is None: |
| | | try: |
| | | f = traceback.extract_stack(limit=3) |
| | | info = f[-2] |
| | | except: # pragma: no cover |
| | | info = '' |
| | | self._ainfo.append(info) |
| | | try: |
| | | result = wrapped(self, *arg, **kw) |
| | |
| | | else: # pragma: no cover |
| | | raise AssertionError |
| | | |
| | | def test_scan_conflict(self): |
| | | from zope.configuration.config import ConfigurationConflictError |
| | | from pyramid.tests import selfscanapp |
| | | from pyramid.config import Configurator |
| | | c = Configurator() |
| | | c.scan(selfscanapp) |
| | | c.scan(selfscanapp) |
| | | try: |
| | | c.commit() |
| | | except ConfigurationConflictError, why: |
| | | def scanconflicts(e): |
| | | conflicts = e._conflicts.values() |
| | | for conflict in conflicts: |
| | | for confinst in conflict: |
| | | yield confinst[3] |
| | | c1, c2, c3, c4 = scanconflicts(why) |
| | | self.assertEqual(c1, "@view_config(renderer='string')") |
| | | self.assertEqual(c2, "@view_config(renderer='string')") |
| | | self.assertEqual(c3, "@view_config(name='two', renderer='string')") |
| | | self.assertEqual(c4, "@view_config(name='two', renderer='string')") |
| | | |
| | | def _conflictFunctions(self, e): |
| | | conflicts = e._conflicts.values() |
| | | for conflict in conflicts: |
| | |
| | | class DummyVenusianInfo(object): |
| | | scope = 'notaclass' |
| | | module = sys.modules['pyramid.tests'] |
| | | codeinfo = 'codeinfo' |
| | | |
| | | class DummyVenusian(object): |
| | | def __init__(self, info=None): |
| | |
| | | if renderer_name is not None and not isinstance(renderer_name, dict): |
| | | settings['renderer'] = {'name':renderer_name, |
| | | 'package':info.module} |
| | | settings['_info'] = info.codeinfo |
| | | return wrapped |
| | | |
| | | bfg_view = view_config # permanent b/c |
| | |
| | | 'zope.configuration', |
| | | 'zope.deprecation', |
| | | 'zope.interface >= 3.5.1', # 3.5.0 comment: "allow to bootstrap on jython" |
| | | 'venusian >= 0.2', |
| | | 'venusian >= 0.5', # ``codeinfo`` |
| | | 'translationstring', |
| | | ] |
| | | |