diff options
| -rw-r--r-- | CHANGES.txt | 9 | ||||
| -rw-r--r-- | docs/Makefile | 2 | ||||
| -rw-r--r-- | docs/conf.py | 12 | ||||
| -rw-r--r-- | docs/index.rst | 4 | ||||
| -rw-r--r-- | docs/narr/assets.rst | 2 | ||||
| -rw-r--r-- | docs/narr/introduction.rst | 2 | ||||
| -rw-r--r-- | pyramid/events.py | 4 | ||||
| -rw-r--r-- | pyramid/tests/test_integration.py | 9 | ||||
| -rw-r--r-- | pyramid/tests/test_mako_templating.py | 3 | ||||
| -rw-r--r-- | pyramid/tests/test_static.py | 8 | ||||
| -rw-r--r-- | pyramid/tests/test_view.py | 3 | ||||
| -rw-r--r-- | pyramid/view.py | 3 |
12 files changed, 44 insertions, 17 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 2e2b2291d..9859fbf14 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -10,6 +10,15 @@ Features - Lone instance methods can now be treated as view callables (see https://github.com/Pylons/pyramid/pull/283). +Bug Fixes +--------- + +- Make test suite pass on 32-bit systems; closes #286. closes #306. + See also https://github.com/Pylons/pyramid/issues/286 + +- The ``pryamid.view.view_config`` decorator did not accept a ``match_params`` + predicate argument. See https://github.com/Pylons/pyramid/pull/308 + Backwards Incompatibilities --------------------------- diff --git a/docs/Makefile b/docs/Makefile index 1d032cf45..92dc56fda 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ # # You can set these variables from the command line. -SPHINXOPTS = +SPHINXOPTS = -W SPHINXBUILD = sphinx-build PAPER = diff --git a/docs/conf.py b/docs/conf.py index a5eaeb0fb..c78285840 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,7 +11,8 @@ # All configuration values have a default value; values that are commented out # serve to show the default value. -import sys, os +import sys +import os import datetime import inspect import warnings @@ -389,7 +390,7 @@ def frontmatter(name, arguments, options, content, lineno, % reset page counter \setcounter{page}{1} % suppress first toc pagenum -\addtocontents{toc}{\protect\thispagestyle{empty}} +\addtocontents{toc}{\protect\thispagestyle{empty}} """, format='latex')] @@ -402,7 +403,7 @@ def mainmatter(name, arguments, options, content, lineno, % allow part/chapter/section numbering \setcounter{secnumdepth}{2} % get headers back -\pagestyle{fancy} +\pagestyle{fancy} \fancyhf{} \renewcommand{\headrulewidth}{0.5pt} \renewcommand{\footrulewidth}{0pt} @@ -488,7 +489,10 @@ epub_uid = 'The Pyramid Web Application Development Framework, Version 1.2' #epub_post_files = [] # A list of files that should not be packed into the epub file. -#epub_exclude_files = [] +epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', + '_static/jquery.js', '_static/searchtools.js', '_static/underscore.js', + '_static/basic.css', 'search.html'] + # The depth of the table of contents in toc.ncx. epub_tocdepth = 3 diff --git a/docs/index.rst b/docs/index.rst index 25aaab7af..e4de8b0c8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -229,10 +229,12 @@ Index and Glossary * :ref:`search` -.. add glossary in hidden toc tree so it does not complain its not included +.. add glossary, foreword, and latexindex in a hidden toc to avoid warnings .. toctree:: :hidden: glossary + foreword.rst + latexindex.rst diff --git a/docs/narr/assets.rst b/docs/narr/assets.rst index cd76f7b60..4f80d33c7 100644 --- a/docs/narr/assets.rst +++ b/docs/narr/assets.rst @@ -335,7 +335,7 @@ your application root as below. .. code-block:: python :linenos: - from pyramid.static import static + from pyramid.static import static_view static_view = static_view('/path/to/static/dir', use_subpath=True) .. note:: For better cross-system flexibility, use an :term:`asset diff --git a/docs/narr/introduction.rst b/docs/narr/introduction.rst index e30a23a9a..547f88ef3 100644 --- a/docs/narr/introduction.rst +++ b/docs/narr/introduction.rst @@ -826,7 +826,7 @@ trolls" or other people who seem to get their rocks off by berating fellow users in our various offical support channels. We try to keep it well-lit and new-user-friendly. -Example: Visit irc://freenode.net#pyramid (the ``#pyramid`` channel on +Example: Visit irc\://freenode.net#pyramid (the ``#pyramid`` channel on irc.freenode.net in an IRC client) or the pylons-discuss maillist at http://groups.google.com/group/pylons-discuss/ . diff --git a/pyramid/events.py b/pyramid/events.py index a495d9c29..5ef60ea89 100644 --- a/pyramid/events.py +++ b/pyramid/events.py @@ -75,7 +75,7 @@ class subscriber(object): class NewRequest(object): """ An instance of this class is emitted as an :term:`event` whenever :app:`Pyramid` begins to process a new request. The - even instance has an attribute, ``request``, which is a + event instance has an attribute, ``request``, which is a :term:`request` object. This event class implements the :class:`pyramid.interfaces.INewRequest` interface.""" def __init__(self, request): @@ -172,7 +172,7 @@ class BeforeRender(dict): This event object iself has a dictionary-like interface that can be used for this purpose. For example:: - from repoze.events import subscriber + from pyramid.events import subscriber from pyramid.events import BeforeRender @subscriber(BeforeRender) diff --git a/pyramid/tests/test_integration.py b/pyramid/tests/test_integration.py index 0c17b88ce..2210f8fff 100644 --- a/pyramid/tests/test_integration.py +++ b/pyramid/tests/test_integration.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +import datetime import os import unittest @@ -11,6 +12,9 @@ from pyramid.compat import url_quote from zope.interface import Interface +# 5 years from now (more or less) +fiveyrsfuture = datetime.datetime.utcnow() + datetime.timedelta(5*365) + class INothing(Interface): pass @@ -92,7 +96,7 @@ class TestStaticAppBase(IntegrationBase): def test_not_modified(self): self.testapp.extra_environ = { - 'HTTP_IF_MODIFIED_SINCE':httpdate(pow(2, 32)-1)} + 'HTTP_IF_MODIFIED_SINCE':httpdate(fiveyrsfuture)} res = self.testapp.get('/minimal.pt', status=304) self.assertEqual(res.body, b'') @@ -574,7 +578,8 @@ class DummyRequest: def httpdate(ts): import datetime - ts = datetime.datetime.utcfromtimestamp(ts) + if isinstance(ts, int): + ts = datetime.datetime.utcfromtimestamp(ts) return ts.strftime("%a, %d %b %Y %H:%M:%S GMT") def read_(filename): diff --git a/pyramid/tests/test_mako_templating.py b/pyramid/tests/test_mako_templating.py index 074d28b85..981a5056e 100644 --- a/pyramid/tests/test_mako_templating.py +++ b/pyramid/tests/test_mako_templating.py @@ -74,7 +74,8 @@ class Test_renderer_factory(Base, unittest.TestCase): }) self._callFUT(info) lookup = self.config.registry.getUtility(IMakoLookup) - module_path = os.path.dirname(sys.modules['__main__'].__file__) + module_path = os.path.dirname( + sys.modules['__main__'].__file__).rstrip('.') # ./setup.py self.assertEqual(lookup.directories, [ os.path.join(module_path, 'a'), os.path.join(module_path, 'b')]) diff --git a/pyramid/tests/test_static.py b/pyramid/tests/test_static.py index 9fdf29637..a04a47397 100644 --- a/pyramid/tests/test_static.py +++ b/pyramid/tests/test_static.py @@ -1,5 +1,9 @@ +import datetime import unittest +# 5 years from now (more or less) +fiveyrsfuture = datetime.datetime.utcnow() + datetime.timedelta(5*365) + class Test_static_view_use_subpath_False(unittest.TestCase): def _getTargetClass(self): from pyramid.static import static_view @@ -138,7 +142,7 @@ class Test_static_view_use_subpath_False(unittest.TestCase): def test_resource_notmodified(self): inst = self._makeOne('pyramid.tests:fixtures/static') request = self._makeRequest({'PATH_INFO':'/index.html'}) - request.if_modified_since = pow(2, 32) -1 + request.if_modified_since = fiveyrsfuture context = DummyContext() response = inst(context, request) start_response = DummyStartResponse() @@ -303,7 +307,7 @@ class Test_static_view_use_subpath_True(unittest.TestCase): def test_resource_notmodified(self): inst = self._makeOne('pyramid.tests:fixtures/static') request = self._makeRequest() - request.if_modified_since = pow(2, 32) -1 + request.if_modified_since = fiveyrsfuture request.subpath = ('index.html',) context = DummyContext() response = inst(context, request) diff --git a/pyramid/tests/test_view.py b/pyramid/tests/test_view.py index 29e468cd2..1bdb066c0 100644 --- a/pyramid/tests/test_view.py +++ b/pyramid/tests/test_view.py @@ -276,13 +276,14 @@ class TestViewConfigDecorator(unittest.TestCase): def test_create_nondefaults(self): decorator = self._makeOne(name=None, request_type=None, for_=None, permission='foo', mapper='mapper', - decorator='decorator') + decorator='decorator', match_param='match_param') self.assertEqual(decorator.name, None) self.assertEqual(decorator.request_type, None) self.assertEqual(decorator.context, None) self.assertEqual(decorator.permission, 'foo') self.assertEqual(decorator.mapper, 'mapper') self.assertEqual(decorator.decorator, 'decorator') + self.assertEqual(decorator.match_param, 'match_param') def test_call_function(self): decorator = self._makeOne() diff --git a/pyramid/view.py b/pyramid/view.py index 581e42185..13d5cfe7b 100644 --- a/pyramid/view.py +++ b/pyramid/view.py @@ -175,7 +175,7 @@ class view_config(object): containment=None, attr=None, renderer=None, wrapper=None, xhr=False, accept=None, header=None, path_info=None, custom_predicates=(), context=None, decorator=None, - mapper=None, http_cache=None): + mapper=None, http_cache=None, match_param=None): self.name = name self.request_type = request_type self.context = context or for_ @@ -195,6 +195,7 @@ class view_config(object): self.decorator = decorator self.mapper = mapper self.http_cache = http_cache + self.match_param = match_param def __call__(self, wrapped): settings = self.__dict__.copy() |
