backport from master of fix for zope.interface and warnings squashing see https://github.com/Pylons/pyramid/commit/c9888fcafe4b78924fc0f8b55c4730667bba8558
| | |
| | | backwards incompatibility when methods that declared only a request |
| | | argument were used. See https://github.com/Pylons/pyramid/issues/503 |
| | | |
| | | - Fix an incompatibility under Python 3.X with ``zope.interface`` 4.0. |
| | | ``Symptom: TypeError: Class advice impossible in Python3. Use the |
| | | @provider class decorator instead.`` |
| | | |
| | | 1.3b3 (2012-03-17) |
| | | ================== |
| | | |
| | |
| | | |
| | | from zope.interface import ( |
| | | Interface, |
| | | classProvides, |
| | | implementedBy, |
| | | implementer, |
| | | provider, |
| | | ) |
| | | |
| | | from zope.interface.interfaces import IInterface |
| | |
| | | return decorator(view) |
| | | |
| | | @implementer(IViewMapper) |
| | | @provider(IViewMapperFactory) |
| | | class DefaultViewMapper(object): |
| | | classProvides(IViewMapperFactory) |
| | | def __init__(self, **kw): |
| | | self.attr = kw.get('attr') |
| | | |
| | |
| | | path = self._getPath() |
| | | r = self._makeOne(path, content_type='image/jpeg') |
| | | self.assertEqual(r.content_type, 'image/jpeg') |
| | | r.app_iter.close() |
| | | |
| | | def test_without_content_type(self): |
| | | path = self._getPath() |
| | | r = self._makeOne(path) |
| | | self.assertEqual(r.content_type, 'text/plain') |
| | | r.app_iter.close() |
| | | |
| | | class TestFileIter(unittest.TestCase): |
| | | def _makeOne(self, file, block_size): |