{
    "file_diffs": [
        {
            "old_file_content": ".. index::\n   single: URL dispatch\n\n.. _urldispatch_chapter:\n\nURL Dispatch\n============\n\n:term:`URL dispatch` provides a simple way to map URLs to :term:`view` code\nusing a simple pattern matching language.  An ordered set of patterns is\nchecked one-by-one.  If one of the patterns matches the path information\nassociated with a request, a particular :term:`view callable` is invoked.  A\nview callable is a specific bit of code, defined in your application, that\nreceives the :term:`request` and returns a :term:`response` object.\n\nHigh-Level Operational Overview\n-------------------------------\n\nIf any route configuration is present in an application, the :app:`Pyramid`\n:term:`Router` checks every incoming request against an ordered set of URL\nmatching patterns present in a *route map*.\n\nIf any route pattern matches the information in the :term:`request`,\n:app:`Pyramid` will invoke the :term:`view lookup` process to find a\nmatching view.\n\nIf no route pattern in the route map matches the information in the\n:term:`request` provided in your application, :app:`Pyramid` will fail over\nto using :term:`traversal` to perform resource location and view lookup.\n\n.. index::\n   single: route configuration\n\nRoute Configuration\n-------------------\n\n:term:`Route configuration` is the act of adding a new :term:`route` to an\napplication.  A route has a *name*, which acts as an identifier to be used\nfor URL generation.  The name also allows developers to associate a view\nconfiguration with the route.  A route also has a *pattern*, meant to match\nagainst the ``PATH_INFO`` portion of a URL (the portion following the scheme\nand port, e.g. ``/foo/bar`` in the URL `<http://localhost:8080/foo/bar>`_). It\nalso optionally has a ``factory`` and a set of :term:`route predicate`\nattributes.\n\n.. index::\n   single: add_route\n\n.. _config-add-route:\n\nConfiguring a Route to Match a View\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe :meth:`pyramid.config.Configurator.add_route` method adds a single\n:term:`route configuration` to the :term:`application registry`.  Here's an\nexample:\n\n.. code-block:: python\n\n   # \"config\" below is presumed to be an instance of the\n   # pyramid.config.Configurator class; \"myview\" is assumed\n   # to be a \"view callable\" function\n   from views import myview\n   config.add_route('myroute', '/prefix/{one}/{two}')\n   config.add_view(myview, route_name='myroute')\n\nWhen a :term:`view callable` added to the configuration by way of\n:meth:`~pyramid.config.Configurator.add_view` becomes associated with a route\nvia its ``route_name`` predicate, that view callable will always be found and\ninvoked when the associated route pattern matches during a request.\n\nMore commonly, you will not use any ``add_view`` statements in your project's\n\"setup\" code. You will instead use ``add_route`` statements, and use a\n:term:`scan` to associate view callables with routes.  For example, if\nthis is a portion of your project's ``__init__.py``:\n\n.. code-block:: python\n\n   config.add_route('myroute', '/prefix/{one}/{two}')\n   config.scan('mypackage')\n\nNote that we don't call :meth:`~pyramid.config.Configurator.add_view` in this\nsetup code.  However, the above :term:`scan` execution\n``config.scan('mypackage')`` will pick up each :term:`configuration\ndecoration`, including any objects decorated with the\n:class:`pyramid.view.view_config` decorator in the ``mypackage`` Python\npackage.  For example, if you have a ``views.py`` in your package, a scan will\npick up any of its configuration decorators, so we can add one there\nthat references ``myroute`` as a ``route_name`` parameter:\n\n.. code-block:: python\n\n   from pyramid.view import view_config\n   from pyramid.response import Response\n\n   @view_config(route_name='myroute')\n   def myview(request):\n       return Response('OK')\n\nThe above combination of ``add_route`` and ``scan`` is completely equivalent\nto using the previous combination of ``add_route`` and ``add_view``.\n\n.. index::\n   single: route path pattern syntax\n\n.. _route_pattern_syntax:\n\n\nRoute Pattern Syntax\n~~~~~~~~~~~~~~~~~~~~\n\nThe syntax of the pattern matching language used by :app:`Pyramid` URL\ndispatch in the *pattern* argument is straightforward; it is close to that of\nthe :term:`Routes` system used by :term:`Pylons`.\n\nThe *pattern* used in route configuration may start with a slash character.\nIf the pattern does not start with a slash character, an implicit slash will\nbe prepended to it at matching time.  For example, the following patterns are\nequivalent:\n\n.. code-block:: text\n\n   {foo}/bar/baz\n\nand:\n\n.. code-block:: text\n\n   /{foo}/bar/baz\n\nIf a pattern is a valid URL it won't be ever matched against an incoming\nrequest. Instead it can be useful for generating external URLs. See\n:ref:`External routes <external_route_narr>` for details.\n\nA pattern segment (an individual item between ``/`` characters in the\npattern) may either be a literal string (e.g. ``foo``) *or* it may be a\nreplacement marker (e.g. ``{foo}``) or a certain combination of both. A\nreplacement marker does not need to be preceded by a ``/`` character.\n\nA replacement marker is in the format ``{name}``, where this means \"accept\nany characters up to the next slash character and use this as the ``name``\n:term:`matchdict` value.\"\n\nA replacement marker in a pattern must begin with an uppercase or lowercase\nASCII letter or an underscore, and can be composed only of uppercase or\nlowercase ASCII letters, underscores, and numbers.  For example: ``a``,\n``a_b``, ``_b``, and ``b9`` are all valid replacement marker names, but\n``0a`` is not.\n\n.. note:: A replacement marker could not start with an underscore until\n   Pyramid 1.2.  Previous versions required that the replacement marker start\n   with an uppercase or lowercase letter.\n\nA matchdict is the dictionary representing the dynamic parts extracted from a\nURL based on the routing pattern.  It is available as ``request.matchdict``.\nFor example, the following pattern defines one literal segment (``foo``) and\ntwo replacement markers (``baz``, and ``bar``):\n\n.. code-block:: text\n\n   foo/{baz}/{bar}\n\nThe above pattern will match these URLs, generating the following matchdicts:\n\n.. code-block:: text\n\n   foo/1/2        -> {'baz':u'1', 'bar':u'2'}\n   foo/abc/def    -> {'baz':u'abc', 'bar':u'def'}\n\nIt will not match the following patterns however:\n\n.. code-block:: text\n\n   foo/1/2/        -> No match (trailing slash)\n   bar/abc/def     -> First segment literal mismatch\n\nThe match for a segment replacement marker in a segment will be done only up\nto the first non-alphanumeric character in the segment in the pattern.  So,\nfor instance, if this route pattern was used:\n\n.. code-block:: text\n\n   foo/{name}.html\n\nThe literal path ``/foo/biz.html`` will match the above route pattern, and\nthe match result will be ``{'name':u'biz'}``.  However, the literal path\n``/foo/biz`` will not match, because it does not contain a literal ``.html``\nat the end of the segment represented by ``{name}.html`` (it only contains\n``biz``, not ``biz.html``).\n\nTo capture both segments, two replacement markers can be used:\n\n.. code-block:: text\n\n    foo/{name}.{ext}\n\nThe literal path ``/foo/biz.html`` will match the above route pattern, and\nthe match result will be ``{'name': 'biz', 'ext': 'html'}``. This occurs\nbecause there is a literal part of ``.`` (period) between the two replacement\nmarkers ``{name}`` and ``{ext}``.\n\nReplacement markers can optionally specify a regular expression which will be\nused to decide whether a path segment should match the marker.  To specify\nthat a replacement marker should match only a specific set of characters as\ndefined by a regular expression, you must use a slightly extended form of\nreplacement marker syntax.  Within braces, the replacement marker name must\nbe followed by a colon, then directly thereafter, the regular expression.\nThe *default* regular expression associated with a replacement marker\n``[^/]+`` matches one or more characters which are not a slash.  For example,\nunder the hood, the replacement marker ``{foo}`` can more verbosely be\nspelled as ``{foo:[^/]+}``.  You can change this to be an arbitrary regular\nexpression to match an arbitrary sequence of characters, such as\n``{foo:\\d+}`` to match only digits.\n\nIt is possible to use two replacement markers without any literal characters\nbetween them, for instance ``/{foo}{bar}``. However, this would be a\nnonsensical pattern without specifying a custom regular expression to\nrestrict what each marker captures.\n\nSegments must contain at least one character in order to match a segment\nreplacement marker.  For example, for the URL ``/abc/``:\n\n- ``/abc/{foo}`` will not match.\n\n- ``/{foo}/`` will match.\n\nNote that values representing matched path segments will be url-unquoted and\ndecoded from UTF-8 into Unicode within the matchdict.  So for instance, the\nfollowing pattern:\n\n.. code-block:: text\n\n   foo/{bar}\n\nWhen matching the following URL:\n\n.. code-block:: text\n\n   http://example.com/foo/La%20Pe%C3%B1a\n\nThe matchdict will look like so (the value is URL-decoded / UTF-8 decoded):\n\n.. code-block:: text\n\n   {'bar':u'La Pe\\xf1a'}\n\nLiteral strings in the path segment should represent the *decoded* value of\nthe ``PATH_INFO`` provided to Pyramid.  You don't want to use a URL-encoded\nvalue or a bytestring representing the literal's UTF-8 in the pattern.  For\nexample, rather than this:\n\n.. code-block:: text\n\n   /Foo%20Bar/{baz}\n\nYou'll want to use something like this:\n\n.. code-block:: text\n\n   /Foo Bar/{baz}\n\nFor patterns that contain \"high-order\" characters in its literals, you'll\nwant to use a Unicode value as the pattern as opposed to any URL-encoded or\nUTF-8-encoded value.  For example, you might be tempted to use a bytestring\npattern like this:\n\n.. code-block:: text\n\n   /La Pe\\xc3\\xb1a/{x}\n\nBut this will either cause an error at startup time or it won't match\nproperly.  You'll want to use a Unicode value as the pattern instead rather\nthan raw bytestring escapes.  You can use a high-order Unicode value as the\npattern by using `Python source file encoding\n<http://www.python.org/dev/peps/pep-0263/>`_ plus the \"real\" character in the\nUnicode pattern in the source, like so:\n\n.. code-block:: text\n\n   /La Peña/{x}\n\nOr you can ignore source file encoding and use equivalent Unicode escape\ncharacters in the pattern.\n\n.. code-block:: text\n\n   /La Pe\\xf1a/{x}\n\nDynamic segment names cannot contain high-order characters, so this applies\nonly to literals in the pattern.\n\nIf the pattern has a ``*`` in it, the name which follows it is considered a\n\"remainder match\".  A remainder match *must* come at the end of the pattern.\nUnlike segment replacement markers, it does not need to be preceded by a\nslash.  For example:\n\n.. code-block:: text\n\n   foo/{baz}/{bar}*fizzle\n\nThe above pattern will match these URLs, generating the following matchdicts:\n\n.. code-block:: text\n\n   foo/1/2/           ->\n            {'baz':u'1', 'bar':u'2', 'fizzle':()}\n\n   foo/abc/def/a/b/c  ->\n            {'baz':u'abc', 'bar':u'def', 'fizzle':(u'a', u'b', u'c')}\n\nNote that when a ``*stararg`` remainder match is matched, the value put into\nthe matchdict is turned into a tuple of path segments representing the\nremainder of the path.  These path segments are url-unquoted and decoded from\nUTF-8 into Unicode.  For example, for the following pattern:\n\n.. code-block:: text\n\n   foo/*fizzle\n\nWhen matching the following path:\n\n.. code-block:: text\n\n   /foo/La%20Pe%C3%B1a/a/b/c\n\nWill generate the following matchdict:\n\n.. code-block:: text\n\n   {'fizzle':(u'La Pe\\xf1a', u'a', u'b', u'c')}\n\nBy default, the ``*stararg`` will parse the remainder sections into a tuple\nsplit by segment. Changing the regular expression used to match a marker can\nalso capture the remainder of the URL, for example:\n\n.. code-block:: text\n\n    foo/{baz}/{bar}{fizzle:.*}\n\nThe above pattern will match these URLs, generating the following matchdicts:\n\n.. code-block:: text\n\n   foo/1/2/           -> {'baz':u'1', 'bar':u'2', 'fizzle':u''}\n   foo/abc/def/a/b/c  -> {'baz':u'abc', 'bar':u'def', 'fizzle': u'a/b/c'}\n\nThis occurs because the default regular expression for a marker is ``[^/]+``\nwhich will match everything up to the first ``/``, while ``{fizzle:.*}`` will\nresult in a regular expression match of ``.*`` capturing the remainder into a\nsingle value.\n\n.. index::\n   single: route ordering\n\nRoute Declaration Ordering\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nRoute configuration declarations are evaluated in a specific order when a\nrequest enters the system. As a result, the order of route configuration\ndeclarations is very important.  The order that routes declarations are\nevaluated is the order in which they are added to the application at startup\ntime.  (This is unlike a different way of mapping URLs to code that\n:app:`Pyramid` provides, named :term:`traversal`, which does not depend on\npattern ordering).\n\nFor routes added via the :mod:`~pyramid.config.Configurator.add_route` method,\nthe order that routes are evaluated is the order in which they are added to\nthe configuration imperatively.\n\nFor example, route configuration statements with the following patterns might\nbe added in the following order:\n\n.. code-block:: text\n\n   members/{def}\n   members/abc\n\nIn such a configuration, the ``members/abc`` pattern would *never* be\nmatched. This is because the match ordering will always match\n``members/{def}`` first; the route configuration with ``members/abc`` will\nnever be evaluated.\n\n.. index::\n   single: route configuration arguments\n\nRoute Configuration Arguments\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nRoute configuration ``add_route`` statements may specify a large number of\narguments.  They are documented as part of the API documentation at\n:meth:`pyramid.config.Configurator.add_route`.\n\nMany of these arguments are :term:`route predicate` arguments.  A route\npredicate argument specifies that some aspect of the request must be true for\nthe associated route to be considered a match during the route matching\nprocess.  Examples of route predicate arguments are ``pattern``, ``xhr``, and\n``request_method``.\n\nOther arguments are ``name`` and ``factory``.  These arguments represent\nneither predicates nor view configuration information.\n\n.. index::\n   single: route matching\n\nRoute Matching\n--------------\n\nThe main purpose of route configuration is to match (or not match) the\n``PATH_INFO`` present in the WSGI environment provided during a request\nagainst a URL path pattern.  ``PATH_INFO`` represents the path portion of the\nURL that was requested.\n\nThe way that :app:`Pyramid` does this is very simple.  When a request enters\nthe system, for each route configuration declaration present in the system,\n:app:`Pyramid` checks the request's ``PATH_INFO`` against the pattern\ndeclared.  This checking happens in the order that the routes were declared\nvia :meth:`pyramid.config.Configurator.add_route`.\n\nWhen a route configuration is declared, it may contain :term:`route\npredicate` arguments.  All route predicates associated with a route\ndeclaration must be ``True`` for the route configuration to be used for a\ngiven request during a check.  If any predicate in the set of :term:`route\npredicate` arguments provided to a route configuration returns ``False``\nduring a check, that route is skipped and route matching continues through\nthe ordered set of routes.\n\nIf any route matches, the route matching process stops and the :term:`view\nlookup` subsystem takes over to find the most reasonable view callable for\nthe matched route.  Most often, there's only one view that will match (a view\nconfigured with a ``route_name`` argument matching the matched route).  To\ngain a better understanding of how routes and views are associated in a real\napplication, you can use the ``pviews`` command, as documented in\n:ref:`displaying_matching_views`.\n\nIf no route matches after all route patterns are exhausted, :app:`Pyramid`\nfalls back to :term:`traversal` to do :term:`resource location` and\n:term:`view lookup`.\n\n.. index::\n   single: matchdict\n\n.. _matchdict:\n\nThe Matchdict\n~~~~~~~~~~~~~\n\nWhen the URL pattern associated with a particular route configuration is\nmatched by a request, a dictionary named ``matchdict`` is added as an\nattribute of the :term:`request` object.  Thus, ``request.matchdict`` will\ncontain the values that match replacement patterns in the ``pattern``\nelement.  The keys in a matchdict will be strings.  The values will be\nUnicode objects.\n\n.. note::\n\n   If no route URL pattern matches, the ``matchdict`` object attached to the\n   request will be ``None``.\n\n.. index::\n   single: matched_route\n\n.. _matched_route:\n\nThe Matched Route\n~~~~~~~~~~~~~~~~~\n\nWhen the URL pattern associated with a particular route configuration is\nmatched by a request, an object named ``matched_route`` is added as an\nattribute of the :term:`request` object.  Thus, ``request.matched_route``\nwill be an object implementing the :class:`~pyramid.interfaces.IRoute`\ninterface which matched the request.  The most useful attribute of the route\nobject is ``name``, which is the name of the route that matched.\n\n.. note::\n\n   If no route URL pattern matches, the ``matched_route`` object attached to\n   the request will be ``None``.\n\nRouting Examples\n----------------\n\nLet's check out some examples of how route configuration statements might be\ncommonly declared, and what will happen if they are matched by the\ninformation present in a request.\n\n.. _urldispatch_example1:\n\nExample 1\n~~~~~~~~~\n\nThe simplest route declaration which configures a route match to *directly*\nresult in a particular view callable being invoked:\n\n.. code-block:: python\n    :linenos:\n\n    config.add_route('idea', 'site/{id}')\n    config.add_view('mypackage.views.site_view', route_name='idea')\n\nWhen a route configuration with a ``view`` attribute is added to the system,\nand an incoming request matches the *pattern* of the route configuration, the\n:term:`view callable` named as the ``view`` attribute of the route\nconfiguration will be invoked.\n\nIn the case of the above example, when the URL of a request matches\n``/site/{id}``, the view callable at the Python dotted path name\n``mypackage.views.site_view`` will be called with the request.  In other\nwords, we've associated a view callable directly with a route pattern.\n\nWhen the ``/site/{id}`` route pattern matches during a request, the\n``site_view`` view callable is invoked with that request as its sole\nargument.  When this route matches, a ``matchdict`` will be generated and\nattached to the request as ``request.matchdict``.  If the specific URL\nmatched is ``/site/1``, the ``matchdict`` will be a dictionary with a single\nkey, ``id``; the value will be the string ``'1'``, ex.: ``{'id':'1'}``.\n\nThe ``mypackage.views`` module referred to above might look like so:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.response import Response\n\n   def site_view(request):\n       return Response(request.matchdict['id'])\n\nThe view has access to the matchdict directly via the request, and can access\nvariables within it that match keys present as a result of the route pattern.\n\nSee :ref:`views_chapter`, and :ref:`view_config_chapter` for more\ninformation about views.\n\nExample 2\n~~~~~~~~~\n\nBelow is an example of a more complicated set of route statements you might\nadd to your application:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('idea', 'ideas/{idea}')\n   config.add_route('user', 'users/{user}')\n   config.add_route('tag', 'tags/{tag}')\n\n   config.add_view('mypackage.views.idea_view', route_name='idea')\n   config.add_view('mypackage.views.user_view', route_name='user')\n   config.add_view('mypackage.views.tag_view', route_name='tag')\n\nThe above configuration will allow :app:`Pyramid` to service URLs in these\nforms:\n\n.. code-block:: text\n\n   /ideas/{idea}\n   /users/{user}\n   /tags/{tag}\n\n- When a URL matches the pattern ``/ideas/{idea}``, the view callable\n  available at the dotted Python pathname ``mypackage.views.idea_view`` will\n  be called.  For the specific URL ``/ideas/1``, the ``matchdict`` generated\n  and attached to the :term:`request` will consist of ``{'idea':'1'}``.\n\n- When a URL matches the pattern ``/users/{user}``, the view callable\n  available at the dotted Python pathname ``mypackage.views.user_view`` will\n  be called.  For the specific URL ``/users/1``, the ``matchdict`` generated\n  and attached to the :term:`request` will consist of ``{'user':'1'}``.\n\n- When a URL matches the pattern ``/tags/{tag}``, the view callable available\n  at the dotted Python pathname ``mypackage.views.tag_view`` will be called.\n  For the specific URL ``/tags/1``, the ``matchdict`` generated and attached\n  to the :term:`request` will consist of ``{'tag':'1'}``.\n\nIn this example we've again associated each of our routes with a :term:`view\ncallable` directly.  In all cases, the request, which will have a\n``matchdict`` attribute detailing the information found in the URL by the\nprocess will be passed to the view callable.\n\nExample 3\n~~~~~~~~~\n\nThe :term:`context` resource object passed in to a view found as the result\nof URL dispatch will, by default, be an instance of the object returned by\nthe :term:`root factory` configured at startup time (the ``root_factory``\nargument to the :term:`Configurator` used to configure the application).\n\nYou can override this behavior by passing in a ``factory`` argument to the\n:meth:`~pyramid.config.Configurator.add_route` method for a particular route.\nThe ``factory`` should be a callable that accepts a :term:`request` and\nreturns an instance of a class that will be the context resource used by the\nview.\n\nAn example of using a route with a factory:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('idea', 'ideas/{idea}', factory='myproject.resources.Idea')\n   config.add_view('myproject.views.idea_view', route_name='idea')\n\nThe above route will manufacture an ``Idea`` resource as a :term:`context`,\nassuming that ``mypackage.resources.Idea`` resolves to a class that accepts a\nrequest in its ``__init__``.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   class Idea(object):\n       def __init__(self, request):\n           pass\n\nIn a more complicated application, this root factory might be a class\nrepresenting a :term:`SQLAlchemy` model.\n\nSee :ref:`route_factories` for more details about how to use route factories.\n\n.. index::\n   single: matching the root URL\n   single: root url (matching)\n   pair: matching; root URL\n\nMatching the Root URL\n---------------------\n\nIt's not entirely obvious how to use a route pattern to match the root URL\n(\"/\").  To do so, give the empty string as a pattern in a call to\n:meth:`~pyramid.config.Configurator.add_route`:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('root', '')\n\nOr provide the literal string ``/`` as the pattern:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('root', '/')\n\n.. index::\n   single: generating route URLs\n   single: route URLs\n\n.. _generating_route_urls:\n\nGenerating Route URLs\n---------------------\n\nUse the :meth:`pyramid.request.Request.route_url` method to generate URLs\nbased on route patterns.  For example, if you've configured a route with the\n``name`` \"foo\" and the ``pattern`` \"{a}/{b}/{c}\", you might do this.\n\n.. code-block:: python\n   :linenos:\n\n   url = request.route_url('foo', a='1', b='2', c='3')\n\nThis would return something like the string ``http://example.com/1/2/3`` (at\nleast if the current protocol and hostname implied ``http://example.com``).\n\nTo generate only the *path* portion of a URL from a route, use the\n:meth:`pyramid.request.Request.route_path` API instead of\n:meth:`~pyramid.request.Request.route_url`.\n\n.. code-block:: python\n\n   url = request.route_path('foo', a='1', b='2', c='3')\n\nThis will return the string ``/1/2/3`` rather than a full URL.\n\nReplacement values passed to ``route_url`` or ``route_path`` must be Unicode\nor bytestrings encoded in UTF-8.  One exception to this rule exists: if\nyou're trying to replace a \"remainder\" match value (a ``*stararg``\nreplacement value), the value may be a tuple containing Unicode strings or\nUTF-8 strings.\n\nNote that URLs and paths generated by ``route_path`` and ``route_url`` are\nalways URL-quoted string types (they contain no non-ASCII characters).\nTherefore, if you've added a route like so:\n\n.. code-block:: python\n\n   config.add_route('la', u'/La Peña/{city}')\n\nAnd you later generate a URL using ``route_path`` or ``route_url`` like so:\n\n.. code-block:: python\n\n   url = request.route_path('la', city=u'Québec')\n\nYou will wind up with the path encoded to UTF-8 and URL quoted like so:\n\n.. code-block:: text\n\n   /La%20Pe%C3%B1a/Qu%C3%A9bec\n\nIf you have a ``*stararg`` remainder dynamic part of your route pattern:\n\n.. code-block:: python\n\n   config.add_route('abc', 'a/b/c/*foo')\n\nAnd you later generate a URL using ``route_path`` or ``route_url`` using a\n*string* as the replacement value:\n\n.. code-block:: python\n\n   url = request.route_path('abc', foo=u'Québec/biz')\n\nThe value you pass will be URL-quoted except for embedded slashes in the\nresult:\n\n.. code-block:: text\n\n   /a/b/c/Qu%C3%A9bec/biz\n\nYou can get a similar result by passing a tuple composed of path elements:\n\n.. code-block:: python\n\n   url = request.route_path('abc', foo=(u'Québec', u'biz'))\n\nEach value in the tuple will be url-quoted and joined by slashes in this case:\n\n.. code-block:: text\n\n   /a/b/c/Qu%C3%A9bec/biz\n\n.. index::\n   single: static routes\n\n.. _static_route_narr:\n\nStatic Routes\n-------------\n\nRoutes may be added with a ``static`` keyword argument.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   config = Configurator()\n   config.add_route('page', '/page/{action}', static=True)\n\nRoutes added with a ``True`` ``static`` keyword argument will never be\nconsidered for matching at request time.  Static routes are useful for URL\ngeneration purposes only.  As a result, it is usually nonsensical to provide\nother non-``name`` and non-``pattern`` arguments to\n:meth:`~pyramid.config.Configurator.add_route` when ``static`` is passed as\n``True``, as none of the other arguments will ever be employed.  A single\nexception to this rule is use of the ``pregenerator`` argument, which is not\nignored when ``static`` is ``True``.\n\n:ref:`External routes <external_route_narr>` are implicitly static.\n\n.. versionadded:: 1.1\n   the ``static`` argument to :meth:`~pyramid.config.Configurator.add_route`\n\n.. _external_route_narr:\n\n\nExternal Routes\n---------------\n\n.. versionadded:: 1.5\n\nRoute patterns that are valid URLs, are treated as external routes. Like\n:ref:`static routes <static_route_narr>` they are useful for URL generation\npurposes only and are never considered for matching at request time.\n\n.. code-block:: python\n   :linenos:\n\n   >>> config = Configurator()\n   >>> config.add_route('youtube', 'https://youtube.com/watch/{video_id}')\n   ...\n   >>> request.route_url('youtube', video_id='oHg5SJYRHA0')\n   >>> \"https://youtube.com/watch/oHg5SJYRHA0\"\n\nMost pattern replacements and calls to\n:meth:`pyramid.request.Request.route_url` will work as expected. However, calls\nto :meth:`pyramid.request.Request.route_path` against external patterns will\nraise an exception, and passing ``_app_url`` to\n:meth:`~pyramid.request.Request.route_url` to generate a URL against a route\nthat has an external pattern will also raise an exception.\n\n.. index::\n   single: redirecting to slash-appended routes\n\n.. _redirecting_to_slash_appended_routes:\n\nRedirecting to Slash-Appended Routes\n------------------------------------\n\nFor behavior like Django's ``APPEND_SLASH=True``, use the ``append_slash``\nargument to :meth:`pyramid.config.Configurator.add_notfound_view` or the\nequivalent ``append_slash`` argument to the\n:class:`pyramid.view.notfound_view_config` decorator.\n\nAdding ``append_slash=True`` is a way to automatically redirect requests\nwhere the URL lacks a trailing slash, but requires one to match the proper\nroute.  When configured, along with at least one other route in your\napplication, this view will be invoked if the value of ``PATH_INFO`` does not\nalready end in a slash, and if the value of ``PATH_INFO`` *plus* a slash\nmatches any route's pattern.  In this case it does an HTTP redirect to the\nslash-appended ``PATH_INFO``.\n\nLet's use an example.  If the following routes are configured in your\napplication:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.httpexceptions import HTTPNotFound\n\n   def notfound(request):\n       return HTTPNotFound('Not found, bro.')\n\n   def no_slash(request):\n       return Response('No slash')\n\n   def has_slash(request):\n       return Response('Has slash')\n\n   def main(g, **settings):\n       config = Configurator()\n       config.add_route('noslash', 'no_slash')\n       config.add_route('hasslash', 'has_slash/')\n       config.add_view(no_slash, route_name='noslash')\n       config.add_view(has_slash, route_name='hasslash')\n       config.add_notfound_view(notfound, append_slash=True)\n\nIf a request enters the application with the ``PATH_INFO`` value of\n``/no_slash``, the first route will match and the browser will show \"No\nslash\".  However, if a request enters the application with the ``PATH_INFO``\nvalue of ``/no_slash/``, *no* route will match, and the slash-appending not\nfound view will not find a matching route with an appended slash.  As a\nresult, the ``notfound`` view will be called and it will return a \"Not found,\nbro.\" body.\n\nIf a request enters the application with the ``PATH_INFO`` value of\n``/has_slash/``, the second route will match.  If a request enters the\napplication with the ``PATH_INFO`` value of ``/has_slash``, a route *will* be\nfound by the slash-appending :term:`Not Found View`.  An HTTP redirect to\n``/has_slash/`` will be returned to the user's browser.  As a result, the\n``notfound`` view will never actually be called.\n\nThe following application uses the :class:`pyramid.view.notfound_view_config`\nand :class:`pyramid.view.view_config` decorators and a :term:`scan` to do\nexactly the same job:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.httpexceptions import HTTPNotFound\n   from pyramid.view import notfound_view_config, view_config\n\n   @notfound_view_config(append_slash=True)\n   def notfound(request):\n       return HTTPNotFound('Not found, bro.')\n\n   @view_config(route_name='noslash')\n   def no_slash(request):\n       return Response('No slash')\n\n   @view_config(route_name='hasslash')\n   def has_slash(request):\n       return Response('Has slash')\n\n   def main(g, **settings):\n       config = Configurator()\n       config.add_route('noslash', 'no_slash')\n       config.add_route('hasslash', 'has_slash/')\n       config.scan()\n\n.. warning::\n\n   You **should not** rely on this mechanism to redirect ``POST`` requests.\n   The redirect  of the slash-appending :term:`Not Found View` will turn a\n   ``POST`` request into a ``GET``, losing any ``POST`` data in the original\n   request.\n\nSee :ref:`view_module` and :ref:`changing_the_notfound_view` for a more\ngeneral description of how to configure a view and/or a :term:`Not Found View`.\n\n.. index::\n   pair: debugging; route matching\n\n.. _debug_routematch_section:\n\nDebugging Route Matching\n------------------------\n\nIt's useful to be able to take a peek under the hood when requests that enter\nyour application aren't matching your routes as you expect them to.  To debug\nroute matching, use the ``PYRAMID_DEBUG_ROUTEMATCH`` environment variable or the\n``pyramid.debug_routematch`` configuration file setting (set either to ``true``).\nDetails of the route matching decision for a particular request to the\n:app:`Pyramid` application will be printed to the ``stderr`` of the console\nwhich you started the application from.  For example:\n\n.. code-block:: text\n    :linenos:\n\n    $ PYRAMID_DEBUG_ROUTEMATCH=true $VENV/bin/pserve development.ini\n    Starting server in PID 13586.\n    serving on 0.0.0.0:6543 view at http://127.0.0.1:6543\n    2010-12-16 14:45:19,956 no route matched for url \\\n                                        http://localhost:6543/wontmatch\n    2010-12-16 14:45:20,010 no route matched for url \\\n                                http://localhost:6543/favicon.ico\n    2010-12-16 14:41:52,084 route matched for url \\\n                                http://localhost:6543/static/logo.png; \\\n                                route_name: 'static/', ....\n\nSee :ref:`environment_chapter` for more information about how, and where to\nset these values.\n\nYou can also use the ``proutes`` command to see a display of all the\nroutes configured in your application; for more information, see\n:ref:`displaying_application_routes`.\n\n.. _route_prefix:\n\nUsing a Route Prefix to Compose Applications\n--------------------------------------------\n\n.. versionadded:: 1.2\n\nThe :meth:`pyramid.config.Configurator.include` method allows configuration\nstatements to be included from separate files.  See\n:ref:`building_an_extensible_app` for information about this method.  Using\n:meth:`pyramid.config.Configurator.include` allows you to build your\napplication from small and potentially reusable components.\n\nThe :meth:`pyramid.config.Configurator.include` method accepts an argument\nnamed ``route_prefix`` which can be useful to authors of URL-dispatch-based\napplications.  If ``route_prefix`` is supplied to the include method, it must\nbe a string.  This string represents a route prefix that will be prepended to\nall route patterns added by the *included* configuration.  Any calls to\n:meth:`pyramid.config.Configurator.add_route` within the included callable\nwill have their pattern prefixed with the value of ``route_prefix``. This can\nbe used to help mount a set of routes at a different location than the\nincluded callable's author intended while still maintaining the same route\nnames.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def users_include(config):\n       config.add_route('show_users', '/show')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\nIn the above configuration, the ``show_users`` route will have an effective\nroute pattern of ``/users/show``, instead of ``/show`` because the\n``route_prefix`` argument will be prepended to the pattern.  The route will\nthen only match if the URL path is ``/users/show``, and when the\n:meth:`pyramid.request.Request.route_url` function is called with the route\nname ``show_users``, it will generate a URL with that same path.\n\nRoute prefixes are recursive, so if a callable executed via an include itself\nturns around and includes another callable, the second-level route prefix\nwill be prepended with the first:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def timing_include(config):\n       config.add_route('show_times', '/times')\n\n   def users_include(config):\n       config.add_route('show_users', '/show')\n       config.include(timing_include, route_prefix='/timing')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\nIn the above configuration, the ``show_users`` route will still have an\neffective route pattern of ``/users/show``.  The ``show_times`` route\nhowever, will have an effective pattern of ``/users/timing/times``.\n\nRoute prefixes have no impact on the requirement that the set of route\n*names* in any given Pyramid configuration must be entirely unique.  If you\ncompose your URL dispatch application out of many small subapplications using\n:meth:`pyramid.config.Configurator.include`, it's wise to use a dotted name\nfor your route names, so they'll be unlikely to conflict with other packages\nthat may be added in the future.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def timing_include(config):\n       config.add_route('timing.show_times', '/times')\n\n   def users_include(config):\n       config.add_route('users.show_users', '/show')\n       config.include(timing_include, route_prefix='/timing')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\n.. index::\n   single: route predicates (custom)\n\n.. _custom_route_predicates:\n\nCustom Route Predicates\n-----------------------\n\nEach of the predicate callables fed to the ``custom_predicates`` argument of\n:meth:`~pyramid.config.Configurator.add_route` must be a callable accepting\ntwo arguments.  The first argument passed to a custom predicate is a\ndictionary conventionally named ``info``.  The second argument is the current\n:term:`request` object.\n\nThe ``info`` dictionary has a number of contained values: ``match`` is a\ndictionary: it represents the arguments matched in the URL by the route.\n``route`` is an object representing the route which was matched (see\n:class:`pyramid.interfaces.IRoute` for the API of such a route object).\n\n``info['match']`` is useful when predicates need access to the route match.\nFor example:\n\n.. code-block:: python\n   :linenos:\n\n   def any_of(segment_name, *allowed):\n       def predicate(info, request):\n           if info['match'][segment_name] in allowed:\n               return True\n       return predicate\n\n   num_one_two_or_three = any_of('num', 'one', 'two', 'three')\n\n   config.add_route('route_to_num', '/{num}',\n                    custom_predicates=(num_one_two_or_three,))\n\nThe above ``any_of`` function generates a predicate which ensures that the\nmatch value named ``segment_name`` is in the set of allowable values\nrepresented by ``allowed``.  We use this ``any_of`` function to generate a\npredicate function named ``num_one_two_or_three``, which ensures that the\n``num`` segment is one of the values ``one``, ``two``, or ``three`` , and use\nthe result as a custom predicate by feeding it inside a tuple to the\n``custom_predicates`` argument to\n:meth:`~pyramid.config.Configurator.add_route`.\n\nA custom route predicate may also *modify* the ``match`` dictionary.  For\ninstance, a predicate might do some type conversion of values:\n\n.. code-block:: python\n    :linenos:\n\n    def integers(*segment_names):\n        def predicate(info, request):\n            match = info['match']\n            for segment_name in segment_names:\n                try:\n                    match[segment_name] = int(match[segment_name])\n                except (TypeError, ValueError):\n                    pass\n            return True\n        return predicate\n\n    ymd_to_int = integers('year', 'month', 'day')\n\n    config.add_route('ymd', '/{year}/{month}/{day}',\n                     custom_predicates=(ymd_to_int,))\n\nNote that a conversion predicate is still a predicate so it must return\n``True`` or ``False``; a predicate that does *only* conversion, such as the\none we demonstrate above should unconditionally return ``True``.\n\nTo avoid the try/except uncertainty, the route pattern can contain regular\nexpressions specifying requirements for that marker. For instance:\n\n.. code-block:: python\n    :linenos:\n\n    def integers(*segment_names):\n        def predicate(info, request):\n            match = info['match']\n            for segment_name in segment_names:\n                match[segment_name] = int(match[segment_name])\n            return True\n        return predicate\n\n    ymd_to_int = integers('year', 'month', 'day')\n\n    config.add_route('ymd', '/{year:\\d+}/{month:\\d+}/{day:\\d+}',\n                     custom_predicates=(ymd_to_int,))\n\nNow the try/except is no longer needed because the route will not match at\nall unless these markers match ``\\d+`` which requires them to be valid digits\nfor an ``int`` type conversion.\n\nThe ``match`` dictionary passed within ``info`` to each predicate attached to\na route will be the same dictionary.  Therefore, when registering a custom\npredicate which modifies the ``match`` dict, the code registering the\npredicate should usually arrange for the predicate to be the *last* custom\npredicate in the custom predicate list.  Otherwise, custom predicates which\nfire subsequent to the predicate which performs the ``match`` modification\nwill receive the *modified* match dictionary.\n\n.. warning::\n\n   It is a poor idea to rely on ordering of custom predicates to build a\n   conversion pipeline, where one predicate depends on the side effect of\n   another.  For instance, it's a poor idea to register two custom\n   predicates, one which handles conversion of a value to an int, the next\n   which handles conversion of that integer to some custom object.  Just do\n   all that in a single custom predicate.\n\nThe ``route`` object in the ``info`` dict is an object that has two useful\nattributes: ``name`` and ``pattern``.  The ``name`` attribute is the route\nname.  The ``pattern`` attribute is the route pattern.  An example of using\nthe route in a set of route predicates:\n\n.. code-block:: python\n    :linenos:\n\n    def twenty_ten(info, request):\n        if info['route'].name in ('ymd', 'ym', 'y'):\n            return info['match']['year'] == '2010'\n\n    config.add_route('y', '/{year}', custom_predicates=(twenty_ten,))\n    config.add_route('ym', '/{year}/{month}', custom_predicates=(twenty_ten,))\n    config.add_route('ymd', '/{year}/{month}/{day}',\n                     custom_predicates=(twenty_ten,))\n\nThe above predicate, when added to a number of route configurations ensures\nthat the year match argument is '2010' if and only if the route name is\n'ymd', 'ym', or 'y'.\n\nYou can also caption the predicates by setting the ``__text__``\nattribute. This will help you with the ``pviews`` command (see\n:ref:`displaying_application_routes`) and the ``pyramid_debugtoolbar``.\n\nIf a predicate is a class just add __text__ property in a standard manner.\n\n.. code-block:: python\n   :linenos:\n\n   class DummyCustomPredicate1(object):\n       def __init__(self):\n           self.__text__ = 'my custom class predicate'\n\n   class DummyCustomPredicate2(object):\n       __text__ = 'my custom class predicate'\n\nIf a predicate is a method you'll need to assign it after method declaration\n(see `PEP 232 <http://www.python.org/dev/peps/pep-0232/>`_)\n\n.. code-block:: python\n   :linenos:\n\n   def custom_predicate():\n       pass\n   custom_predicate.__text__ = 'my custom method predicate'\n\nIf a predicate is a classmethod using @classmethod will not work, but you can\nstill easily do it by wrapping it in classmethod call.\n\n.. code-block:: python\n   :linenos:\n\n   def classmethod_predicate():\n       pass\n   classmethod_predicate.__text__ = 'my classmethod predicate'\n   classmethod_predicate = classmethod(classmethod_predicate)\n\nSame will work with staticmethod, just use ``staticmethod`` instead of\n``classmethod``.\n\n.. seealso::\n\n    See also :class:`pyramid.interfaces.IRoute` for more API documentation\n    about route objects.\n\n.. index::\n   single: route factory\n\n.. _route_factories:\n\nRoute Factories\n---------------\n\nAlthough it is not a particular common need in basic applications, a \"route\"\nconfiguration declaration can mention a \"factory\".  When that route matches a\nrequest, and a factory is attached to a route, the :term:`root factory`\npassed at startup time to the :term:`Configurator` is ignored; instead the\nfactory associated with the route is used to generate a :term:`root` object.\nThis object will usually be used as the :term:`context` resource of the view\ncallable ultimately found via :term:`view lookup`.\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('abc', '/abc',\n                    factory='myproject.resources.root_factory')\n   config.add_view('myproject.views.theview', route_name='abc')\n\nThe factory can either be a Python object or a :term:`dotted Python name` (a\nstring) which points to such a Python object, as it is above.\n\nIn this way, each route can use a different factory, making it possible to\nsupply a different :term:`context` resource object to the view related to\neach particular route.\n\nA factory must be a callable which accepts a request and returns an arbitrary\nPython object.  For example, the below class can be used as a factory:\n\n.. code-block:: python\n   :linenos:\n\n   class Mine(object):\n       def __init__(self, request):\n           pass\n\nA route factory is actually conceptually identical to the :term:`root\nfactory` described at :ref:`the_resource_tree`.\n\nSupplying a different resource factory for each route is useful when you're\ntrying to use a :app:`Pyramid` :term:`authorization policy` to provide\ndeclarative, \"context sensitive\" security checks; each resource can maintain\na separate :term:`ACL`, as documented in\n:ref:`using_security_with_urldispatch`.  It is also useful when you wish to\ncombine URL dispatch with :term:`traversal` as documented within\n:ref:`hybrid_chapter`.\n\n.. index::\n   pair: URL dispatch; security\n\n.. _using_security_with_urldispatch:\n\nUsing :app:`Pyramid` Security With URL Dispatch\n--------------------------------------------------\n\n:app:`Pyramid` provides its own security framework which consults an\n:term:`authorization policy` before allowing any application code to be\ncalled.  This framework operates in terms of an access control list, which is\nstored as an ``__acl__`` attribute of a resource object.  A common thing to\nwant to do is to attach an ``__acl__`` to the resource object dynamically for\ndeclarative security purposes.  You can use the ``factory`` argument that\npoints at a factory which attaches a custom ``__acl__`` to an object at its\ncreation time.\n\nSuch a ``factory`` might look like so:\n\n.. code-block:: python\n   :linenos:\n\n   class Article(object):\n       def __init__(self, request):\n          matchdict = request.matchdict\n          article = matchdict.get('article', None)\n          if article == '1':\n              self.__acl__ = [ (Allow, 'editor', 'view') ]\n\nIf the route ``archives/{article}`` is matched, and the article number is\n``1``, :app:`Pyramid` will generate an ``Article`` :term:`context` resource\nwith an ACL on it that allows the ``editor`` principal the ``view``\npermission.  Obviously you can do more generic things than inspect the routes\nmatch dict to see if the ``article`` argument matches a particular string;\nour sample ``Article`` factory class is not very ambitious.\n\n.. note::\n\n   See :ref:`security_chapter` for more information about\n   :app:`Pyramid` security and ACLs.\n\n.. index::\n   pair: route; view callable lookup details\n\nRoute View Callable Registration and Lookup Details\n---------------------------------------------------\n\nWhen a request enters the system which matches the pattern of the route, the\nusual result is simple: the view callable associated with the route is\ninvoked with the request that caused the invocation.\n\nFor most usage, you needn't understand more than this; how it works is an\nimplementation detail.  In the interest of completeness, however, we'll\nexplain how it *does* work in this section.  You can skip it if you're\nuninterested.\n\nWhen a view is associated with a route configuration, :app:`Pyramid` ensures\nthat a :term:`view configuration` is registered that will always be found\nwhen the route pattern is matched during a request.  To do so:\n\n- A special route-specific :term:`interface` is created at startup time for\n  each route configuration declaration.\n\n- When an ``add_view`` statement mentions a ``route name`` attribute, a\n  :term:`view configuration` is registered at startup time.  This view\n  configuration uses a route-specific interface as a :term:`request` type.\n\n- At runtime, when a request causes any route to match, the :term:`request`\n  object is decorated with the route-specific interface.\n\n- The fact that the request is decorated with a route-specific interface\n  causes the :term:`view lookup` machinery to always use the view callable\n  registered using that interface by the route configuration to service\n  requests that match the route pattern.\n\nAs we can see from the above description, technically, URL dispatch doesn't\nactually map a URL pattern directly to a view callable.  Instead, URL\ndispatch is a :term:`resource location` mechanism.  A :app:`Pyramid`\n:term:`resource location` subsystem (i.e., :term:`URL dispatch` or\n:term:`traversal`) finds a :term:`resource` object that is the\n:term:`context` of a :term:`request`. Once the :term:`context` is determined,\na separate subsystem named :term:`view lookup` is then responsible for\nfinding and invoking a :term:`view callable` based on information available\nin the context and the request.  When URL dispatch is used, the resource\nlocation and view lookup subsystems provided by :app:`Pyramid` are still\nbeing utilized, but in a way which does not require a developer to understand\neither of them in detail.\n\nIf no route is matched using :term:`URL dispatch`, :app:`Pyramid` falls back\nto :term:`traversal` to handle the :term:`request`.\n\nReferences\n----------\n\nA tutorial showing how :term:`URL dispatch` can be used to create a\n:app:`Pyramid` application exists in :ref:`bfg_sql_wiki_tutorial`.\n",
            "new_file_content": ".. index::\n   single: URL dispatch\n\n.. _urldispatch_chapter:\n\nURL Dispatch\n============\n\n:term:`URL dispatch` provides a simple way to map URLs to :term:`view` code\nusing a simple pattern matching language.  An ordered set of patterns is\nchecked one-by-one.  If one of the patterns matches the path information\nassociated with a request, a particular :term:`view callable` is invoked.  A\nview callable is a specific bit of code, defined in your application, that\nreceives the :term:`request` and returns a :term:`response` object.\n\nHigh-Level Operational Overview\n-------------------------------\n\nIf any route configuration is present in an application, the :app:`Pyramid`\n:term:`Router` checks every incoming request against an ordered set of URL\nmatching patterns present in a *route map*.\n\nIf any route pattern matches the information in the :term:`request`,\n:app:`Pyramid` will invoke the :term:`view lookup` process to find a\nmatching view.\n\nIf no route pattern in the route map matches the information in the\n:term:`request` provided in your application, :app:`Pyramid` will fail over\nto using :term:`traversal` to perform resource location and view lookup.\n\n.. index::\n   single: route configuration\n\nRoute Configuration\n-------------------\n\n:term:`Route configuration` is the act of adding a new :term:`route` to an\napplication.  A route has a *name*, which acts as an identifier to be used\nfor URL generation.  The name also allows developers to associate a view\nconfiguration with the route.  A route also has a *pattern*, meant to match\nagainst the ``PATH_INFO`` portion of a URL (the portion following the scheme\nand port, e.g. ``/foo/bar`` in the URL `<http://localhost:8080/foo/bar>`_). It\nalso optionally has a ``factory`` and a set of :term:`route predicate`\nattributes.\n\n.. index::\n   single: add_route\n\n.. _config-add-route:\n\nConfiguring a Route to Match a View\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe :meth:`pyramid.config.Configurator.add_route` method adds a single\n:term:`route configuration` to the :term:`application registry`.  Here's an\nexample:\n\n.. code-block:: python\n\n   # \"config\" below is presumed to be an instance of the\n   # pyramid.config.Configurator class; \"myview\" is assumed\n   # to be a \"view callable\" function\n   from views import myview\n   config.add_route('myroute', '/prefix/{one}/{two}')\n   config.add_view(myview, route_name='myroute')\n\nWhen a :term:`view callable` added to the configuration by way of\n:meth:`~pyramid.config.Configurator.add_view` becomes associated with a route\nvia its ``route_name`` predicate, that view callable will always be found and\ninvoked when the associated route pattern matches during a request.\n\nMore commonly, you will not use any ``add_view`` statements in your project's\n\"setup\" code. You will instead use ``add_route`` statements, and use a\n:term:`scan` to associate view callables with routes.  For example, if\nthis is a portion of your project's ``__init__.py``:\n\n.. code-block:: python\n\n   config.add_route('myroute', '/prefix/{one}/{two}')\n   config.scan('mypackage')\n\nNote that we don't call :meth:`~pyramid.config.Configurator.add_view` in this\nsetup code.  However, the above :term:`scan` execution\n``config.scan('mypackage')`` will pick up each :term:`configuration\ndecoration`, including any objects decorated with the\n:class:`pyramid.view.view_config` decorator in the ``mypackage`` Python\npackage.  For example, if you have a ``views.py`` in your package, a scan will\npick up any of its configuration decorators, so we can add one there\nthat references ``myroute`` as a ``route_name`` parameter:\n\n.. code-block:: python\n\n   from pyramid.view import view_config\n   from pyramid.response import Response\n\n   @view_config(route_name='myroute')\n   def myview(request):\n       return Response('OK')\n\nThe above combination of ``add_route`` and ``scan`` is completely equivalent\nto using the previous combination of ``add_route`` and ``add_view``.\n\n.. index::\n   single: route path pattern syntax\n\n.. _route_pattern_syntax:\n\n\nRoute Pattern Syntax\n~~~~~~~~~~~~~~~~~~~~\n\nThe syntax of the pattern matching language used by :app:`Pyramid` URL\ndispatch in the *pattern* argument is straightforward; it is close to that of\nthe :term:`Routes` system used by :term:`Pylons`.\n\nThe *pattern* used in route configuration may start with a slash character.\nIf the pattern does not start with a slash character, an implicit slash will\nbe prepended to it at matching time.  For example, the following patterns are\nequivalent:\n\n.. code-block:: text\n\n   {foo}/bar/baz\n\nand:\n\n.. code-block:: text\n\n   /{foo}/bar/baz\n\nIf a pattern is a valid URL it won't be ever matched against an incoming\nrequest. Instead it can be useful for generating external URLs. See\n:ref:`External routes <external_route_narr>` for details.\n\nA pattern segment (an individual item between ``/`` characters in the\npattern) may either be a literal string (e.g. ``foo``) *or* it may be a\nreplacement marker (e.g. ``{foo}``) or a certain combination of both. A\nreplacement marker does not need to be preceded by a ``/`` character.\n\nA replacement marker is in the format ``{name}``, where this means \"accept\nany characters up to the next slash character and use this as the ``name``\n:term:`matchdict` value.\"\n\nA replacement marker in a pattern must begin with an uppercase or lowercase\nASCII letter or an underscore, and can be composed only of uppercase or\nlowercase ASCII letters, underscores, and numbers.  For example: ``a``,\n``a_b``, ``_b``, and ``b9`` are all valid replacement marker names, but\n``0a`` is not.\n\n.. note:: A replacement marker could not start with an underscore until\n   Pyramid 1.2.  Previous versions required that the replacement marker start\n   with an uppercase or lowercase letter.\n\nA matchdict is the dictionary representing the dynamic parts extracted from a\nURL based on the routing pattern.  It is available as ``request.matchdict``.\nFor example, the following pattern defines one literal segment (``foo``) and\ntwo replacement markers (``baz``, and ``bar``):\n\n.. code-block:: text\n\n   foo/{baz}/{bar}\n\nThe above pattern will match these URLs, generating the following matchdicts:\n\n.. code-block:: text\n\n   foo/1/2        -> {'baz':u'1', 'bar':u'2'}\n   foo/abc/def    -> {'baz':u'abc', 'bar':u'def'}\n\nIt will not match the following patterns however:\n\n.. code-block:: text\n\n   foo/1/2/        -> No match (trailing slash)\n   bar/abc/def     -> First segment literal mismatch\n\nThe match for a segment replacement marker in a segment will be done only up\nto the first non-alphanumeric character in the segment in the pattern.  So,\nfor instance, if this route pattern was used:\n\n.. code-block:: text\n\n   foo/{name}.html\n\nThe literal path ``/foo/biz.html`` will match the above route pattern, and\nthe match result will be ``{'name':u'biz'}``.  However, the literal path\n``/foo/biz`` will not match, because it does not contain a literal ``.html``\nat the end of the segment represented by ``{name}.html`` (it only contains\n``biz``, not ``biz.html``).\n\nTo capture both segments, two replacement markers can be used:\n\n.. code-block:: text\n\n    foo/{name}.{ext}\n\nThe literal path ``/foo/biz.html`` will match the above route pattern, and\nthe match result will be ``{'name': 'biz', 'ext': 'html'}``. This occurs\nbecause there is a literal part of ``.`` (period) between the two replacement\nmarkers ``{name}`` and ``{ext}``.\n\nReplacement markers can optionally specify a regular expression which will be\nused to decide whether a path segment should match the marker.  To specify\nthat a replacement marker should match only a specific set of characters as\ndefined by a regular expression, you must use a slightly extended form of\nreplacement marker syntax.  Within braces, the replacement marker name must\nbe followed by a colon, then directly thereafter, the regular expression.\nThe *default* regular expression associated with a replacement marker\n``[^/]+`` matches one or more characters which are not a slash.  For example,\nunder the hood, the replacement marker ``{foo}`` can more verbosely be\nspelled as ``{foo:[^/]+}``.  You can change this to be an arbitrary regular\nexpression to match an arbitrary sequence of characters, such as\n``{foo:\\d+}`` to match only digits.\n\nIt is possible to use two replacement markers without any literal characters\nbetween them, for instance ``/{foo}{bar}``. However, this would be a\nnonsensical pattern without specifying a custom regular expression to\nrestrict what each marker captures.\n\nSegments must contain at least one character in order to match a segment\nreplacement marker.  For example, for the URL ``/abc/``:\n\n- ``/abc/{foo}`` will not match.\n\n- ``/{foo}/`` will match.\n\nNote that values representing matched path segments will be url-unquoted and\ndecoded from UTF-8 into Unicode within the matchdict.  So for instance, the\nfollowing pattern:\n\n.. code-block:: text\n\n   foo/{bar}\n\nWhen matching the following URL:\n\n.. code-block:: text\n\n   http://example.com/foo/La%20Pe%C3%B1a\n\nThe matchdict will look like so (the value is URL-decoded / UTF-8 decoded):\n\n.. code-block:: text\n\n   {'bar':u'La Pe\\xf1a'}\n\nLiteral strings in the path segment should represent the *decoded* value of\nthe ``PATH_INFO`` provided to Pyramid.  You don't want to use a URL-encoded\nvalue or a bytestring representing the literal's UTF-8 in the pattern.  For\nexample, rather than this:\n\n.. code-block:: text\n\n   /Foo%20Bar/{baz}\n\nYou'll want to use something like this:\n\n.. code-block:: text\n\n   /Foo Bar/{baz}\n\nFor patterns that contain \"high-order\" characters in its literals, you'll\nwant to use a Unicode value as the pattern as opposed to any URL-encoded or\nUTF-8-encoded value.  For example, you might be tempted to use a bytestring\npattern like this:\n\n.. code-block:: text\n\n   /La Pe\\xc3\\xb1a/{x}\n\nBut this will either cause an error at startup time or it won't match\nproperly.  You'll want to use a Unicode value as the pattern instead rather\nthan raw bytestring escapes.  You can use a high-order Unicode value as the\npattern by using `Python source file encoding\n<http://www.python.org/dev/peps/pep-0263/>`_ plus the \"real\" character in the\nUnicode pattern in the source, like so:\n\n.. code-block:: text\n\n   /La Peña/{x}\n\nOr you can ignore source file encoding and use equivalent Unicode escape\ncharacters in the pattern.\n\n.. code-block:: text\n\n   /La Pe\\xf1a/{x}\n\nDynamic segment names cannot contain high-order characters, so this applies\nonly to literals in the pattern.\n\nIf the pattern has a ``*`` in it, the name which follows it is considered a\n\"remainder match\".  A remainder match *must* come at the end of the pattern.\nUnlike segment replacement markers, it does not need to be preceded by a\nslash.  For example:\n\n.. code-block:: text\n\n   foo/{baz}/{bar}*fizzle\n\nThe above pattern will match these URLs, generating the following matchdicts:\n\n.. code-block:: text\n\n   foo/1/2/           ->\n            {'baz':u'1', 'bar':u'2', 'fizzle':()}\n\n   foo/abc/def/a/b/c  ->\n            {'baz':u'abc', 'bar':u'def', 'fizzle':(u'a', u'b', u'c')}\n\nNote that when a ``*stararg`` remainder match is matched, the value put into\nthe matchdict is turned into a tuple of path segments representing the\nremainder of the path.  These path segments are url-unquoted and decoded from\nUTF-8 into Unicode.  For example, for the following pattern:\n\n.. code-block:: text\n\n   foo/*fizzle\n\nWhen matching the following path:\n\n.. code-block:: text\n\n   /foo/La%20Pe%C3%B1a/a/b/c\n\nWill generate the following matchdict:\n\n.. code-block:: text\n\n   {'fizzle':(u'La Pe\\xf1a', u'a', u'b', u'c')}\n\nBy default, the ``*stararg`` will parse the remainder sections into a tuple\nsplit by segment. Changing the regular expression used to match a marker can\nalso capture the remainder of the URL, for example:\n\n.. code-block:: text\n\n    foo/{baz}/{bar}{fizzle:.*}\n\nThe above pattern will match these URLs, generating the following matchdicts:\n\n.. code-block:: text\n\n   foo/1/2/           -> {'baz':u'1', 'bar':u'2', 'fizzle':u''}\n   foo/abc/def/a/b/c  -> {'baz':u'abc', 'bar':u'def', 'fizzle': u'a/b/c'}\n\nThis occurs because the default regular expression for a marker is ``[^/]+``\nwhich will match everything up to the first ``/``, while ``{fizzle:.*}`` will\nresult in a regular expression match of ``.*`` capturing the remainder into a\nsingle value.\n\n.. index::\n   single: route ordering\n\nRoute Declaration Ordering\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nRoute configuration declarations are evaluated in a specific order when a\nrequest enters the system. As a result, the order of route configuration\ndeclarations is very important.  The order that routes declarations are\nevaluated is the order in which they are added to the application at startup\ntime.  (This is unlike a different way of mapping URLs to code that\n:app:`Pyramid` provides, named :term:`traversal`, which does not depend on\npattern ordering).\n\nFor routes added via the :mod:`~pyramid.config.Configurator.add_route` method,\nthe order that routes are evaluated is the order in which they are added to\nthe configuration imperatively.\n\nFor example, route configuration statements with the following patterns might\nbe added in the following order:\n\n.. code-block:: text\n\n   members/{def}\n   members/abc\n\nIn such a configuration, the ``members/abc`` pattern would *never* be\nmatched. This is because the match ordering will always match\n``members/{def}`` first; the route configuration with ``members/abc`` will\nnever be evaluated.\n\n.. index::\n   single: route configuration arguments\n\nRoute Configuration Arguments\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nRoute configuration ``add_route`` statements may specify a large number of\narguments.  They are documented as part of the API documentation at\n:meth:`pyramid.config.Configurator.add_route`.\n\nMany of these arguments are :term:`route predicate` arguments.  A route\npredicate argument specifies that some aspect of the request must be true for\nthe associated route to be considered a match during the route matching\nprocess.  Examples of route predicate arguments are ``pattern``, ``xhr``, and\n``request_method``.\n\nOther arguments are ``name`` and ``factory``.  These arguments represent\nneither predicates nor view configuration information.\n\n.. index::\n   single: route matching\n\nRoute Matching\n--------------\n\nThe main purpose of route configuration is to match (or not match) the\n``PATH_INFO`` present in the WSGI environment provided during a request\nagainst a URL path pattern.  ``PATH_INFO`` represents the path portion of the\nURL that was requested.\n\nThe way that :app:`Pyramid` does this is very simple.  When a request enters\nthe system, for each route configuration declaration present in the system,\n:app:`Pyramid` checks the request's ``PATH_INFO`` against the pattern\ndeclared.  This checking happens in the order that the routes were declared\nvia :meth:`pyramid.config.Configurator.add_route`.\n\nWhen a route configuration is declared, it may contain :term:`route\npredicate` arguments.  All route predicates associated with a route\ndeclaration must be ``True`` for the route configuration to be used for a\ngiven request during a check.  If any predicate in the set of :term:`route\npredicate` arguments provided to a route configuration returns ``False``\nduring a check, that route is skipped and route matching continues through\nthe ordered set of routes.\n\nIf any route matches, the route matching process stops and the :term:`view\nlookup` subsystem takes over to find the most reasonable view callable for\nthe matched route.  Most often, there's only one view that will match (a view\nconfigured with a ``route_name`` argument matching the matched route).  To\ngain a better understanding of how routes and views are associated in a real\napplication, you can use the ``pviews`` command, as documented in\n:ref:`displaying_matching_views`.\n\nIf no route matches after all route patterns are exhausted, :app:`Pyramid`\nfalls back to :term:`traversal` to do :term:`resource location` and\n:term:`view lookup`.\n\n.. index::\n   single: matchdict\n\n.. _matchdict:\n\nThe Matchdict\n~~~~~~~~~~~~~\n\nWhen the URL pattern associated with a particular route configuration is\nmatched by a request, a dictionary named ``matchdict`` is added as an\nattribute of the :term:`request` object.  Thus, ``request.matchdict`` will\ncontain the values that match replacement patterns in the ``pattern``\nelement.  The keys in a matchdict will be strings.  The values will be\nUnicode objects.\n\n.. note::\n\n   If no route URL pattern matches, the ``matchdict`` object attached to the\n   request will be ``None``.\n\n.. index::\n   single: matched_route\n\n.. _matched_route:\n\nThe Matched Route\n~~~~~~~~~~~~~~~~~\n\nWhen the URL pattern associated with a particular route configuration is\nmatched by a request, an object named ``matched_route`` is added as an\nattribute of the :term:`request` object.  Thus, ``request.matched_route``\nwill be an object implementing the :class:`~pyramid.interfaces.IRoute`\ninterface which matched the request.  The most useful attribute of the route\nobject is ``name``, which is the name of the route that matched.\n\n.. note::\n\n   If no route URL pattern matches, the ``matched_route`` object attached to\n   the request will be ``None``.\n\nRouting Examples\n----------------\n\nLet's check out some examples of how route configuration statements might be\ncommonly declared, and what will happen if they are matched by the\ninformation present in a request.\n\n.. _urldispatch_example1:\n\nExample 1\n~~~~~~~~~\n\nThe simplest route declaration which configures a route match to *directly*\nresult in a particular view callable being invoked:\n\n.. code-block:: python\n    :linenos:\n\n    config.add_route('idea', 'site/{id}')\n    config.add_view('mypackage.views.site_view', route_name='idea')\n\nWhen a route configuration with a ``view`` attribute is added to the system,\nand an incoming request matches the *pattern* of the route configuration, the\n:term:`view callable` named as the ``view`` attribute of the route\nconfiguration will be invoked.\n\nIn the case of the above example, when the URL of a request matches\n``/site/{id}``, the view callable at the Python dotted path name\n``mypackage.views.site_view`` will be called with the request.  In other\nwords, we've associated a view callable directly with a route pattern.\n\nWhen the ``/site/{id}`` route pattern matches during a request, the\n``site_view`` view callable is invoked with that request as its sole\nargument.  When this route matches, a ``matchdict`` will be generated and\nattached to the request as ``request.matchdict``.  If the specific URL\nmatched is ``/site/1``, the ``matchdict`` will be a dictionary with a single\nkey, ``id``; the value will be the string ``'1'``, ex.: ``{'id':'1'}``.\n\nThe ``mypackage.views`` module referred to above might look like so:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.response import Response\n\n   def site_view(request):\n       return Response(request.matchdict['id'])\n\nThe view has access to the matchdict directly via the request, and can access\nvariables within it that match keys present as a result of the route pattern.\n\nSee :ref:`views_chapter`, and :ref:`view_config_chapter` for more\ninformation about views.\n\nExample 2\n~~~~~~~~~\n\nBelow is an example of a more complicated set of route statements you might\nadd to your application:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('idea', 'ideas/{idea}')\n   config.add_route('user', 'users/{user}')\n   config.add_route('tag', 'tags/{tag}')\n\n   config.add_view('mypackage.views.idea_view', route_name='idea')\n   config.add_view('mypackage.views.user_view', route_name='user')\n   config.add_view('mypackage.views.tag_view', route_name='tag')\n\nThe above configuration will allow :app:`Pyramid` to service URLs in these\nforms:\n\n.. code-block:: text\n\n   /ideas/{idea}\n   /users/{user}\n   /tags/{tag}\n\n- When a URL matches the pattern ``/ideas/{idea}``, the view callable\n  available at the dotted Python pathname ``mypackage.views.idea_view`` will\n  be called.  For the specific URL ``/ideas/1``, the ``matchdict`` generated\n  and attached to the :term:`request` will consist of ``{'idea':'1'}``.\n\n- When a URL matches the pattern ``/users/{user}``, the view callable\n  available at the dotted Python pathname ``mypackage.views.user_view`` will\n  be called.  For the specific URL ``/users/1``, the ``matchdict`` generated\n  and attached to the :term:`request` will consist of ``{'user':'1'}``.\n\n- When a URL matches the pattern ``/tags/{tag}``, the view callable available\n  at the dotted Python pathname ``mypackage.views.tag_view`` will be called.\n  For the specific URL ``/tags/1``, the ``matchdict`` generated and attached\n  to the :term:`request` will consist of ``{'tag':'1'}``.\n\nIn this example we've again associated each of our routes with a :term:`view\ncallable` directly.  In all cases, the request, which will have a\n``matchdict`` attribute detailing the information found in the URL by the\nprocess will be passed to the view callable.\n\nExample 3\n~~~~~~~~~\n\nThe :term:`context` resource object passed in to a view found as the result\nof URL dispatch will, by default, be an instance of the object returned by\nthe :term:`root factory` configured at startup time (the ``root_factory``\nargument to the :term:`Configurator` used to configure the application).\n\nYou can override this behavior by passing in a ``factory`` argument to the\n:meth:`~pyramid.config.Configurator.add_route` method for a particular route.\nThe ``factory`` should be a callable that accepts a :term:`request` and\nreturns an instance of a class that will be the context resource used by the\nview.\n\nAn example of using a route with a factory:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('idea', 'ideas/{idea}', factory='myproject.resources.Idea')\n   config.add_view('myproject.views.idea_view', route_name='idea')\n\nThe above route will manufacture an ``Idea`` resource as a :term:`context`,\nassuming that ``mypackage.resources.Idea`` resolves to a class that accepts a\nrequest in its ``__init__``.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   class Idea(object):\n       def __init__(self, request):\n           pass\n\nIn a more complicated application, this root factory might be a class\nrepresenting a :term:`SQLAlchemy` model.\n\nSee :ref:`route_factories` for more details about how to use route factories.\n\n.. index::\n   single: matching the root URL\n   single: root url (matching)\n   pair: matching; root URL\n\nMatching the Root URL\n---------------------\n\nIt's not entirely obvious how to use a route pattern to match the root URL\n(\"/\").  To do so, give the empty string as a pattern in a call to\n:meth:`~pyramid.config.Configurator.add_route`:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('root', '')\n\nOr provide the literal string ``/`` as the pattern:\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('root', '/')\n\n.. index::\n   single: generating route URLs\n   single: route URLs\n\n.. _generating_route_urls:\n\nGenerating Route URLs\n---------------------\n\nUse the :meth:`pyramid.request.Request.route_url` method to generate URLs\nbased on route patterns.  For example, if you've configured a route with the\n``name`` \"foo\" and the ``pattern`` \"{a}/{b}/{c}\", you might do this.\n\n.. code-block:: python\n   :linenos:\n\n   url = request.route_url('foo', a='1', b='2', c='3')\n\nThis would return something like the string ``http://example.com/1/2/3`` (at\nleast if the current protocol and hostname implied ``http://example.com``).\n\nTo generate only the *path* portion of a URL from a route, use the\n:meth:`pyramid.request.Request.route_path` API instead of\n:meth:`~pyramid.request.Request.route_url`.\n\n.. code-block:: python\n\n   url = request.route_path('foo', a='1', b='2', c='3')\n\nThis will return the string ``/1/2/3`` rather than a full URL.\n\nReplacement values passed to ``route_url`` or ``route_path`` must be Unicode\nor bytestrings encoded in UTF-8.  One exception to this rule exists: if\nyou're trying to replace a \"remainder\" match value (a ``*stararg``\nreplacement value), the value may be a tuple containing Unicode strings or\nUTF-8 strings.\n\nNote that URLs and paths generated by ``route_path`` and ``route_url`` are\nalways URL-quoted string types (they contain no non-ASCII characters).\nTherefore, if you've added a route like so:\n\n.. code-block:: python\n\n   config.add_route('la', u'/La Peña/{city}')\n\nAnd you later generate a URL using ``route_path`` or ``route_url`` like so:\n\n.. code-block:: python\n\n   url = request.route_path('la', city=u'Québec')\n\nYou will wind up with the path encoded to UTF-8 and URL quoted like so:\n\n.. code-block:: text\n\n   /La%20Pe%C3%B1a/Qu%C3%A9bec\n\nIf you have a ``*stararg`` remainder dynamic part of your route pattern:\n\n.. code-block:: python\n\n   config.add_route('abc', 'a/b/c/*foo')\n\nAnd you later generate a URL using ``route_path`` or ``route_url`` using a\n*string* as the replacement value:\n\n.. code-block:: python\n\n   url = request.route_path('abc', foo=u'Québec/biz')\n\nThe value you pass will be URL-quoted except for embedded slashes in the\nresult:\n\n.. code-block:: text\n\n   /a/b/c/Qu%C3%A9bec/biz\n\nYou can get a similar result by passing a tuple composed of path elements:\n\n.. code-block:: python\n\n   url = request.route_path('abc', foo=(u'Québec', u'biz'))\n\nEach value in the tuple will be url-quoted and joined by slashes in this case:\n\n.. code-block:: text\n\n   /a/b/c/Qu%C3%A9bec/biz\n\n.. index::\n   single: static routes\n\n.. _static_route_narr:\n\nStatic Routes\n-------------\n\nRoutes may be added with a ``static`` keyword argument.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   config = Configurator()\n   config.add_route('page', '/page/{action}', static=True)\n\nRoutes added with a ``True`` ``static`` keyword argument will never be\nconsidered for matching at request time.  Static routes are useful for URL\ngeneration purposes only.  As a result, it is usually nonsensical to provide\nother non-``name`` and non-``pattern`` arguments to\n:meth:`~pyramid.config.Configurator.add_route` when ``static`` is passed as\n``True``, as none of the other arguments will ever be employed.  A single\nexception to this rule is use of the ``pregenerator`` argument, which is not\nignored when ``static`` is ``True``.\n\n:ref:`External routes <external_route_narr>` are implicitly static.\n\n.. versionadded:: 1.1\n   the ``static`` argument to :meth:`~pyramid.config.Configurator.add_route`\n\n.. _external_route_narr:\n\n\nExternal Routes\n---------------\n\n.. versionadded:: 1.5\n\nRoute patterns that are valid URLs, are treated as external routes. Like\n:ref:`static routes <static_route_narr>` they are useful for URL generation\npurposes only and are never considered for matching at request time.\n\n.. code-block:: python\n   :linenos:\n\n   >>> config = Configurator()\n   >>> config.add_route('youtube', 'https://youtube.com/watch/{video_id}')\n   ...\n   >>> request.route_url('youtube', video_id='oHg5SJYRHA0')\n   >>> \"https://youtube.com/watch/oHg5SJYRHA0\"\n\nMost pattern replacements and calls to\n:meth:`pyramid.request.Request.route_url` will work as expected. However, calls\nto :meth:`pyramid.request.Request.route_path` against external patterns will\nraise an exception, and passing ``_app_url`` to\n:meth:`~pyramid.request.Request.route_url` to generate a URL against a route\nthat has an external pattern will also raise an exception.\n\n.. index::\n   single: redirecting to slash-appended routes\n\n.. _redirecting_to_slash_appended_routes:\n\nRedirecting to Slash-Appended Routes\n------------------------------------\n\nFor behavior like Django's ``APPEND_SLASH=True``, use the ``append_slash``\nargument to :meth:`pyramid.config.Configurator.add_notfound_view` or the\nequivalent ``append_slash`` argument to the\n:class:`pyramid.view.notfound_view_config` decorator.\n\nAdding ``append_slash=True`` is a way to automatically redirect requests\nwhere the URL lacks a trailing slash, but requires one to match the proper\nroute.  When configured, along with at least one other route in your\napplication, this view will be invoked if the value of ``PATH_INFO`` does not\nalready end in a slash, and if the value of ``PATH_INFO`` *plus* a slash\nmatches any route's pattern.  In this case it does an HTTP redirect to the\nslash-appended ``PATH_INFO``.\n\nLet's use an example.  If the following routes are configured in your\napplication:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.httpexceptions import HTTPNotFound\n\n   def notfound(request):\n       return HTTPNotFound('Not found, bro.')\n\n   def no_slash(request):\n       return Response('No slash')\n\n   def has_slash(request):\n       return Response('Has slash')\n\n   def main(g, **settings):\n       config = Configurator()\n       config.add_route('noslash', 'no_slash')\n       config.add_route('hasslash', 'has_slash/')\n       config.add_view(no_slash, route_name='noslash')\n       config.add_view(has_slash, route_name='hasslash')\n       config.add_notfound_view(notfound, append_slash=True)\n\nIf a request enters the application with the ``PATH_INFO`` value of\n``/no_slash``, the first route will match and the browser will show \"No\nslash\".  However, if a request enters the application with the ``PATH_INFO``\nvalue of ``/no_slash/``, *no* route will match, and the slash-appending not\nfound view will not find a matching route with an appended slash.  As a\nresult, the ``notfound`` view will be called and it will return a \"Not found,\nbro.\" body.\n\nIf a request enters the application with the ``PATH_INFO`` value of\n``/has_slash/``, the second route will match.  If a request enters the\napplication with the ``PATH_INFO`` value of ``/has_slash``, a route *will* be\nfound by the slash-appending :term:`Not Found View`.  An HTTP redirect to\n``/has_slash/`` will be returned to the user's browser.  As a result, the\n``notfound`` view will never actually be called.\n\nThe following application uses the :class:`pyramid.view.notfound_view_config`\nand :class:`pyramid.view.view_config` decorators and a :term:`scan` to do\nexactly the same job:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.httpexceptions import HTTPNotFound\n   from pyramid.view import notfound_view_config, view_config\n\n   @notfound_view_config(append_slash=True)\n   def notfound(request):\n       return HTTPNotFound('Not found, bro.')\n\n   @view_config(route_name='noslash')\n   def no_slash(request):\n       return Response('No slash')\n\n   @view_config(route_name='hasslash')\n   def has_slash(request):\n       return Response('Has slash')\n\n   def main(g, **settings):\n       config = Configurator()\n       config.add_route('noslash', 'no_slash')\n       config.add_route('hasslash', 'has_slash/')\n       config.scan()\n\n.. warning::\n\n   You **should not** rely on this mechanism to redirect ``POST`` requests.\n   The redirect  of the slash-appending :term:`Not Found View` will turn a\n   ``POST`` request into a ``GET``, losing any ``POST`` data in the original\n   request.\n\nSee :ref:`view_module` and :ref:`changing_the_notfound_view` for a more\ngeneral description of how to configure a view and/or a :term:`Not Found View`.\n\n.. index::\n   pair: debugging; route matching\n\n.. _debug_routematch_section:\n\nDebugging Route Matching\n------------------------\n\nIt's useful to be able to take a peek under the hood when requests that enter\nyour application aren't matching your routes as you expect them to.  To debug\nroute matching, use the ``PYRAMID_DEBUG_ROUTEMATCH`` environment variable or the\n``pyramid.debug_routematch`` configuration file setting (set either to ``true``).\nDetails of the route matching decision for a particular request to the\n:app:`Pyramid` application will be printed to the ``stderr`` of the console\nwhich you started the application from.  For example:\n\n.. code-block:: text\n    :linenos:\n\n    $ PYRAMID_DEBUG_ROUTEMATCH=true $VENV/bin/pserve development.ini\n    Starting server in PID 13586.\n    serving on 0.0.0.0:6543 view at http://127.0.0.1:6543\n    2010-12-16 14:45:19,956 no route matched for url \\\n                                        http://localhost:6543/wontmatch\n    2010-12-16 14:45:20,010 no route matched for url \\\n                                http://localhost:6543/favicon.ico\n    2010-12-16 14:41:52,084 route matched for url \\\n                                http://localhost:6543/static/logo.png; \\\n                                route_name: 'static/', ....\n\nSee :ref:`environment_chapter` for more information about how, and where to\nset these values.\n\nYou can also use the ``proutes`` command to see a display of all the\nroutes configured in your application; for more information, see\n:ref:`displaying_application_routes`.\n\n.. _route_prefix:\n\nUsing a Route Prefix to Compose Applications\n--------------------------------------------\n\n.. versionadded:: 1.2\n\nThe :meth:`pyramid.config.Configurator.include` method allows configuration\nstatements to be included from separate files.  See\n:ref:`building_an_extensible_app` for information about this method.  Using\n:meth:`pyramid.config.Configurator.include` allows you to build your\napplication from small and potentially reusable components.\n\nThe :meth:`pyramid.config.Configurator.include` method accepts an argument\nnamed ``route_prefix`` which can be useful to authors of URL-dispatch-based\napplications.  If ``route_prefix`` is supplied to the include method, it must\nbe a string.  This string represents a route prefix that will be prepended to\nall route patterns added by the *included* configuration.  Any calls to\n:meth:`pyramid.config.Configurator.add_route` within the included callable\nwill have their pattern prefixed with the value of ``route_prefix``. This can\nbe used to help mount a set of routes at a different location than the\nincluded callable's author intended while still maintaining the same route\nnames.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def users_include(config):\n       config.add_route('show_users', '/show')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\nIn the above configuration, the ``show_users`` route will have an effective\nroute pattern of ``/users/show``, instead of ``/show`` because the\n``route_prefix`` argument will be prepended to the pattern.  The route will\nthen only match if the URL path is ``/users/show``, and when the\n:meth:`pyramid.request.Request.route_url` function is called with the route\nname ``show_users``, it will generate a URL with that same path.\n\nTo create a prefixed route that matches requests to the ``route_prefix``\nwithout a trailing slash set the route ``pattern`` to an empty string.\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def users_include(config):\n       config.add_route('show_users', '')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\nThe above configuration will match ``/users`` instead of ``/users/`` if a slash\nhad been supplied to the :meth:`pyramid.config.Configurator.add_route` function.\n\nRoute prefixes are recursive, so if a callable executed via an include itself\nturns around and includes another callable, the second-level route prefix\nwill be prepended with the first:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def timing_include(config):\n       config.add_route('show_times', '/times')\n\n   def users_include(config):\n       config.add_route('show_users', '/show')\n       config.include(timing_include, route_prefix='/timing')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\nIn the above configuration, the ``show_users`` route will still have an\neffective route pattern of ``/users/show``.  The ``show_times`` route\nhowever, will have an effective pattern of ``/users/timing/times``.\n\nRoute prefixes have no impact on the requirement that the set of route\n*names* in any given Pyramid configuration must be entirely unique.  If you\ncompose your URL dispatch application out of many small subapplications using\n:meth:`pyramid.config.Configurator.include`, it's wise to use a dotted name\nfor your route names, so they'll be unlikely to conflict with other packages\nthat may be added in the future.  For example:\n\n.. code-block:: python\n   :linenos:\n\n   from pyramid.config import Configurator\n\n   def timing_include(config):\n       config.add_route('timing.show_times', '/times')\n\n   def users_include(config):\n       config.add_route('users.show_users', '/show')\n       config.include(timing_include, route_prefix='/timing')\n\n   def main(global_config, **settings):\n       config = Configurator()\n       config.include(users_include, route_prefix='/users')\n\n.. index::\n   single: route predicates (custom)\n\n.. _custom_route_predicates:\n\nCustom Route Predicates\n-----------------------\n\nEach of the predicate callables fed to the ``custom_predicates`` argument of\n:meth:`~pyramid.config.Configurator.add_route` must be a callable accepting\ntwo arguments.  The first argument passed to a custom predicate is a\ndictionary conventionally named ``info``.  The second argument is the current\n:term:`request` object.\n\nThe ``info`` dictionary has a number of contained values: ``match`` is a\ndictionary: it represents the arguments matched in the URL by the route.\n``route`` is an object representing the route which was matched (see\n:class:`pyramid.interfaces.IRoute` for the API of such a route object).\n\n``info['match']`` is useful when predicates need access to the route match.\nFor example:\n\n.. code-block:: python\n   :linenos:\n\n   def any_of(segment_name, *allowed):\n       def predicate(info, request):\n           if info['match'][segment_name] in allowed:\n               return True\n       return predicate\n\n   num_one_two_or_three = any_of('num', 'one', 'two', 'three')\n\n   config.add_route('route_to_num', '/{num}',\n                    custom_predicates=(num_one_two_or_three,))\n\nThe above ``any_of`` function generates a predicate which ensures that the\nmatch value named ``segment_name`` is in the set of allowable values\nrepresented by ``allowed``.  We use this ``any_of`` function to generate a\npredicate function named ``num_one_two_or_three``, which ensures that the\n``num`` segment is one of the values ``one``, ``two``, or ``three`` , and use\nthe result as a custom predicate by feeding it inside a tuple to the\n``custom_predicates`` argument to\n:meth:`~pyramid.config.Configurator.add_route`.\n\nA custom route predicate may also *modify* the ``match`` dictionary.  For\ninstance, a predicate might do some type conversion of values:\n\n.. code-block:: python\n    :linenos:\n\n    def integers(*segment_names):\n        def predicate(info, request):\n            match = info['match']\n            for segment_name in segment_names:\n                try:\n                    match[segment_name] = int(match[segment_name])\n                except (TypeError, ValueError):\n                    pass\n            return True\n        return predicate\n\n    ymd_to_int = integers('year', 'month', 'day')\n\n    config.add_route('ymd', '/{year}/{month}/{day}',\n                     custom_predicates=(ymd_to_int,))\n\nNote that a conversion predicate is still a predicate so it must return\n``True`` or ``False``; a predicate that does *only* conversion, such as the\none we demonstrate above should unconditionally return ``True``.\n\nTo avoid the try/except uncertainty, the route pattern can contain regular\nexpressions specifying requirements for that marker. For instance:\n\n.. code-block:: python\n    :linenos:\n\n    def integers(*segment_names):\n        def predicate(info, request):\n            match = info['match']\n            for segment_name in segment_names:\n                match[segment_name] = int(match[segment_name])\n            return True\n        return predicate\n\n    ymd_to_int = integers('year', 'month', 'day')\n\n    config.add_route('ymd', '/{year:\\d+}/{month:\\d+}/{day:\\d+}',\n                     custom_predicates=(ymd_to_int,))\n\nNow the try/except is no longer needed because the route will not match at\nall unless these markers match ``\\d+`` which requires them to be valid digits\nfor an ``int`` type conversion.\n\nThe ``match`` dictionary passed within ``info`` to each predicate attached to\na route will be the same dictionary.  Therefore, when registering a custom\npredicate which modifies the ``match`` dict, the code registering the\npredicate should usually arrange for the predicate to be the *last* custom\npredicate in the custom predicate list.  Otherwise, custom predicates which\nfire subsequent to the predicate which performs the ``match`` modification\nwill receive the *modified* match dictionary.\n\n.. warning::\n\n   It is a poor idea to rely on ordering of custom predicates to build a\n   conversion pipeline, where one predicate depends on the side effect of\n   another.  For instance, it's a poor idea to register two custom\n   predicates, one which handles conversion of a value to an int, the next\n   which handles conversion of that integer to some custom object.  Just do\n   all that in a single custom predicate.\n\nThe ``route`` object in the ``info`` dict is an object that has two useful\nattributes: ``name`` and ``pattern``.  The ``name`` attribute is the route\nname.  The ``pattern`` attribute is the route pattern.  An example of using\nthe route in a set of route predicates:\n\n.. code-block:: python\n    :linenos:\n\n    def twenty_ten(info, request):\n        if info['route'].name in ('ymd', 'ym', 'y'):\n            return info['match']['year'] == '2010'\n\n    config.add_route('y', '/{year}', custom_predicates=(twenty_ten,))\n    config.add_route('ym', '/{year}/{month}', custom_predicates=(twenty_ten,))\n    config.add_route('ymd', '/{year}/{month}/{day}',\n                     custom_predicates=(twenty_ten,))\n\nThe above predicate, when added to a number of route configurations ensures\nthat the year match argument is '2010' if and only if the route name is\n'ymd', 'ym', or 'y'.\n\nYou can also caption the predicates by setting the ``__text__``\nattribute. This will help you with the ``pviews`` command (see\n:ref:`displaying_application_routes`) and the ``pyramid_debugtoolbar``.\n\nIf a predicate is a class just add __text__ property in a standard manner.\n\n.. code-block:: python\n   :linenos:\n\n   class DummyCustomPredicate1(object):\n       def __init__(self):\n           self.__text__ = 'my custom class predicate'\n\n   class DummyCustomPredicate2(object):\n       __text__ = 'my custom class predicate'\n\nIf a predicate is a method you'll need to assign it after method declaration\n(see `PEP 232 <http://www.python.org/dev/peps/pep-0232/>`_)\n\n.. code-block:: python\n   :linenos:\n\n   def custom_predicate():\n       pass\n   custom_predicate.__text__ = 'my custom method predicate'\n\nIf a predicate is a classmethod using @classmethod will not work, but you can\nstill easily do it by wrapping it in classmethod call.\n\n.. code-block:: python\n   :linenos:\n\n   def classmethod_predicate():\n       pass\n   classmethod_predicate.__text__ = 'my classmethod predicate'\n   classmethod_predicate = classmethod(classmethod_predicate)\n\nSame will work with staticmethod, just use ``staticmethod`` instead of\n``classmethod``.\n\n.. seealso::\n\n    See also :class:`pyramid.interfaces.IRoute` for more API documentation\n    about route objects.\n\n.. index::\n   single: route factory\n\n.. _route_factories:\n\nRoute Factories\n---------------\n\nAlthough it is not a particular common need in basic applications, a \"route\"\nconfiguration declaration can mention a \"factory\".  When that route matches a\nrequest, and a factory is attached to a route, the :term:`root factory`\npassed at startup time to the :term:`Configurator` is ignored; instead the\nfactory associated with the route is used to generate a :term:`root` object.\nThis object will usually be used as the :term:`context` resource of the view\ncallable ultimately found via :term:`view lookup`.\n\n.. code-block:: python\n   :linenos:\n\n   config.add_route('abc', '/abc',\n                    factory='myproject.resources.root_factory')\n   config.add_view('myproject.views.theview', route_name='abc')\n\nThe factory can either be a Python object or a :term:`dotted Python name` (a\nstring) which points to such a Python object, as it is above.\n\nIn this way, each route can use a different factory, making it possible to\nsupply a different :term:`context` resource object to the view related to\neach particular route.\n\nA factory must be a callable which accepts a request and returns an arbitrary\nPython object.  For example, the below class can be used as a factory:\n\n.. code-block:: python\n   :linenos:\n\n   class Mine(object):\n       def __init__(self, request):\n           pass\n\nA route factory is actually conceptually identical to the :term:`root\nfactory` described at :ref:`the_resource_tree`.\n\nSupplying a different resource factory for each route is useful when you're\ntrying to use a :app:`Pyramid` :term:`authorization policy` to provide\ndeclarative, \"context sensitive\" security checks; each resource can maintain\na separate :term:`ACL`, as documented in\n:ref:`using_security_with_urldispatch`.  It is also useful when you wish to\ncombine URL dispatch with :term:`traversal` as documented within\n:ref:`hybrid_chapter`.\n\n.. index::\n   pair: URL dispatch; security\n\n.. _using_security_with_urldispatch:\n\nUsing :app:`Pyramid` Security With URL Dispatch\n--------------------------------------------------\n\n:app:`Pyramid` provides its own security framework which consults an\n:term:`authorization policy` before allowing any application code to be\ncalled.  This framework operates in terms of an access control list, which is\nstored as an ``__acl__`` attribute of a resource object.  A common thing to\nwant to do is to attach an ``__acl__`` to the resource object dynamically for\ndeclarative security purposes.  You can use the ``factory`` argument that\npoints at a factory which attaches a custom ``__acl__`` to an object at its\ncreation time.\n\nSuch a ``factory`` might look like so:\n\n.. code-block:: python\n   :linenos:\n\n   class Article(object):\n       def __init__(self, request):\n          matchdict = request.matchdict\n          article = matchdict.get('article', None)\n          if article == '1':\n              self.__acl__ = [ (Allow, 'editor', 'view') ]\n\nIf the route ``archives/{article}`` is matched, and the article number is\n``1``, :app:`Pyramid` will generate an ``Article`` :term:`context` resource\nwith an ACL on it that allows the ``editor`` principal the ``view``\npermission.  Obviously you can do more generic things than inspect the routes\nmatch dict to see if the ``article`` argument matches a particular string;\nour sample ``Article`` factory class is not very ambitious.\n\n.. note::\n\n   See :ref:`security_chapter` for more information about\n   :app:`Pyramid` security and ACLs.\n\n.. index::\n   pair: route; view callable lookup details\n\nRoute View Callable Registration and Lookup Details\n---------------------------------------------------\n\nWhen a request enters the system which matches the pattern of the route, the\nusual result is simple: the view callable associated with the route is\ninvoked with the request that caused the invocation.\n\nFor most usage, you needn't understand more than this; how it works is an\nimplementation detail.  In the interest of completeness, however, we'll\nexplain how it *does* work in this section.  You can skip it if you're\nuninterested.\n\nWhen a view is associated with a route configuration, :app:`Pyramid` ensures\nthat a :term:`view configuration` is registered that will always be found\nwhen the route pattern is matched during a request.  To do so:\n\n- A special route-specific :term:`interface` is created at startup time for\n  each route configuration declaration.\n\n- When an ``add_view`` statement mentions a ``route name`` attribute, a\n  :term:`view configuration` is registered at startup time.  This view\n  configuration uses a route-specific interface as a :term:`request` type.\n\n- At runtime, when a request causes any route to match, the :term:`request`\n  object is decorated with the route-specific interface.\n\n- The fact that the request is decorated with a route-specific interface\n  causes the :term:`view lookup` machinery to always use the view callable\n  registered using that interface by the route configuration to service\n  requests that match the route pattern.\n\nAs we can see from the above description, technically, URL dispatch doesn't\nactually map a URL pattern directly to a view callable.  Instead, URL\ndispatch is a :term:`resource location` mechanism.  A :app:`Pyramid`\n:term:`resource location` subsystem (i.e., :term:`URL dispatch` or\n:term:`traversal`) finds a :term:`resource` object that is the\n:term:`context` of a :term:`request`. Once the :term:`context` is determined,\na separate subsystem named :term:`view lookup` is then responsible for\nfinding and invoking a :term:`view callable` based on information available\nin the context and the request.  When URL dispatch is used, the resource\nlocation and view lookup subsystems provided by :app:`Pyramid` are still\nbeing utilized, but in a way which does not require a developer to understand\neither of them in detail.\n\nIf no route is matched using :term:`URL dispatch`, :app:`Pyramid` falls back\nto :term:`traversal` to handle the :term:`request`.\n\nReferences\n----------\n\nA tutorial showing how :term:`URL dispatch` can be used to create a\n:app:`Pyramid` application exists in :ref:`bfg_sql_wiki_tutorial`.\n",
            "header": {
                "file": {
                    "path": "docs/narr/urldispatch.rst"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "87a962a9a",
                "new_commit_hash": "f2a94341d",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/docs/narr/urldispatch.rst"
            },
            "plus_file": {
                "path": "b/docs/narr/urldispatch.rst"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 964,
                            "length": 6
                        },
                        "new_range": {
                            "start": 964,
                            "length": 24
                        },
                        "section": "then only match if the URL path is ``/users/show``, and when the"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": ":meth:`pyramid.request.Request.route_url` function is called with the route",
                                "type": "context"
                            },
                            {
                                "content": "name ``show_users``, it will generate a URL with that same path.",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "To create a prefixed route that matches requests to the ``route_prefix``",
                                "type": "added"
                            },
                            {
                                "content": "without a trailing slash set the route ``pattern`` to an empty string.",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": ".. code-block:: python",
                                "type": "added"
                            },
                            {
                                "content": "   :linenos:",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "   from pyramid.config import Configurator",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "   def users_include(config):",
                                "type": "added"
                            },
                            {
                                "content": "       config.add_route('show_users', '')",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "   def main(global_config, **settings):",
                                "type": "added"
                            },
                            {
                                "content": "       config = Configurator()",
                                "type": "added"
                            },
                            {
                                "content": "       config.include(users_include, route_prefix='/users')",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "The above configuration will match ``/users`` instead of ``/users/`` if a slash",
                                "type": "added"
                            },
                            {
                                "content": "had been supplied to the :meth:`pyramid.config.Configurator.add_route` function.",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "Route prefixes are recursive, so if a callable executed via an include itself",
                                "type": "context"
                            },
                            {
                                "content": "turns around and includes another callable, the second-level route prefix",
                                "type": "context"
                            },
                            {
                                "content": "will be prepended with the first:",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import warnings\n\nfrom pyramid.compat import urlparse\nfrom pyramid.interfaces import (\n    IRequest,\n    IRouteRequest,\n    IRoutesMapper,\n    PHASE2_CONFIG,\n    )\n\nfrom pyramid.exceptions import ConfigurationError\nfrom pyramid.registry import predvalseq\nfrom pyramid.request import route_request_iface\nfrom pyramid.urldispatch import RoutesMapper\n\nfrom pyramid.config.util import (\n    action_method,\n    as_sorted_tuple,\n    )\n\nimport pyramid.config.predicates\n\nclass RoutesConfiguratorMixin(object):\n    @action_method\n    def add_route(self,\n                  name,\n                  pattern=None,\n                  permission=None,\n                  factory=None,\n                  for_=None,\n                  header=None,\n                  xhr=None,\n                  accept=None,\n                  path_info=None,\n                  request_method=None,\n                  request_param=None,\n                  traverse=None,\n                  custom_predicates=(),\n                  use_global_views=False,\n                  path=None,\n                  pregenerator=None,\n                  static=False,\n                  **predicates):\n        \"\"\" Add a :term:`route configuration` to the current\n        configuration state, as well as possibly a :term:`view\n        configuration` to be used to specify a :term:`view callable`\n        that will be invoked when this route matches.  The arguments\n        to this method are divided into *predicate*, *non-predicate*,\n        and *view-related* types.  :term:`Route predicate` arguments\n        narrow the circumstances in which a route will be match a\n        request; non-predicate arguments are informational.\n\n        Non-Predicate Arguments\n\n        name\n\n          The name of the route, e.g. ``myroute``.  This attribute is\n          required.  It must be unique among all defined routes in a given\n          application.\n\n        factory\n\n          A Python object (often a function or a class) or a :term:`dotted\n          Python name` which refers to the same object that will generate a\n          :app:`Pyramid` root resource object when this route matches. For\n          example, ``mypackage.resources.MyFactory``.  If this argument is\n          not specified, a default root factory will be used.  See\n          :ref:`the_resource_tree` for more information about root factories.\n\n        traverse\n\n          If you would like to cause the :term:`context` to be\n          something other than the :term:`root` object when this route\n          matches, you can spell a traversal pattern as the\n          ``traverse`` argument.  This traversal pattern will be used\n          as the traversal path: traversal will begin at the root\n          object implied by this route (either the global root, or the\n          object returned by the ``factory`` associated with this\n          route).\n\n          The syntax of the ``traverse`` argument is the same as it is\n          for ``pattern``. For example, if the ``pattern`` provided to\n          ``add_route`` is ``articles/{article}/edit``, and the\n          ``traverse`` argument provided to ``add_route`` is\n          ``/{article}``, when a request comes in that causes the route\n          to match in such a way that the ``article`` match value is\n          ``'1'`` (when the request URI is ``/articles/1/edit``), the\n          traversal path will be generated as ``/1``.  This means that\n          the root object's ``__getitem__`` will be called with the\n          name ``'1'`` during the traversal phase.  If the ``'1'`` object\n          exists, it will become the :term:`context` of the request.\n          :ref:`traversal_chapter` has more information about\n          traversal.\n\n          If the traversal path contains segment marker names which\n          are not present in the ``pattern`` argument, a runtime error\n          will occur.  The ``traverse`` pattern should not contain\n          segment markers that do not exist in the ``pattern``\n          argument.\n\n          A similar combining of routing and traversal is available\n          when a route is matched which contains a ``*traverse``\n          remainder marker in its pattern (see\n          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``\n          argument to add_route allows you to associate route patterns\n          with an arbitrary traversal path without using a\n          ``*traverse`` remainder marker; instead you can use other\n          match information.\n\n          Note that the ``traverse`` argument to ``add_route`` is\n          ignored when attached to a route that has a ``*traverse``\n          remainder marker in its pattern.\n\n        pregenerator\n\n           This option should be a callable object that implements the\n           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A\n           :term:`pregenerator` is a callable called by the\n           :meth:`pyramid.request.Request.route_url` function to augment or\n           replace the arguments it is passed when generating a URL for the\n           route.  This is a feature not often used directly by applications,\n           it is meant to be hooked by frameworks that use :app:`Pyramid` as\n           a base.\n\n        use_global_views\n\n          When a request matches this route, and view lookup cannot\n          find a view which has a ``route_name`` predicate argument\n          that matches the route, try to fall back to using a view\n          that otherwise matches the context, request, and view name\n          (but which does not match the route_name predicate).\n\n        static\n\n          If ``static`` is ``True``, this route will never match an incoming\n          request; it will only be useful for URL generation.  By default,\n          ``static`` is ``False``.  See :ref:`static_route_narr`.\n\n          .. versionadded:: 1.1\n\n        Predicate Arguments\n\n        pattern\n\n          The pattern of the route e.g. ``ideas/{idea}``.  This\n          argument is required.  See :ref:`route_pattern_syntax`\n          for information about the syntax of route patterns.  If the\n          pattern doesn't match the current URL, route matching\n          continues.\n\n          .. note::\n\n             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a\n             ``path`` keyword argument passed to this function will be used to\n             represent the pattern value if the ``pattern`` argument is\n             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``\n             wins.\n\n        xhr\n\n          This value should be either ``True`` or ``False``.  If this\n          value is specified and is ``True``, the :term:`request` must\n          possess an ``HTTP_X_REQUESTED_WITH`` (aka\n          ``X-Requested-With``) header for this route to match.  This\n          is useful for detecting AJAX requests issued from jQuery,\n          Prototype and other Javascript libraries.  If this predicate\n          returns ``False``, route matching continues.\n\n        request_method\n\n          A string representing an HTTP method name, e.g. ``GET``, ``POST``,\n          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing\n          HTTP method names.  If this argument is not specified, this route\n          will match if the request has *any* request method.  If this\n          predicate returns ``False``, route matching continues.\n\n          .. versionchanged:: 1.2\n             The ability to pass a tuple of items as ``request_method``.\n             Previous versions allowed only a string.\n\n        path_info\n\n          This value represents a regular expression pattern that will\n          be tested against the ``PATH_INFO`` WSGI environment\n          variable.  If the regex matches, this predicate will return\n          ``True``.  If this predicate returns ``False``, route\n          matching continues.\n\n        request_param\n\n          This value can be any string.  A view declaration with this\n          argument ensures that the associated route will only match\n          when the request has a key in the ``request.params``\n          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a\n          name which matches the supplied value.  If the value\n          supplied as the argument has a ``=`` sign in it,\n          e.g. ``request_param=\"foo=123\"``, then the key\n          (``foo``) must both exist in the ``request.params`` dictionary, and\n          the value must match the right hand side of the expression (``123``)\n          for the route to \"match\" the current request.  If this predicate\n          returns ``False``, route matching continues.\n\n        header\n\n          This argument represents an HTTP header name or a header\n          name/value pair.  If the argument contains a ``:`` (colon),\n          it will be considered a name/value pair\n          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If\n          the value contains a colon, the value portion should be a\n          regular expression.  If the value does not contain a colon,\n          the entire value will be considered to be the header name\n          (e.g. ``If-Modified-Since``).  If the value evaluates to a\n          header name only without a value, the header specified by\n          the name must be present in the request for this predicate\n          to be true.  If the value evaluates to a header name/value\n          pair, the header specified by the name must be present in\n          the request *and* the regular expression specified as the\n          value must match the header value.  Whether or not the value\n          represents a header name or a header name/value pair, the\n          case of the header name is not significant.  If this\n          predicate returns ``False``, route matching continues.\n\n        accept\n\n          This value represents a match query for one or more\n          mimetypes in the ``Accept`` HTTP request header.  If this\n          value is specified, it must be in one of the following\n          forms: a mimetype match token in the form ``text/plain``, a\n          wildcard mimetype match token in the form ``text/*`` or a\n          match-all wildcard mimetype match token in the form ``*/*``.\n          If any of the forms matches the ``Accept`` header of the\n          request, or if the ``Accept`` header isn't set at all in the\n          request, this predicate will be true. If this predicate\n          returns ``False``, route matching continues.\n\n        effective_principals\n\n          If specified, this value should be a :term:`principal` identifier or\n          a sequence of principal identifiers.  If the\n          :attr:`pyramid.request.Request.effective_principals` property\n          indicates that every principal named in the argument list is present\n          in the current request, this predicate will return True; otherwise it\n          will return False.  For example:\n          ``effective_principals=pyramid.security.Authenticated`` or\n          ``effective_principals=('fred', 'group:admins')``.\n\n          .. versionadded:: 1.4a4\n\n        custom_predicates\n\n          .. deprecated:: 1.5\n              This value should be a sequence of references to custom\n              predicate callables.  Use custom predicates when no set of\n              predefined predicates does what you need.  Custom predicates\n              can be combined with predefined predicates as necessary.\n              Each custom predicate callable should accept two arguments:\n              ``info`` and ``request`` and should return either ``True``\n              or ``False`` after doing arbitrary evaluation of the info\n              and/or the request.  If all custom and non-custom predicate\n              callables return ``True`` the associated route will be\n              considered viable for a given request.  If any predicate\n              callable returns ``False``, route matching continues.  Note\n              that the value ``info`` passed to a custom route predicate\n              is a dictionary containing matching information; see\n              :ref:`custom_route_predicates` for more information about\n              ``info``.\n\n        predicates\n\n          Pass a key/value pair here to use a third-party predicate\n          registered via\n          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than\n          one key/value pair can be used at the same time.  See\n          :ref:`view_and_route_predicates` for more information about\n          third-party predicates.\n\n          .. versionadded:: 1.4\n\n        \"\"\"\n        if custom_predicates:\n            warnings.warn(\n                ('The \"custom_predicates\" argument to Configurator.add_route '\n                 'is deprecated as of Pyramid 1.5.  Use '\n                 '\"config.add_route_predicate\" and use the registered '\n                 'route predicate as a predicate argument to add_route '\n                 'instead. See \"Adding A Third Party View, Route, or '\n                 'Subscriber Predicate\" in the \"Hooks\" chapter of the '\n                 'documentation for more information.'),\n                DeprecationWarning,\n                stacklevel=3\n                )\n        # these are route predicates; if they do not match, the next route\n        # in the routelist will be tried\n        if request_method is not None:\n            request_method = as_sorted_tuple(request_method)\n\n        factory = self.maybe_dotted(factory)\n        if pattern is None:\n            pattern = path\n        if pattern is None:\n            raise ConfigurationError('\"pattern\" argument may not be None')\n\n        # check for an external route; an external route is one which is\n        # is a full url (e.g. 'http://example.com/{id}')\n        parsed = urlparse.urlparse(pattern)\n        if parsed.hostname:\n            pattern = parsed.path\n\n            original_pregenerator = pregenerator\n            def external_url_pregenerator(request, elements, kw):\n                if '_app_url' in kw:\n                    raise ValueError(\n                        'You cannot generate a path to an external route '\n                        'pattern via request.route_path nor pass an _app_url '\n                        'to request.route_url when generating a URL for an '\n                        'external route pattern (pattern was \"%s\") ' %\n                        (pattern,)\n                        )\n                if '_scheme' in kw:\n                    scheme = kw['_scheme']\n                elif parsed.scheme:\n                    scheme = parsed.scheme\n                else:\n                    scheme = request.scheme\n                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)\n\n                if original_pregenerator:\n                    elements, kw = original_pregenerator(\n                        request, elements, kw)\n                return elements, kw\n\n            pregenerator = external_url_pregenerator\n            static = True\n\n        elif self.route_prefix:\n            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')\n\n        mapper = self.get_routes_mapper()\n\n        introspectables = []\n\n        intr = self.introspectable('routes',\n                                   name,\n                                   '%s (pattern: %r)' % (name, pattern),\n                                   'route')\n        intr['name'] = name\n        intr['pattern'] = pattern\n        intr['factory'] = factory\n        intr['xhr'] = xhr\n        intr['request_methods'] = request_method\n        intr['path_info'] = path_info\n        intr['request_param'] = request_param\n        intr['header'] = header\n        intr['accept'] = accept\n        intr['traverse'] = traverse\n        intr['custom_predicates'] = custom_predicates\n        intr['pregenerator'] = pregenerator\n        intr['static'] = static\n        intr['use_global_views'] = use_global_views\n        introspectables.append(intr)\n\n        if factory:\n            factory_intr = self.introspectable('root factories',\n                                               name,\n                                               self.object_description(factory),\n                                               'root factory')\n            factory_intr['factory'] = factory\n            factory_intr['route_name'] = name\n            factory_intr.relate('routes', name)\n            introspectables.append(factory_intr)\n\n        def register_route_request_iface():\n            request_iface = self.registry.queryUtility(IRouteRequest, name=name)\n            if request_iface is None:\n                if use_global_views:\n                    bases = (IRequest,)\n                else:\n                    bases = ()\n                request_iface = route_request_iface(name, bases)\n                self.registry.registerUtility(\n                    request_iface, IRouteRequest, name=name)\n\n        def register_connect():\n            pvals = predicates.copy()\n            pvals.update(\n                dict(\n                    xhr=xhr,\n                    request_method=request_method,\n                    path_info=path_info,\n                    request_param=request_param,\n                    header=header,\n                    accept=accept,\n                    traverse=traverse,\n                    custom=predvalseq(custom_predicates),\n                    )\n                )\n\n            predlist = self.get_predlist('route')\n            _, preds, _ = predlist.make(self, **pvals)\n            route = mapper.connect(\n                name, pattern, factory, predicates=preds,\n                pregenerator=pregenerator, static=static\n                )\n            intr['object'] = route\n            return route\n\n        # We have to connect routes in the order they were provided;\n        # we can't use a phase to do that, because when the actions are\n        # sorted, actions in the same phase lose relative ordering\n        self.action(('route-connect', name), register_connect)\n\n        # But IRouteRequest interfaces must be registered before we begin to\n        # process view registrations (in phase 3)\n        self.action(('route', name), register_route_request_iface,\n                    order=PHASE2_CONFIG, introspectables=introspectables)\n\n    @action_method\n    def add_route_predicate(self, name, factory, weighs_more_than=None,\n                           weighs_less_than=None):\n        \"\"\" Adds a route predicate factory.  The view predicate can later be\n        named as a keyword argument to\n        :meth:`pyramid.config.Configurator.add_route`.\n\n        ``name`` should be the name of the predicate.  It must be a valid\n        Python identifier (it will be used as a keyword argument to\n        ``add_view``).\n\n        ``factory`` should be a :term:`predicate factory` or :term:`dotted\n        Python name` which refers to a predicate factory.\n\n        See :ref:`view_and_route_predicates` for more information.\n\n        .. versionadded:: 1.4\n        \"\"\"\n        self._add_predicate(\n            'route',\n            name,\n            factory,\n            weighs_more_than=weighs_more_than,\n            weighs_less_than=weighs_less_than\n            )\n\n    def add_default_route_predicates(self):\n        p = pyramid.config.predicates\n        for (name, factory) in (\n            ('xhr', p.XHRPredicate),\n            ('request_method', p.RequestMethodPredicate),\n            ('path_info', p.PathInfoPredicate),\n            ('request_param', p.RequestParamPredicate),\n            ('header', p.HeaderPredicate),\n            ('accept', p.AcceptPredicate),\n            ('effective_principals', p.EffectivePrincipalsPredicate),\n            ('custom', p.CustomPredicate),\n            ('traverse', p.TraversePredicate),\n            ):\n            self.add_route_predicate(name, factory)\n\n    def get_routes_mapper(self):\n        \"\"\" Return the :term:`routes mapper` object associated with\n        this configurator's :term:`registry`.\"\"\"\n        mapper = self.registry.queryUtility(IRoutesMapper)\n        if mapper is None:\n            mapper = RoutesMapper()\n            self.registry.registerUtility(mapper, IRoutesMapper)\n        return mapper\n\n",
            "new_file_content": "import warnings\n\nfrom pyramid.compat import urlparse\nfrom pyramid.interfaces import (\n    IRequest,\n    IRouteRequest,\n    IRoutesMapper,\n    PHASE2_CONFIG,\n    )\n\nfrom pyramid.exceptions import ConfigurationError\nfrom pyramid.registry import predvalseq\nfrom pyramid.request import route_request_iface\nfrom pyramid.urldispatch import RoutesMapper\n\nfrom pyramid.config.util import (\n    action_method,\n    as_sorted_tuple,\n    )\n\nimport pyramid.config.predicates\n\nclass RoutesConfiguratorMixin(object):\n    @action_method\n    def add_route(self,\n                  name,\n                  pattern=None,\n                  permission=None,\n                  factory=None,\n                  for_=None,\n                  header=None,\n                  xhr=None,\n                  accept=None,\n                  path_info=None,\n                  request_method=None,\n                  request_param=None,\n                  traverse=None,\n                  custom_predicates=(),\n                  use_global_views=False,\n                  path=None,\n                  pregenerator=None,\n                  static=False,\n                  **predicates):\n        \"\"\" Add a :term:`route configuration` to the current\n        configuration state, as well as possibly a :term:`view\n        configuration` to be used to specify a :term:`view callable`\n        that will be invoked when this route matches.  The arguments\n        to this method are divided into *predicate*, *non-predicate*,\n        and *view-related* types.  :term:`Route predicate` arguments\n        narrow the circumstances in which a route will be match a\n        request; non-predicate arguments are informational.\n\n        Non-Predicate Arguments\n\n        name\n\n          The name of the route, e.g. ``myroute``.  This attribute is\n          required.  It must be unique among all defined routes in a given\n          application.\n\n        factory\n\n          A Python object (often a function or a class) or a :term:`dotted\n          Python name` which refers to the same object that will generate a\n          :app:`Pyramid` root resource object when this route matches. For\n          example, ``mypackage.resources.MyFactory``.  If this argument is\n          not specified, a default root factory will be used.  See\n          :ref:`the_resource_tree` for more information about root factories.\n\n        traverse\n\n          If you would like to cause the :term:`context` to be\n          something other than the :term:`root` object when this route\n          matches, you can spell a traversal pattern as the\n          ``traverse`` argument.  This traversal pattern will be used\n          as the traversal path: traversal will begin at the root\n          object implied by this route (either the global root, or the\n          object returned by the ``factory`` associated with this\n          route).\n\n          The syntax of the ``traverse`` argument is the same as it is\n          for ``pattern``. For example, if the ``pattern`` provided to\n          ``add_route`` is ``articles/{article}/edit``, and the\n          ``traverse`` argument provided to ``add_route`` is\n          ``/{article}``, when a request comes in that causes the route\n          to match in such a way that the ``article`` match value is\n          ``'1'`` (when the request URI is ``/articles/1/edit``), the\n          traversal path will be generated as ``/1``.  This means that\n          the root object's ``__getitem__`` will be called with the\n          name ``'1'`` during the traversal phase.  If the ``'1'`` object\n          exists, it will become the :term:`context` of the request.\n          :ref:`traversal_chapter` has more information about\n          traversal.\n\n          If the traversal path contains segment marker names which\n          are not present in the ``pattern`` argument, a runtime error\n          will occur.  The ``traverse`` pattern should not contain\n          segment markers that do not exist in the ``pattern``\n          argument.\n\n          A similar combining of routing and traversal is available\n          when a route is matched which contains a ``*traverse``\n          remainder marker in its pattern (see\n          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``\n          argument to add_route allows you to associate route patterns\n          with an arbitrary traversal path without using a\n          ``*traverse`` remainder marker; instead you can use other\n          match information.\n\n          Note that the ``traverse`` argument to ``add_route`` is\n          ignored when attached to a route that has a ``*traverse``\n          remainder marker in its pattern.\n\n        pregenerator\n\n           This option should be a callable object that implements the\n           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A\n           :term:`pregenerator` is a callable called by the\n           :meth:`pyramid.request.Request.route_url` function to augment or\n           replace the arguments it is passed when generating a URL for the\n           route.  This is a feature not often used directly by applications,\n           it is meant to be hooked by frameworks that use :app:`Pyramid` as\n           a base.\n\n        use_global_views\n\n          When a request matches this route, and view lookup cannot\n          find a view which has a ``route_name`` predicate argument\n          that matches the route, try to fall back to using a view\n          that otherwise matches the context, request, and view name\n          (but which does not match the route_name predicate).\n\n        static\n\n          If ``static`` is ``True``, this route will never match an incoming\n          request; it will only be useful for URL generation.  By default,\n          ``static`` is ``False``.  See :ref:`static_route_narr`.\n\n          .. versionadded:: 1.1\n\n        Predicate Arguments\n\n        pattern\n\n          The pattern of the route e.g. ``ideas/{idea}``.  This\n          argument is required.  See :ref:`route_pattern_syntax`\n          for information about the syntax of route patterns.  If the\n          pattern doesn't match the current URL, route matching\n          continues.\n\n          .. note::\n\n             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a\n             ``path`` keyword argument passed to this function will be used to\n             represent the pattern value if the ``pattern`` argument is\n             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``\n             wins.\n\n        xhr\n\n          This value should be either ``True`` or ``False``.  If this\n          value is specified and is ``True``, the :term:`request` must\n          possess an ``HTTP_X_REQUESTED_WITH`` (aka\n          ``X-Requested-With``) header for this route to match.  This\n          is useful for detecting AJAX requests issued from jQuery,\n          Prototype and other Javascript libraries.  If this predicate\n          returns ``False``, route matching continues.\n\n        request_method\n\n          A string representing an HTTP method name, e.g. ``GET``, ``POST``,\n          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing\n          HTTP method names.  If this argument is not specified, this route\n          will match if the request has *any* request method.  If this\n          predicate returns ``False``, route matching continues.\n\n          .. versionchanged:: 1.2\n             The ability to pass a tuple of items as ``request_method``.\n             Previous versions allowed only a string.\n\n        path_info\n\n          This value represents a regular expression pattern that will\n          be tested against the ``PATH_INFO`` WSGI environment\n          variable.  If the regex matches, this predicate will return\n          ``True``.  If this predicate returns ``False``, route\n          matching continues.\n\n        request_param\n\n          This value can be any string.  A view declaration with this\n          argument ensures that the associated route will only match\n          when the request has a key in the ``request.params``\n          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a\n          name which matches the supplied value.  If the value\n          supplied as the argument has a ``=`` sign in it,\n          e.g. ``request_param=\"foo=123\"``, then the key\n          (``foo``) must both exist in the ``request.params`` dictionary, and\n          the value must match the right hand side of the expression (``123``)\n          for the route to \"match\" the current request.  If this predicate\n          returns ``False``, route matching continues.\n\n        header\n\n          This argument represents an HTTP header name or a header\n          name/value pair.  If the argument contains a ``:`` (colon),\n          it will be considered a name/value pair\n          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If\n          the value contains a colon, the value portion should be a\n          regular expression.  If the value does not contain a colon,\n          the entire value will be considered to be the header name\n          (e.g. ``If-Modified-Since``).  If the value evaluates to a\n          header name only without a value, the header specified by\n          the name must be present in the request for this predicate\n          to be true.  If the value evaluates to a header name/value\n          pair, the header specified by the name must be present in\n          the request *and* the regular expression specified as the\n          value must match the header value.  Whether or not the value\n          represents a header name or a header name/value pair, the\n          case of the header name is not significant.  If this\n          predicate returns ``False``, route matching continues.\n\n        accept\n\n          This value represents a match query for one or more\n          mimetypes in the ``Accept`` HTTP request header.  If this\n          value is specified, it must be in one of the following\n          forms: a mimetype match token in the form ``text/plain``, a\n          wildcard mimetype match token in the form ``text/*`` or a\n          match-all wildcard mimetype match token in the form ``*/*``.\n          If any of the forms matches the ``Accept`` header of the\n          request, or if the ``Accept`` header isn't set at all in the\n          request, this predicate will be true. If this predicate\n          returns ``False``, route matching continues.\n\n        effective_principals\n\n          If specified, this value should be a :term:`principal` identifier or\n          a sequence of principal identifiers.  If the\n          :attr:`pyramid.request.Request.effective_principals` property\n          indicates that every principal named in the argument list is present\n          in the current request, this predicate will return True; otherwise it\n          will return False.  For example:\n          ``effective_principals=pyramid.security.Authenticated`` or\n          ``effective_principals=('fred', 'group:admins')``.\n\n          .. versionadded:: 1.4a4\n\n        custom_predicates\n\n          .. deprecated:: 1.5\n              This value should be a sequence of references to custom\n              predicate callables.  Use custom predicates when no set of\n              predefined predicates does what you need.  Custom predicates\n              can be combined with predefined predicates as necessary.\n              Each custom predicate callable should accept two arguments:\n              ``info`` and ``request`` and should return either ``True``\n              or ``False`` after doing arbitrary evaluation of the info\n              and/or the request.  If all custom and non-custom predicate\n              callables return ``True`` the associated route will be\n              considered viable for a given request.  If any predicate\n              callable returns ``False``, route matching continues.  Note\n              that the value ``info`` passed to a custom route predicate\n              is a dictionary containing matching information; see\n              :ref:`custom_route_predicates` for more information about\n              ``info``.\n\n        predicates\n\n          Pass a key/value pair here to use a third-party predicate\n          registered via\n          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than\n          one key/value pair can be used at the same time.  See\n          :ref:`view_and_route_predicates` for more information about\n          third-party predicates.\n\n          .. versionadded:: 1.4\n\n        \"\"\"\n        if custom_predicates:\n            warnings.warn(\n                ('The \"custom_predicates\" argument to Configurator.add_route '\n                 'is deprecated as of Pyramid 1.5.  Use '\n                 '\"config.add_route_predicate\" and use the registered '\n                 'route predicate as a predicate argument to add_route '\n                 'instead. See \"Adding A Third Party View, Route, or '\n                 'Subscriber Predicate\" in the \"Hooks\" chapter of the '\n                 'documentation for more information.'),\n                DeprecationWarning,\n                stacklevel=3\n                )\n        # these are route predicates; if they do not match, the next route\n        # in the routelist will be tried\n        if request_method is not None:\n            request_method = as_sorted_tuple(request_method)\n\n        factory = self.maybe_dotted(factory)\n        if pattern is None:\n            pattern = path\n        if pattern is None:\n            raise ConfigurationError('\"pattern\" argument may not be None')\n\n        # check for an external route; an external route is one which is\n        # is a full url (e.g. 'http://example.com/{id}')\n        parsed = urlparse.urlparse(pattern)\n        if parsed.hostname:\n            pattern = parsed.path\n\n            original_pregenerator = pregenerator\n            def external_url_pregenerator(request, elements, kw):\n                if '_app_url' in kw:\n                    raise ValueError(\n                        'You cannot generate a path to an external route '\n                        'pattern via request.route_path nor pass an _app_url '\n                        'to request.route_url when generating a URL for an '\n                        'external route pattern (pattern was \"%s\") ' %\n                        (pattern,)\n                        )\n                if '_scheme' in kw:\n                    scheme = kw['_scheme']\n                elif parsed.scheme:\n                    scheme = parsed.scheme\n                else:\n                    scheme = request.scheme\n                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)\n\n                if original_pregenerator:\n                    elements, kw = original_pregenerator(\n                        request, elements, kw)\n                return elements, kw\n\n            pregenerator = external_url_pregenerator\n            static = True\n\n        elif self.route_prefix:\n            if pattern == '':\n                pattern = self.route_prefix.rstrip('/')\n            else:\n                pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')\n\n        mapper = self.get_routes_mapper()\n\n        introspectables = []\n\n        intr = self.introspectable('routes',\n                                   name,\n                                   '%s (pattern: %r)' % (name, pattern),\n                                   'route')\n        intr['name'] = name\n        intr['pattern'] = pattern\n        intr['factory'] = factory\n        intr['xhr'] = xhr\n        intr['request_methods'] = request_method\n        intr['path_info'] = path_info\n        intr['request_param'] = request_param\n        intr['header'] = header\n        intr['accept'] = accept\n        intr['traverse'] = traverse\n        intr['custom_predicates'] = custom_predicates\n        intr['pregenerator'] = pregenerator\n        intr['static'] = static\n        intr['use_global_views'] = use_global_views\n        introspectables.append(intr)\n\n        if factory:\n            factory_intr = self.introspectable('root factories',\n                                               name,\n                                               self.object_description(factory),\n                                               'root factory')\n            factory_intr['factory'] = factory\n            factory_intr['route_name'] = name\n            factory_intr.relate('routes', name)\n            introspectables.append(factory_intr)\n\n        def register_route_request_iface():\n            request_iface = self.registry.queryUtility(IRouteRequest, name=name)\n            if request_iface is None:\n                if use_global_views:\n                    bases = (IRequest,)\n                else:\n                    bases = ()\n                request_iface = route_request_iface(name, bases)\n                self.registry.registerUtility(\n                    request_iface, IRouteRequest, name=name)\n\n        def register_connect():\n            pvals = predicates.copy()\n            pvals.update(\n                dict(\n                    xhr=xhr,\n                    request_method=request_method,\n                    path_info=path_info,\n                    request_param=request_param,\n                    header=header,\n                    accept=accept,\n                    traverse=traverse,\n                    custom=predvalseq(custom_predicates),\n                    )\n                )\n\n            predlist = self.get_predlist('route')\n            _, preds, _ = predlist.make(self, **pvals)\n            route = mapper.connect(\n                name, pattern, factory, predicates=preds,\n                pregenerator=pregenerator, static=static\n                )\n            intr['object'] = route\n            return route\n\n        # We have to connect routes in the order they were provided;\n        # we can't use a phase to do that, because when the actions are\n        # sorted, actions in the same phase lose relative ordering\n        self.action(('route-connect', name), register_connect)\n\n        # But IRouteRequest interfaces must be registered before we begin to\n        # process view registrations (in phase 3)\n        self.action(('route', name), register_route_request_iface,\n                    order=PHASE2_CONFIG, introspectables=introspectables)\n\n    @action_method\n    def add_route_predicate(self, name, factory, weighs_more_than=None,\n                           weighs_less_than=None):\n        \"\"\" Adds a route predicate factory.  The view predicate can later be\n        named as a keyword argument to\n        :meth:`pyramid.config.Configurator.add_route`.\n\n        ``name`` should be the name of the predicate.  It must be a valid\n        Python identifier (it will be used as a keyword argument to\n        ``add_view``).\n\n        ``factory`` should be a :term:`predicate factory` or :term:`dotted\n        Python name` which refers to a predicate factory.\n\n        See :ref:`view_and_route_predicates` for more information.\n\n        .. versionadded:: 1.4\n        \"\"\"\n        self._add_predicate(\n            'route',\n            name,\n            factory,\n            weighs_more_than=weighs_more_than,\n            weighs_less_than=weighs_less_than\n            )\n\n    def add_default_route_predicates(self):\n        p = pyramid.config.predicates\n        for (name, factory) in (\n            ('xhr', p.XHRPredicate),\n            ('request_method', p.RequestMethodPredicate),\n            ('path_info', p.PathInfoPredicate),\n            ('request_param', p.RequestParamPredicate),\n            ('header', p.HeaderPredicate),\n            ('accept', p.AcceptPredicate),\n            ('effective_principals', p.EffectivePrincipalsPredicate),\n            ('custom', p.CustomPredicate),\n            ('traverse', p.TraversePredicate),\n            ):\n            self.add_route_predicate(name, factory)\n\n    def get_routes_mapper(self):\n        \"\"\" Return the :term:`routes mapper` object associated with\n        this configurator's :term:`registry`.\"\"\"\n        mapper = self.registry.queryUtility(IRoutesMapper)\n        if mapper is None:\n            mapper = RoutesMapper()\n            self.registry.registerUtility(mapper, IRoutesMapper)\n        return mapper\n\n",
            "header": {
                "file": {
                    "path": "pyramid/config/routes.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "f1463b50b",
                "new_commit_hash": "971e3fc95",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/pyramid/config/routes.py"
            },
            "plus_file": {
                "path": "b/pyramid/config/routes.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 333,
                            "length": 7
                        },
                        "new_range": {
                            "start": 333,
                            "length": 10
                        },
                        "section": "class RoutesConfiguratorMixin(object):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "            static = True",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        elif self.route_prefix:",
                                "type": "context"
                            },
                            {
                                "content": "            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')",
                                "type": "deleted"
                            },
                            {
                                "content": "            if pattern == '':",
                                "type": "added"
                            },
                            {
                                "content": "                pattern = self.route_prefix.rstrip('/')",
                                "type": "added"
                            },
                            {
                                "content": "            else:",
                                "type": "added"
                            },
                            {
                                "content": "                pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "        mapper = self.get_routes_mapper()",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "pyramid/config/routes.py",
                            "type": "class",
                            "name": "RoutesConfiguratorMixin",
                            "content": "class RoutesConfiguratorMixin(object):\n    @action_method\n    def add_route(self,\n                  name,\n                  pattern=None,\n                  permission=None,\n                  factory=None,\n                  for_=None,\n                  header=None,\n                  xhr=None,\n                  accept=None,\n                  path_info=None,\n                  request_method=None,\n                  request_param=None,\n                  traverse=None,\n                  custom_predicates=(),\n                  use_global_views=False,\n                  path=None,\n                  pregenerator=None,\n                  static=False,\n                  **predicates):\n        \"\"\" Add a :term:`route configuration` to the current\n        configuration state, as well as possibly a :term:`view\n        configuration` to be used to specify a :term:`view callable`\n        that will be invoked when this route matches.  The arguments\n        to this method are divided into *predicate*, *non-predicate*,\n        and *view-related* types.  :term:`Route predicate` arguments\n        narrow the circumstances in which a route will be match a\n        request; non-predicate arguments are informational.\n\n        Non-Predicate Arguments\n\n        name\n\n          The name of the route, e.g. ``myroute``.  This attribute is\n          required.  It must be unique among all defined routes in a given\n          application.\n\n        factory\n\n          A Python object (often a function or a class) or a :term:`dotted\n          Python name` which refers to the same object that will generate a\n          :app:`Pyramid` root resource object when this route matches. For\n          example, ``mypackage.resources.MyFactory``.  If this argument is\n          not specified, a default root factory will be used.  See\n          :ref:`the_resource_tree` for more information about root factories.\n\n        traverse\n\n          If you would like to cause the :term:`context` to be\n          something other than the :term:`root` object when this route\n          matches, you can spell a traversal pattern as the\n          ``traverse`` argument.  This traversal pattern will be used\n          as the traversal path: traversal will begin at the root\n          object implied by this route (either the global root, or the\n          object returned by the ``factory`` associated with this\n          route).\n\n          The syntax of the ``traverse`` argument is the same as it is\n          for ``pattern``. For example, if the ``pattern`` provided to\n          ``add_route`` is ``articles/{article}/edit``, and the\n          ``traverse`` argument provided to ``add_route`` is\n          ``/{article}``, when a request comes in that causes the route\n          to match in such a way that the ``article`` match value is\n          ``'1'`` (when the request URI is ``/articles/1/edit``), the\n          traversal path will be generated as ``/1``.  This means that\n          the root object's ``__getitem__`` will be called with the\n          name ``'1'`` during the traversal phase.  If the ``'1'`` object\n          exists, it will become the :term:`context` of the request.\n          :ref:`traversal_chapter` has more information about\n          traversal.\n\n          If the traversal path contains segment marker names which\n          are not present in the ``pattern`` argument, a runtime error\n          will occur.  The ``traverse`` pattern should not contain\n          segment markers that do not exist in the ``pattern``\n          argument.\n\n          A similar combining of routing and traversal is available\n          when a route is matched which contains a ``*traverse``\n          remainder marker in its pattern (see\n          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``\n          argument to add_route allows you to associate route patterns\n          with an arbitrary traversal path without using a\n          ``*traverse`` remainder marker; instead you can use other\n          match information.\n\n          Note that the ``traverse`` argument to ``add_route`` is\n          ignored when attached to a route that has a ``*traverse``\n          remainder marker in its pattern.\n\n        pregenerator\n\n           This option should be a callable object that implements the\n           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A\n           :term:`pregenerator` is a callable called by the\n           :meth:`pyramid.request.Request.route_url` function to augment or\n           replace the arguments it is passed when generating a URL for the\n           route.  This is a feature not often used directly by applications,\n           it is meant to be hooked by frameworks that use :app:`Pyramid` as\n           a base.\n\n        use_global_views\n\n          When a request matches this route, and view lookup cannot\n          find a view which has a ``route_name`` predicate argument\n          that matches the route, try to fall back to using a view\n          that otherwise matches the context, request, and view name\n          (but which does not match the route_name predicate).\n\n        static\n\n          If ``static`` is ``True``, this route will never match an incoming\n          request; it will only be useful for URL generation.  By default,\n          ``static`` is ``False``.  See :ref:`static_route_narr`.\n\n          .. versionadded:: 1.1\n\n        Predicate Arguments\n\n        pattern\n\n          The pattern of the route e.g. ``ideas/{idea}``.  This\n          argument is required.  See :ref:`route_pattern_syntax`\n          for information about the syntax of route patterns.  If the\n          pattern doesn't match the current URL, route matching\n          continues.\n\n          .. note::\n\n             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a\n             ``path`` keyword argument passed to this function will be used to\n             represent the pattern value if the ``pattern`` argument is\n             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``\n             wins.\n\n        xhr\n\n          This value should be either ``True`` or ``False``.  If this\n          value is specified and is ``True``, the :term:`request` must\n          possess an ``HTTP_X_REQUESTED_WITH`` (aka\n          ``X-Requested-With``) header for this route to match.  This\n          is useful for detecting AJAX requests issued from jQuery,\n          Prototype and other Javascript libraries.  If this predicate\n          returns ``False``, route matching continues.\n\n        request_method\n\n          A string representing an HTTP method name, e.g. ``GET``, ``POST``,\n          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing\n          HTTP method names.  If this argument is not specified, this route\n          will match if the request has *any* request method.  If this\n          predicate returns ``False``, route matching continues.\n\n          .. versionchanged:: 1.2\n             The ability to pass a tuple of items as ``request_method``.\n             Previous versions allowed only a string.\n\n        path_info\n\n          This value represents a regular expression pattern that will\n          be tested against the ``PATH_INFO`` WSGI environment\n          variable.  If the regex matches, this predicate will return\n          ``True``.  If this predicate returns ``False``, route\n          matching continues.\n\n        request_param\n\n          This value can be any string.  A view declaration with this\n          argument ensures that the associated route will only match\n          when the request has a key in the ``request.params``\n          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a\n          name which matches the supplied value.  If the value\n          supplied as the argument has a ``=`` sign in it,\n          e.g. ``request_param=\"foo=123\"``, then the key\n          (``foo``) must both exist in the ``request.params`` dictionary, and\n          the value must match the right hand side of the expression (``123``)\n          for the route to \"match\" the current request.  If this predicate\n          returns ``False``, route matching continues.\n\n        header\n\n          This argument represents an HTTP header name or a header\n          name/value pair.  If the argument contains a ``:`` (colon),\n          it will be considered a name/value pair\n          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If\n          the value contains a colon, the value portion should be a\n          regular expression.  If the value does not contain a colon,\n          the entire value will be considered to be the header name\n          (e.g. ``If-Modified-Since``).  If the value evaluates to a\n          header name only without a value, the header specified by\n          the name must be present in the request for this predicate\n          to be true.  If the value evaluates to a header name/value\n          pair, the header specified by the name must be present in\n          the request *and* the regular expression specified as the\n          value must match the header value.  Whether or not the value\n          represents a header name or a header name/value pair, the\n          case of the header name is not significant.  If this\n          predicate returns ``False``, route matching continues.\n\n        accept\n\n          This value represents a match query for one or more\n          mimetypes in the ``Accept`` HTTP request header.  If this\n          value is specified, it must be in one of the following\n          forms: a mimetype match token in the form ``text/plain``, a\n          wildcard mimetype match token in the form ``text/*`` or a\n          match-all wildcard mimetype match token in the form ``*/*``.\n          If any of the forms matches the ``Accept`` header of the\n          request, or if the ``Accept`` header isn't set at all in the\n          request, this predicate will be true. If this predicate\n          returns ``False``, route matching continues.\n\n        effective_principals\n\n          If specified, this value should be a :term:`principal` identifier or\n          a sequence of principal identifiers.  If the\n          :attr:`pyramid.request.Request.effective_principals` property\n          indicates that every principal named in the argument list is present\n          in the current request, this predicate will return True; otherwise it\n          will return False.  For example:\n          ``effective_principals=pyramid.security.Authenticated`` or\n          ``effective_principals=('fred', 'group:admins')``.\n\n          .. versionadded:: 1.4a4\n\n        custom_predicates\n\n          .. deprecated:: 1.5\n              This value should be a sequence of references to custom\n              predicate callables.  Use custom predicates when no set of\n              predefined predicates does what you need.  Custom predicates\n              can be combined with predefined predicates as necessary.\n              Each custom predicate callable should accept two arguments:\n              ``info`` and ``request`` and should return either ``True``\n              or ``False`` after doing arbitrary evaluation of the info\n              and/or the request.  If all custom and non-custom predicate\n              callables return ``True`` the associated route will be\n              considered viable for a given request.  If any predicate\n              callable returns ``False``, route matching continues.  Note\n              that the value ``info`` passed to a custom route predicate\n              is a dictionary containing matching information; see\n              :ref:`custom_route_predicates` for more information about\n              ``info``.\n\n        predicates\n\n          Pass a key/value pair here to use a third-party predicate\n          registered via\n          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than\n          one key/value pair can be used at the same time.  See\n          :ref:`view_and_route_predicates` for more information about\n          third-party predicates.\n\n          .. versionadded:: 1.4\n\n        \"\"\"\n        if custom_predicates:\n            warnings.warn(\n                ('The \"custom_predicates\" argument to Configurator.add_route '\n                 'is deprecated as of Pyramid 1.5.  Use '\n                 '\"config.add_route_predicate\" and use the registered '\n                 'route predicate as a predicate argument to add_route '\n                 'instead. See \"Adding A Third Party View, Route, or '\n                 'Subscriber Predicate\" in the \"Hooks\" chapter of the '\n                 'documentation for more information.'),\n                DeprecationWarning,\n                stacklevel=3\n                )\n        # these are route predicates; if they do not match, the next route\n        # in the routelist will be tried\n        if request_method is not None:\n            request_method = as_sorted_tuple(request_method)\n\n        factory = self.maybe_dotted(factory)\n        if pattern is None:\n            pattern = path\n        if pattern is None:\n            raise ConfigurationError('\"pattern\" argument may not be None')\n\n        # check for an external route; an external route is one which is\n        # is a full url (e.g. 'http://example.com/{id}')\n        parsed = urlparse.urlparse(pattern)\n        if parsed.hostname:\n            pattern = parsed.path\n\n            original_pregenerator = pregenerator\n            def external_url_pregenerator(request, elements, kw):\n                if '_app_url' in kw:\n                    raise ValueError(\n                        'You cannot generate a path to an external route '\n                        'pattern via request.route_path nor pass an _app_url '\n                        'to request.route_url when generating a URL for an '\n                        'external route pattern (pattern was \"%s\") ' %\n                        (pattern,)\n                        )\n                if '_scheme' in kw:\n                    scheme = kw['_scheme']\n                elif parsed.scheme:\n                    scheme = parsed.scheme\n                else:\n                    scheme = request.scheme\n                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)\n\n                if original_pregenerator:\n                    elements, kw = original_pregenerator(\n                        request, elements, kw)\n                return elements, kw\n\n            pregenerator = external_url_pregenerator\n            static = True\n\n        elif self.route_prefix:\n            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')\n\n        mapper = self.get_routes_mapper()\n\n        introspectables = []\n\n        intr = self.introspectable('routes',\n                                   name,\n                                   '%s (pattern: %r)' % (name, pattern),\n                                   'route')\n        intr['name'] = name\n        intr['pattern'] = pattern\n        intr['factory'] = factory\n        intr['xhr'] = xhr\n        intr['request_methods'] = request_method\n        intr['path_info'] = path_info\n        intr['request_param'] = request_param\n        intr['header'] = header\n        intr['accept'] = accept\n        intr['traverse'] = traverse\n        intr['custom_predicates'] = custom_predicates\n        intr['pregenerator'] = pregenerator\n        intr['static'] = static\n        intr['use_global_views'] = use_global_views\n        introspectables.append(intr)\n\n        if factory:\n            factory_intr = self.introspectable('root factories',\n                                               name,\n                                               self.object_description(factory),\n                                               'root factory')\n            factory_intr['factory'] = factory\n            factory_intr['route_name'] = name\n            factory_intr.relate('routes', name)\n            introspectables.append(factory_intr)\n\n        def register_route_request_iface():\n            request_iface = self.registry.queryUtility(IRouteRequest, name=name)\n            if request_iface is None:\n                if use_global_views:\n                    bases = (IRequest,)\n                else:\n                    bases = ()\n                request_iface = route_request_iface(name, bases)\n                self.registry.registerUtility(\n                    request_iface, IRouteRequest, name=name)\n\n        def register_connect():\n            pvals = predicates.copy()\n            pvals.update(\n                dict(\n                    xhr=xhr,\n                    request_method=request_method,\n                    path_info=path_info,\n                    request_param=request_param,\n                    header=header,\n                    accept=accept,\n                    traverse=traverse,\n                    custom=predvalseq(custom_predicates),\n                    )\n                )\n\n            predlist = self.get_predlist('route')\n            _, preds, _ = predlist.make(self, **pvals)\n            route = mapper.connect(\n                name, pattern, factory, predicates=preds,\n                pregenerator=pregenerator, static=static\n                )\n            intr['object'] = route\n            return route\n\n        # We have to connect routes in the order they were provided;\n        # we can't use a phase to do that, because when the actions are\n        # sorted, actions in the same phase lose relative ordering\n        self.action(('route-connect', name), register_connect)\n\n        # But IRouteRequest interfaces must be registered before we begin to\n        # process view registrations (in phase 3)\n        self.action(('route', name), register_route_request_iface,\n                    order=PHASE2_CONFIG, introspectables=introspectables)\n\n    @action_method\n    def add_route_predicate(self, name, factory, weighs_more_than=None,\n                           weighs_less_than=None):\n        \"\"\" Adds a route predicate factory.  The view predicate can later be\n        named as a keyword argument to\n        :meth:`pyramid.config.Configurator.add_route`.\n\n        ``name`` should be the name of the predicate.  It must be a valid\n        Python identifier (it will be used as a keyword argument to\n        ``add_view``).\n\n        ``factory`` should be a :term:`predicate factory` or :term:`dotted\n        Python name` which refers to a predicate factory.\n\n        See :ref:`view_and_route_predicates` for more information.\n\n        .. versionadded:: 1.4\n        \"\"\"\n        self._add_predicate(\n            'route',\n            name,\n            factory,\n            weighs_more_than=weighs_more_than,\n            weighs_less_than=weighs_less_than\n            )\n\n    def add_default_route_predicates(self):\n        p = pyramid.config.predicates\n        for (name, factory) in (\n            ('xhr', p.XHRPredicate),\n            ('request_method', p.RequestMethodPredicate),\n            ('path_info', p.PathInfoPredicate),\n            ('request_param', p.RequestParamPredicate),\n            ('header', p.HeaderPredicate),\n            ('accept', p.AcceptPredicate),\n            ('effective_principals', p.EffectivePrincipalsPredicate),\n            ('custom', p.CustomPredicate),\n            ('traverse', p.TraversePredicate),\n            ):\n            self.add_route_predicate(name, factory)\n\n    def get_routes_mapper(self):\n        \"\"\" Return the :term:`routes mapper` object associated with\n        this configurator's :term:`registry`.\"\"\"\n        mapper = self.registry.queryUtility(IRoutesMapper)\n        if mapper is None:\n            mapper = RoutesMapper()\n            self.registry.registerUtility(mapper, IRoutesMapper)\n        return mapper",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 23,
                            "end_lineno": 465,
                            "parent": null
                        },
                        {
                            "file_name": "pyramid/config/routes.py",
                            "type": "method",
                            "name": "RoutesConfiguratorMixin.add_route",
                            "content": "class RoutesConfiguratorMixin(object):\n    @action_method\n    def add_route(self,\n                  name,\n                  pattern=None,\n                  permission=None,\n                  factory=None,\n                  for_=None,\n                  header=None,\n                  xhr=None,\n                  accept=None,\n                  path_info=None,\n                  request_method=None,\n                  request_param=None,\n                  traverse=None,\n                  custom_predicates=(),\n                  use_global_views=False,\n                  path=None,\n                  pregenerator=None,\n                  static=False,\n                  **predicates):\n        \"\"\" Add a :term:`route configuration` to the current\n        configuration state, as well as possibly a :term:`view\n        configuration` to be used to specify a :term:`view callable`\n        that will be invoked when this route matches.  The arguments\n        to this method are divided into *predicate*, *non-predicate*,\n        and *view-related* types.  :term:`Route predicate` arguments\n        narrow the circumstances in which a route will be match a\n        request; non-predicate arguments are informational.\n\n        Non-Predicate Arguments\n\n        name\n\n          The name of the route, e.g. ``myroute``.  This attribute is\n          required.  It must be unique among all defined routes in a given\n          application.\n\n        factory\n\n          A Python object (often a function or a class) or a :term:`dotted\n          Python name` which refers to the same object that will generate a\n          :app:`Pyramid` root resource object when this route matches. For\n          example, ``mypackage.resources.MyFactory``.  If this argument is\n          not specified, a default root factory will be used.  See\n          :ref:`the_resource_tree` for more information about root factories.\n\n        traverse\n\n          If you would like to cause the :term:`context` to be\n          something other than the :term:`root` object when this route\n          matches, you can spell a traversal pattern as the\n          ``traverse`` argument.  This traversal pattern will be used\n          as the traversal path: traversal will begin at the root\n          object implied by this route (either the global root, or the\n          object returned by the ``factory`` associated with this\n          route).\n\n          The syntax of the ``traverse`` argument is the same as it is\n          for ``pattern``. For example, if the ``pattern`` provided to\n          ``add_route`` is ``articles/{article}/edit``, and the\n          ``traverse`` argument provided to ``add_route`` is\n          ``/{article}``, when a request comes in that causes the route\n          to match in such a way that the ``article`` match value is\n          ``'1'`` (when the request URI is ``/articles/1/edit``), the\n          traversal path will be generated as ``/1``.  This means that\n          the root object's ``__getitem__`` will be called with the\n          name ``'1'`` during the traversal phase.  If the ``'1'`` object\n          exists, it will become the :term:`context` of the request.\n          :ref:`traversal_chapter` has more information about\n          traversal.\n\n          If the traversal path contains segment marker names which\n          are not present in the ``pattern`` argument, a runtime error\n          will occur.  The ``traverse`` pattern should not contain\n          segment markers that do not exist in the ``pattern``\n          argument.\n\n          A similar combining of routing and traversal is available\n          when a route is matched which contains a ``*traverse``\n          remainder marker in its pattern (see\n          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``\n          argument to add_route allows you to associate route patterns\n          with an arbitrary traversal path without using a\n          ``*traverse`` remainder marker; instead you can use other\n          match information.\n\n          Note that the ``traverse`` argument to ``add_route`` is\n          ignored when attached to a route that has a ``*traverse``\n          remainder marker in its pattern.\n\n        pregenerator\n\n           This option should be a callable object that implements the\n           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A\n           :term:`pregenerator` is a callable called by the\n           :meth:`pyramid.request.Request.route_url` function to augment or\n           replace the arguments it is passed when generating a URL for the\n           route.  This is a feature not often used directly by applications,\n           it is meant to be hooked by frameworks that use :app:`Pyramid` as\n           a base.\n\n        use_global_views\n\n          When a request matches this route, and view lookup cannot\n          find a view which has a ``route_name`` predicate argument\n          that matches the route, try to fall back to using a view\n          that otherwise matches the context, request, and view name\n          (but which does not match the route_name predicate).\n\n        static\n\n          If ``static`` is ``True``, this route will never match an incoming\n          request; it will only be useful for URL generation.  By default,\n          ``static`` is ``False``.  See :ref:`static_route_narr`.\n\n          .. versionadded:: 1.1\n\n        Predicate Arguments\n\n        pattern\n\n          The pattern of the route e.g. ``ideas/{idea}``.  This\n          argument is required.  See :ref:`route_pattern_syntax`\n          for information about the syntax of route patterns.  If the\n          pattern doesn't match the current URL, route matching\n          continues.\n\n          .. note::\n\n             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a\n             ``path`` keyword argument passed to this function will be used to\n             represent the pattern value if the ``pattern`` argument is\n             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``\n             wins.\n\n        xhr\n\n          This value should be either ``True`` or ``False``.  If this\n          value is specified and is ``True``, the :term:`request` must\n          possess an ``HTTP_X_REQUESTED_WITH`` (aka\n          ``X-Requested-With``) header for this route to match.  This\n          is useful for detecting AJAX requests issued from jQuery,\n          Prototype and other Javascript libraries.  If this predicate\n          returns ``False``, route matching continues.\n\n        request_method\n\n          A string representing an HTTP method name, e.g. ``GET``, ``POST``,\n          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing\n          HTTP method names.  If this argument is not specified, this route\n          will match if the request has *any* request method.  If this\n          predicate returns ``False``, route matching continues.\n\n          .. versionchanged:: 1.2\n             The ability to pass a tuple of items as ``request_method``.\n             Previous versions allowed only a string.\n\n        path_info\n\n          This value represents a regular expression pattern that will\n          be tested against the ``PATH_INFO`` WSGI environment\n          variable.  If the regex matches, this predicate will return\n          ``True``.  If this predicate returns ``False``, route\n          matching continues.\n\n        request_param\n\n          This value can be any string.  A view declaration with this\n          argument ensures that the associated route will only match\n          when the request has a key in the ``request.params``\n          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a\n          name which matches the supplied value.  If the value\n          supplied as the argument has a ``=`` sign in it,\n          e.g. ``request_param=\"foo=123\"``, then the key\n          (``foo``) must both exist in the ``request.params`` dictionary, and\n          the value must match the right hand side of the expression (``123``)\n          for the route to \"match\" the current request.  If this predicate\n          returns ``False``, route matching continues.\n\n        header\n\n          This argument represents an HTTP header name or a header\n          name/value pair.  If the argument contains a ``:`` (colon),\n          it will be considered a name/value pair\n          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If\n          the value contains a colon, the value portion should be a\n          regular expression.  If the value does not contain a colon,\n          the entire value will be considered to be the header name\n          (e.g. ``If-Modified-Since``).  If the value evaluates to a\n          header name only without a value, the header specified by\n          the name must be present in the request for this predicate\n          to be true.  If the value evaluates to a header name/value\n          pair, the header specified by the name must be present in\n          the request *and* the regular expression specified as the\n          value must match the header value.  Whether or not the value\n          represents a header name or a header name/value pair, the\n          case of the header name is not significant.  If this\n          predicate returns ``False``, route matching continues.\n\n        accept\n\n          This value represents a match query for one or more\n          mimetypes in the ``Accept`` HTTP request header.  If this\n          value is specified, it must be in one of the following\n          forms: a mimetype match token in the form ``text/plain``, a\n          wildcard mimetype match token in the form ``text/*`` or a\n          match-all wildcard mimetype match token in the form ``*/*``.\n          If any of the forms matches the ``Accept`` header of the\n          request, or if the ``Accept`` header isn't set at all in the\n          request, this predicate will be true. If this predicate\n          returns ``False``, route matching continues.\n\n        effective_principals\n\n          If specified, this value should be a :term:`principal` identifier or\n          a sequence of principal identifiers.  If the\n          :attr:`pyramid.request.Request.effective_principals` property\n          indicates that every principal named in the argument list is present\n          in the current request, this predicate will return True; otherwise it\n          will return False.  For example:\n          ``effective_principals=pyramid.security.Authenticated`` or\n          ``effective_principals=('fred', 'group:admins')``.\n\n          .. versionadded:: 1.4a4\n\n        custom_predicates\n\n          .. deprecated:: 1.5\n              This value should be a sequence of references to custom\n              predicate callables.  Use custom predicates when no set of\n              predefined predicates does what you need.  Custom predicates\n              can be combined with predefined predicates as necessary.\n              Each custom predicate callable should accept two arguments:\n              ``info`` and ``request`` and should return either ``True``\n              or ``False`` after doing arbitrary evaluation of the info\n              and/or the request.  If all custom and non-custom predicate\n              callables return ``True`` the associated route will be\n              considered viable for a given request.  If any predicate\n              callable returns ``False``, route matching continues.  Note\n              that the value ``info`` passed to a custom route predicate\n              is a dictionary containing matching information; see\n              :ref:`custom_route_predicates` for more information about\n              ``info``.\n\n        predicates\n\n          Pass a key/value pair here to use a third-party predicate\n          registered via\n          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than\n          one key/value pair can be used at the same time.  See\n          :ref:`view_and_route_predicates` for more information about\n          third-party predicates.\n\n          .. versionadded:: 1.4\n\n        \"\"\"\n        if custom_predicates:\n            warnings.warn(\n                ('The \"custom_predicates\" argument to Configurator.add_route '\n                 'is deprecated as of Pyramid 1.5.  Use '\n                 '\"config.add_route_predicate\" and use the registered '\n                 'route predicate as a predicate argument to add_route '\n                 'instead. See \"Adding A Third Party View, Route, or '\n                 'Subscriber Predicate\" in the \"Hooks\" chapter of the '\n                 'documentation for more information.'),\n                DeprecationWarning,\n                stacklevel=3\n                )\n        # these are route predicates; if they do not match, the next route\n        # in the routelist will be tried\n        if request_method is not None:\n            request_method = as_sorted_tuple(request_method)\n\n        factory = self.maybe_dotted(factory)\n        if pattern is None:\n            pattern = path\n        if pattern is None:\n            raise ConfigurationError('\"pattern\" argument may not be None')\n\n        # check for an external route; an external route is one which is\n        # is a full url (e.g. 'http://example.com/{id}')\n        parsed = urlparse.urlparse(pattern)\n        if parsed.hostname:\n            pattern = parsed.path\n\n            original_pregenerator = pregenerator\n            def external_url_pregenerator(request, elements, kw):\n                if '_app_url' in kw:\n                    raise ValueError(\n                        'You cannot generate a path to an external route '\n                        'pattern via request.route_path nor pass an _app_url '\n                        'to request.route_url when generating a URL for an '\n                        'external route pattern (pattern was \"%s\") ' %\n                        (pattern,)\n                        )\n                if '_scheme' in kw:\n                    scheme = kw['_scheme']\n                elif parsed.scheme:\n                    scheme = parsed.scheme\n                else:\n                    scheme = request.scheme\n                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)\n\n                if original_pregenerator:\n                    elements, kw = original_pregenerator(\n                        request, elements, kw)\n                return elements, kw\n\n            pregenerator = external_url_pregenerator\n            static = True\n\n        elif self.route_prefix:\n            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')\n\n        mapper = self.get_routes_mapper()\n\n        introspectables = []\n\n        intr = self.introspectable('routes',\n                                   name,\n                                   '%s (pattern: %r)' % (name, pattern),\n                                   'route')\n        intr['name'] = name\n        intr['pattern'] = pattern\n        intr['factory'] = factory\n        intr['xhr'] = xhr\n        intr['request_methods'] = request_method\n        intr['path_info'] = path_info\n        intr['request_param'] = request_param\n        intr['header'] = header\n        intr['accept'] = accept\n        intr['traverse'] = traverse\n        intr['custom_predicates'] = custom_predicates\n        intr['pregenerator'] = pregenerator\n        intr['static'] = static\n        intr['use_global_views'] = use_global_views\n        introspectables.append(intr)\n\n        if factory:\n            factory_intr = self.introspectable('root factories',\n                                               name,\n                                               self.object_description(factory),\n                                               'root factory')\n            factory_intr['factory'] = factory\n            factory_intr['route_name'] = name\n            factory_intr.relate('routes', name)\n            introspectables.append(factory_intr)\n\n        def register_route_request_iface():\n            request_iface = self.registry.queryUtility(IRouteRequest, name=name)\n            if request_iface is None:\n                if use_global_views:\n                    bases = (IRequest,)\n                else:\n                    bases = ()\n                request_iface = route_request_iface(name, bases)\n                self.registry.registerUtility(\n                    request_iface, IRouteRequest, name=name)\n\n        def register_connect():\n            pvals = predicates.copy()\n            pvals.update(\n                dict(\n                    xhr=xhr,\n                    request_method=request_method,\n                    path_info=path_info,\n                    request_param=request_param,\n                    header=header,\n                    accept=accept,\n                    traverse=traverse,\n                    custom=predvalseq(custom_predicates),\n                    )\n                )\n\n            predlist = self.get_predlist('route')\n            _, preds, _ = predlist.make(self, **pvals)\n            route = mapper.connect(\n                name, pattern, factory, predicates=preds,\n                pregenerator=pregenerator, static=static\n                )\n            intr['object'] = route\n            return route\n\n        # We have to connect routes in the order they were provided;\n        # we can't use a phase to do that, because when the actions are\n        # sorted, actions in the same phase lose relative ordering\n        self.action(('route-connect', name), register_connect)\n\n        # But IRouteRequest interfaces must be registered before we begin to\n        # process view registrations (in phase 3)\n        self.action(('route', name), register_route_request_iface,\n                    order=PHASE2_CONFIG, introspectables=introspectables)\n\n    @action_method\n    def add_route_predicate(self, name, factory, weighs_more_than=None,\n                           weighs_less_than=None):\n        \"\"\" Adds a route predicate factory.  The view predicate can later be\n        named as a keyword argument to\n        :meth:`pyramid.config.Configurator.add_route`.\n\n        ``name`` should be the name of the predicate.  It must be a valid\n        Python identifier (it will be used as a keyword argument to\n        ``add_view``).\n\n        ``factory`` should be a :term:`predicate factory` or :term:`dotted\n        Python name` which refers to a predicate factory.\n\n        See :ref:`view_and_route_predicates` for more information.\n\n        .. versionadded:: 1.4\n        \"\"\"\n        self._add_predicate(\n            'route',\n            name,\n            factory,\n            weighs_more_than=weighs_more_than,\n            weighs_less_than=weighs_less_than\n            )\n\n    def add_default_route_predicates(self):\n        p = pyramid.config.predicates\n        for (name, factory) in (\n            ('xhr', p.XHRPredicate),\n            ('request_method', p.RequestMethodPredicate),\n            ('path_info', p.PathInfoPredicate),\n            ('request_param', p.RequestParamPredicate),\n            ('header', p.HeaderPredicate),\n            ('accept', p.AcceptPredicate),\n            ('effective_principals', p.EffectivePrincipalsPredicate),\n            ('custom', p.CustomPredicate),\n            ('traverse', p.TraversePredicate),\n            ):\n            self.add_route_predicate(name, factory)\n\n    def get_routes_mapper(self):\n        \"\"\" Return the :term:`routes mapper` object associated with\n        this configurator's :term:`registry`.\"\"\"\n        mapper = self.registry.queryUtility(IRoutesMapper)\n        if mapper is None:\n            mapper = RoutesMapper()\n            self.registry.registerUtility(mapper, IRoutesMapper)\n        return mapper",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 25,
                            "end_lineno": 415,
                            "parent": {
                                "file_name": "pyramid/config/routes.py",
                                "type": "class",
                                "name": "RoutesConfiguratorMixin",
                                "content": "class RoutesConfiguratorMixin(object):\n    @action_method\n    def add_route(self,\n                  name,\n                  pattern=None,\n                  permission=None,\n                  factory=None,\n                  for_=None,\n                  header=None,\n                  xhr=None,\n                  accept=None,\n                  path_info=None,\n                  request_method=None,\n                  request_param=None,\n                  traverse=None,\n                  custom_predicates=(),\n                  use_global_views=False,\n                  path=None,\n                  pregenerator=None,\n                  static=False,\n                  **predicates):\n        \"\"\" Add a :term:`route configuration` to the current\n        configuration state, as well as possibly a :term:`view\n        configuration` to be used to specify a :term:`view callable`\n        that will be invoked when this route matches.  The arguments\n        to this method are divided into *predicate*, *non-predicate*,\n        and *view-related* types.  :term:`Route predicate` arguments\n        narrow the circumstances in which a route will be match a\n        request; non-predicate arguments are informational.\n\n        Non-Predicate Arguments\n\n        name\n\n          The name of the route, e.g. ``myroute``.  This attribute is\n          required.  It must be unique among all defined routes in a given\n          application.\n\n        factory\n\n          A Python object (often a function or a class) or a :term:`dotted\n          Python name` which refers to the same object that will generate a\n          :app:`Pyramid` root resource object when this route matches. For\n          example, ``mypackage.resources.MyFactory``.  If this argument is\n          not specified, a default root factory will be used.  See\n          :ref:`the_resource_tree` for more information about root factories.\n\n        traverse\n\n          If you would like to cause the :term:`context` to be\n          something other than the :term:`root` object when this route\n          matches, you can spell a traversal pattern as the\n          ``traverse`` argument.  This traversal pattern will be used\n          as the traversal path: traversal will begin at the root\n          object implied by this route (either the global root, or the\n          object returned by the ``factory`` associated with this\n          route).\n\n          The syntax of the ``traverse`` argument is the same as it is\n          for ``pattern``. For example, if the ``pattern`` provided to\n          ``add_route`` is ``articles/{article}/edit``, and the\n          ``traverse`` argument provided to ``add_route`` is\n          ``/{article}``, when a request comes in that causes the route\n          to match in such a way that the ``article`` match value is\n          ``'1'`` (when the request URI is ``/articles/1/edit``), the\n          traversal path will be generated as ``/1``.  This means that\n          the root object's ``__getitem__`` will be called with the\n          name ``'1'`` during the traversal phase.  If the ``'1'`` object\n          exists, it will become the :term:`context` of the request.\n          :ref:`traversal_chapter` has more information about\n          traversal.\n\n          If the traversal path contains segment marker names which\n          are not present in the ``pattern`` argument, a runtime error\n          will occur.  The ``traverse`` pattern should not contain\n          segment markers that do not exist in the ``pattern``\n          argument.\n\n          A similar combining of routing and traversal is available\n          when a route is matched which contains a ``*traverse``\n          remainder marker in its pattern (see\n          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``\n          argument to add_route allows you to associate route patterns\n          with an arbitrary traversal path without using a\n          ``*traverse`` remainder marker; instead you can use other\n          match information.\n\n          Note that the ``traverse`` argument to ``add_route`` is\n          ignored when attached to a route that has a ``*traverse``\n          remainder marker in its pattern.\n\n        pregenerator\n\n           This option should be a callable object that implements the\n           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A\n           :term:`pregenerator` is a callable called by the\n           :meth:`pyramid.request.Request.route_url` function to augment or\n           replace the arguments it is passed when generating a URL for the\n           route.  This is a feature not often used directly by applications,\n           it is meant to be hooked by frameworks that use :app:`Pyramid` as\n           a base.\n\n        use_global_views\n\n          When a request matches this route, and view lookup cannot\n          find a view which has a ``route_name`` predicate argument\n          that matches the route, try to fall back to using a view\n          that otherwise matches the context, request, and view name\n          (but which does not match the route_name predicate).\n\n        static\n\n          If ``static`` is ``True``, this route will never match an incoming\n          request; it will only be useful for URL generation.  By default,\n          ``static`` is ``False``.  See :ref:`static_route_narr`.\n\n          .. versionadded:: 1.1\n\n        Predicate Arguments\n\n        pattern\n\n          The pattern of the route e.g. ``ideas/{idea}``.  This\n          argument is required.  See :ref:`route_pattern_syntax`\n          for information about the syntax of route patterns.  If the\n          pattern doesn't match the current URL, route matching\n          continues.\n\n          .. note::\n\n             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a\n             ``path`` keyword argument passed to this function will be used to\n             represent the pattern value if the ``pattern`` argument is\n             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``\n             wins.\n\n        xhr\n\n          This value should be either ``True`` or ``False``.  If this\n          value is specified and is ``True``, the :term:`request` must\n          possess an ``HTTP_X_REQUESTED_WITH`` (aka\n          ``X-Requested-With``) header for this route to match.  This\n          is useful for detecting AJAX requests issued from jQuery,\n          Prototype and other Javascript libraries.  If this predicate\n          returns ``False``, route matching continues.\n\n        request_method\n\n          A string representing an HTTP method name, e.g. ``GET``, ``POST``,\n          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing\n          HTTP method names.  If this argument is not specified, this route\n          will match if the request has *any* request method.  If this\n          predicate returns ``False``, route matching continues.\n\n          .. versionchanged:: 1.2\n             The ability to pass a tuple of items as ``request_method``.\n             Previous versions allowed only a string.\n\n        path_info\n\n          This value represents a regular expression pattern that will\n          be tested against the ``PATH_INFO`` WSGI environment\n          variable.  If the regex matches, this predicate will return\n          ``True``.  If this predicate returns ``False``, route\n          matching continues.\n\n        request_param\n\n          This value can be any string.  A view declaration with this\n          argument ensures that the associated route will only match\n          when the request has a key in the ``request.params``\n          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a\n          name which matches the supplied value.  If the value\n          supplied as the argument has a ``=`` sign in it,\n          e.g. ``request_param=\"foo=123\"``, then the key\n          (``foo``) must both exist in the ``request.params`` dictionary, and\n          the value must match the right hand side of the expression (``123``)\n          for the route to \"match\" the current request.  If this predicate\n          returns ``False``, route matching continues.\n\n        header\n\n          This argument represents an HTTP header name or a header\n          name/value pair.  If the argument contains a ``:`` (colon),\n          it will be considered a name/value pair\n          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If\n          the value contains a colon, the value portion should be a\n          regular expression.  If the value does not contain a colon,\n          the entire value will be considered to be the header name\n          (e.g. ``If-Modified-Since``).  If the value evaluates to a\n          header name only without a value, the header specified by\n          the name must be present in the request for this predicate\n          to be true.  If the value evaluates to a header name/value\n          pair, the header specified by the name must be present in\n          the request *and* the regular expression specified as the\n          value must match the header value.  Whether or not the value\n          represents a header name or a header name/value pair, the\n          case of the header name is not significant.  If this\n          predicate returns ``False``, route matching continues.\n\n        accept\n\n          This value represents a match query for one or more\n          mimetypes in the ``Accept`` HTTP request header.  If this\n          value is specified, it must be in one of the following\n          forms: a mimetype match token in the form ``text/plain``, a\n          wildcard mimetype match token in the form ``text/*`` or a\n          match-all wildcard mimetype match token in the form ``*/*``.\n          If any of the forms matches the ``Accept`` header of the\n          request, or if the ``Accept`` header isn't set at all in the\n          request, this predicate will be true. If this predicate\n          returns ``False``, route matching continues.\n\n        effective_principals\n\n          If specified, this value should be a :term:`principal` identifier or\n          a sequence of principal identifiers.  If the\n          :attr:`pyramid.request.Request.effective_principals` property\n          indicates that every principal named in the argument list is present\n          in the current request, this predicate will return True; otherwise it\n          will return False.  For example:\n          ``effective_principals=pyramid.security.Authenticated`` or\n          ``effective_principals=('fred', 'group:admins')``.\n\n          .. versionadded:: 1.4a4\n\n        custom_predicates\n\n          .. deprecated:: 1.5\n              This value should be a sequence of references to custom\n              predicate callables.  Use custom predicates when no set of\n              predefined predicates does what you need.  Custom predicates\n              can be combined with predefined predicates as necessary.\n              Each custom predicate callable should accept two arguments:\n              ``info`` and ``request`` and should return either ``True``\n              or ``False`` after doing arbitrary evaluation of the info\n              and/or the request.  If all custom and non-custom predicate\n              callables return ``True`` the associated route will be\n              considered viable for a given request.  If any predicate\n              callable returns ``False``, route matching continues.  Note\n              that the value ``info`` passed to a custom route predicate\n              is a dictionary containing matching information; see\n              :ref:`custom_route_predicates` for more information about\n              ``info``.\n\n        predicates\n\n          Pass a key/value pair here to use a third-party predicate\n          registered via\n          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than\n          one key/value pair can be used at the same time.  See\n          :ref:`view_and_route_predicates` for more information about\n          third-party predicates.\n\n          .. versionadded:: 1.4\n\n        \"\"\"\n        if custom_predicates:\n            warnings.warn(\n                ('The \"custom_predicates\" argument to Configurator.add_route '\n                 'is deprecated as of Pyramid 1.5.  Use '\n                 '\"config.add_route_predicate\" and use the registered '\n                 'route predicate as a predicate argument to add_route '\n                 'instead. See \"Adding A Third Party View, Route, or '\n                 'Subscriber Predicate\" in the \"Hooks\" chapter of the '\n                 'documentation for more information.'),\n                DeprecationWarning,\n                stacklevel=3\n                )\n        # these are route predicates; if they do not match, the next route\n        # in the routelist will be tried\n        if request_method is not None:\n            request_method = as_sorted_tuple(request_method)\n\n        factory = self.maybe_dotted(factory)\n        if pattern is None:\n            pattern = path\n        if pattern is None:\n            raise ConfigurationError('\"pattern\" argument may not be None')\n\n        # check for an external route; an external route is one which is\n        # is a full url (e.g. 'http://example.com/{id}')\n        parsed = urlparse.urlparse(pattern)\n        if parsed.hostname:\n            pattern = parsed.path\n\n            original_pregenerator = pregenerator\n            def external_url_pregenerator(request, elements, kw):\n                if '_app_url' in kw:\n                    raise ValueError(\n                        'You cannot generate a path to an external route '\n                        'pattern via request.route_path nor pass an _app_url '\n                        'to request.route_url when generating a URL for an '\n                        'external route pattern (pattern was \"%s\") ' %\n                        (pattern,)\n                        )\n                if '_scheme' in kw:\n                    scheme = kw['_scheme']\n                elif parsed.scheme:\n                    scheme = parsed.scheme\n                else:\n                    scheme = request.scheme\n                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)\n\n                if original_pregenerator:\n                    elements, kw = original_pregenerator(\n                        request, elements, kw)\n                return elements, kw\n\n            pregenerator = external_url_pregenerator\n            static = True\n\n        elif self.route_prefix:\n            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')\n\n        mapper = self.get_routes_mapper()\n\n        introspectables = []\n\n        intr = self.introspectable('routes',\n                                   name,\n                                   '%s (pattern: %r)' % (name, pattern),\n                                   'route')\n        intr['name'] = name\n        intr['pattern'] = pattern\n        intr['factory'] = factory\n        intr['xhr'] = xhr\n        intr['request_methods'] = request_method\n        intr['path_info'] = path_info\n        intr['request_param'] = request_param\n        intr['header'] = header\n        intr['accept'] = accept\n        intr['traverse'] = traverse\n        intr['custom_predicates'] = custom_predicates\n        intr['pregenerator'] = pregenerator\n        intr['static'] = static\n        intr['use_global_views'] = use_global_views\n        introspectables.append(intr)\n\n        if factory:\n            factory_intr = self.introspectable('root factories',\n                                               name,\n                                               self.object_description(factory),\n                                               'root factory')\n            factory_intr['factory'] = factory\n            factory_intr['route_name'] = name\n            factory_intr.relate('routes', name)\n            introspectables.append(factory_intr)\n\n        def register_route_request_iface():\n            request_iface = self.registry.queryUtility(IRouteRequest, name=name)\n            if request_iface is None:\n                if use_global_views:\n                    bases = (IRequest,)\n                else:\n                    bases = ()\n                request_iface = route_request_iface(name, bases)\n                self.registry.registerUtility(\n                    request_iface, IRouteRequest, name=name)\n\n        def register_connect():\n            pvals = predicates.copy()\n            pvals.update(\n                dict(\n                    xhr=xhr,\n                    request_method=request_method,\n                    path_info=path_info,\n                    request_param=request_param,\n                    header=header,\n                    accept=accept,\n                    traverse=traverse,\n                    custom=predvalseq(custom_predicates),\n                    )\n                )\n\n            predlist = self.get_predlist('route')\n            _, preds, _ = predlist.make(self, **pvals)\n            route = mapper.connect(\n                name, pattern, factory, predicates=preds,\n                pregenerator=pregenerator, static=static\n                )\n            intr['object'] = route\n            return route\n\n        # We have to connect routes in the order they were provided;\n        # we can't use a phase to do that, because when the actions are\n        # sorted, actions in the same phase lose relative ordering\n        self.action(('route-connect', name), register_connect)\n\n        # But IRouteRequest interfaces must be registered before we begin to\n        # process view registrations (in phase 3)\n        self.action(('route', name), register_route_request_iface,\n                    order=PHASE2_CONFIG, introspectables=introspectables)\n\n    @action_method\n    def add_route_predicate(self, name, factory, weighs_more_than=None,\n                           weighs_less_than=None):\n        \"\"\" Adds a route predicate factory.  The view predicate can later be\n        named as a keyword argument to\n        :meth:`pyramid.config.Configurator.add_route`.\n\n        ``name`` should be the name of the predicate.  It must be a valid\n        Python identifier (it will be used as a keyword argument to\n        ``add_view``).\n\n        ``factory`` should be a :term:`predicate factory` or :term:`dotted\n        Python name` which refers to a predicate factory.\n\n        See :ref:`view_and_route_predicates` for more information.\n\n        .. versionadded:: 1.4\n        \"\"\"\n        self._add_predicate(\n            'route',\n            name,\n            factory,\n            weighs_more_than=weighs_more_than,\n            weighs_less_than=weighs_less_than\n            )\n\n    def add_default_route_predicates(self):\n        p = pyramid.config.predicates\n        for (name, factory) in (\n            ('xhr', p.XHRPredicate),\n            ('request_method', p.RequestMethodPredicate),\n            ('path_info', p.PathInfoPredicate),\n            ('request_param', p.RequestParamPredicate),\n            ('header', p.HeaderPredicate),\n            ('accept', p.AcceptPredicate),\n            ('effective_principals', p.EffectivePrincipalsPredicate),\n            ('custom', p.CustomPredicate),\n            ('traverse', p.TraversePredicate),\n            ):\n            self.add_route_predicate(name, factory)\n\n    def get_routes_mapper(self):\n        \"\"\" Return the :term:`routes mapper` object associated with\n        this configurator's :term:`registry`.\"\"\"\n        mapper = self.registry.queryUtility(IRoutesMapper)\n        if mapper is None:\n            mapper = RoutesMapper()\n            self.registry.registerUtility(mapper, IRoutesMapper)\n        return mapper",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 23,
                                "end_lineno": 465,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\n\nfrom pyramid.tests.test_config import dummyfactory\nfrom pyramid.tests.test_config import DummyContext\nfrom pyramid.compat import text_\n\nclass RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\nclass DummyRequest:\n    subpath = ()\n    matchdict = None\n    def __init__(self, environ=None):\n        if environ is None:\n            environ = {}\n        self.environ = environ\n        self.params = {}\n        self.cookies = {}\n",
            "new_file_content": "import unittest\n\nfrom pyramid.tests.test_config import dummyfactory\nfrom pyramid.tests.test_config import DummyContext\nfrom pyramid.compat import text_\n\nclass RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\nclass DummyRequest:\n    subpath = ()\n    matchdict = None\n    def __init__(self, environ=None):\n        if environ is None:\n            environ = {}\n        self.environ = environ\n        self.params = {}\n        self.cookies = {}\n",
            "header": {
                "file": {
                    "path": "pyramid/tests/test_config/test_routes.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "1d2530c02",
                "new_commit_hash": "778d33938",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/pyramid/tests/test_config/test_routes.py"
            },
            "plus_file": {
                "path": "b/pyramid/tests/test_config/test_routes.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 50,
                            "length": 6
                        },
                        "new_range": {
                            "start": 50,
                            "length": 18
                        },
                        "section": "class RoutesConfiguratorMixinTests(unittest.TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "        config.add_route('name', 'path')",
                                "type": "context"
                            },
                            {
                                "content": "        self._assertRoute(config, 'name', 'root/path')",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_add_route_with_empty_string_with_route_prefix(self):",
                                "type": "added"
                            },
                            {
                                "content": "        config = self._makeOne(autocommit=True)",
                                "type": "added"
                            },
                            {
                                "content": "        config.route_prefix = 'root'",
                                "type": "added"
                            },
                            {
                                "content": "        config.add_route('name', '')",
                                "type": "added"
                            },
                            {
                                "content": "        self._assertRoute(config, 'name', 'root')",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_add_route_with_root_slash_with_route_prefix(self):",
                                "type": "added"
                            },
                            {
                                "content": "        config = self._makeOne(autocommit=True)",
                                "type": "added"
                            },
                            {
                                "content": "        config.route_prefix = 'root'",
                                "type": "added"
                            },
                            {
                                "content": "        config.add_route('name', '/')",
                                "type": "added"
                            },
                            {
                                "content": "        self._assertRoute(config, 'name', 'root/')",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "    def test_add_route_discriminator(self):",
                                "type": "context"
                            },
                            {
                                "content": "        config = self._makeOne()",
                                "type": "context"
                            },
                            {
                                "content": "        config.add_route('name', 'path')",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "pyramid/tests/test_config/test_routes.py",
                            "type": "class",
                            "name": "RoutesConfiguratorMixinTests",
                            "content": "class RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 7,
                            "end_lineno": 257,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "pyramid/tests/test_config/test_routes.py",
                            "type": "method",
                            "name": "RoutesConfiguratorMixinTests.test_add_route_with_empty_string_with_route_prefix",
                            "content": "class RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 53,
                            "end_lineno": 57,
                            "parent": {
                                "file_name": "pyramid/tests/test_config/test_routes.py",
                                "type": "class",
                                "name": "RoutesConfiguratorMixinTests",
                                "content": "class RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 7,
                                "end_lineno": 257,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "pyramid/tests/test_config/test_routes.py",
                            "type": "method",
                            "name": "RoutesConfiguratorMixinTests.test_add_route_with_root_slash_with_route_prefix",
                            "content": "class RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 59,
                            "end_lineno": 63,
                            "parent": {
                                "file_name": "pyramid/tests/test_config/test_routes.py",
                                "type": "class",
                                "name": "RoutesConfiguratorMixinTests",
                                "content": "class RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 7,
                                "end_lineno": 257,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "855fe374108779e82530da74f1c0fd21ab9033b3^",
    "new_commit_hash": "855fe374108779e82530da74f1c0fd21ab9033b3",
    "commit_message": "Added support for a prefixed base url to not contain a trailing slash",
    "commit_date": "2015-04-17T07:12:11-04:00",
    "metadata": {}
}
{
    "repo_name": "pyramid",
    "new_commit_hash": "855fe374108779e82530da74f1c0fd21ab9033b3",
    "test_file_codes": [
        "import unittest\n\nfrom pyramid.tests.test_config import dummyfactory\nfrom pyramid.tests.test_config import DummyContext\nfrom pyramid.compat import text_\n\nclass RoutesConfiguratorMixinTests(unittest.TestCase):\n    def _makeOne(self, *arg, **kw):\n        from pyramid.config import Configurator\n        config = Configurator(*arg, **kw)\n        return config\n\n    def _assertRoute(self, config, name, path, num_predicates=0):\n        from pyramid.interfaces import IRoutesMapper\n        mapper = config.registry.getUtility(IRoutesMapper)\n        routes = mapper.get_routes()\n        route = routes[0]\n        self.assertEqual(len(routes), 1)\n        self.assertEqual(route.name, name)\n        self.assertEqual(route.path, path)\n        self.assertEqual(len(routes[0].predicates), num_predicates)\n        return route\n\n    def _makeRequest(self, config):\n        request = DummyRequest()\n        request.registry = config.registry\n        return request\n\n    def test_get_routes_mapper_not_yet_registered(self):\n        config = self._makeOne()\n        mapper = config.get_routes_mapper()\n        self.assertEqual(mapper.routelist, [])\n\n    def test_get_routes_mapper_already_registered(self):\n        from pyramid.interfaces import IRoutesMapper\n        config = self._makeOne()\n        mapper = object()\n        config.registry.registerUtility(mapper, IRoutesMapper)\n        result = config.get_routes_mapper()\n        self.assertEqual(result, mapper)\n\n    def test_add_route_defaults(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', 'path')\n        self._assertRoute(config, 'name', 'root/path')\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n        self._assertRoute(config, 'name', 'root')\n\n    def test_add_route_with_root_slash_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '/')\n        self._assertRoute(config, 'name', 'root/')\n\n    def test_add_route_discriminator(self):\n        config = self._makeOne()\n        config.add_route('name', 'path')\n        self.assertEqual(config.action_state.actions[-1]['discriminator'],\n                         ('route', 'name'))\n\n    def test_add_route_with_factory(self):\n        config = self._makeOne(autocommit=True)\n        factory = object()\n        config.add_route('name', 'path', factory=factory)\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, factory)\n\n    def test_add_route_with_static(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path/{foo}', static=True)\n        mapper = config.get_routes_mapper()\n        self.assertEqual(len(mapper.get_routes()), 0)\n        self.assertEqual(mapper.generate('name', {\"foo\":\"a\"}), '/path/a')\n\n    def test_add_route_with_factory_dottedname(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route(\n            'name', 'path',\n            factory='pyramid.tests.test_config.dummyfactory')\n        route = self._assertRoute(config, 'name', 'path')\n        self.assertEqual(route.factory, dummyfactory)\n\n    def test_add_route_with_xhr(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', xhr=True)\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.is_xhr = True\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.is_xhr = False\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_method(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_method='GET')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.method = 'GET'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.method = 'POST'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', path_info='/foo')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = '/foo'\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = '/'\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_highorder(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(b'/La Pe\\xc3\\xb1a', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_path_info_regex(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path',\n                         path_info=text_(br'/La Pe\\w*', 'utf-8'))\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.upath_info = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.upath_info = text_('/')\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_request_param(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', request_param='abc')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.params = {'abc':'123'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.params = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_custom_predicates(self):\n        import warnings\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request): pass\n        def pred2(context, request): pass\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_route('name', 'path', custom_predicates=(pred1, pred2))\n            self.assertEqual(len(w), 1)\n        route = self._assertRoute(config, 'name', 'path', 2)\n        self.assertEqual(len(route.predicates), 2)\n\n    def test_add_route_with_header(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', header='Host')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.headers = {'Host':'example.com'}\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.headers = {}\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_with_accept(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'path', accept='text/xml')\n        route = self._assertRoute(config, 'name', 'path', 1)\n        predicate = route.predicates[0]\n        request = self._makeRequest(config)\n        request.accept = ['text/xml']\n        self.assertEqual(predicate(None, request), True)\n        request = self._makeRequest(config)\n        request.accept = ['text/html']\n        self.assertEqual(predicate(None, request), False)\n\n    def test_add_route_no_pattern_with_path(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', path='path')\n        self._assertRoute(config, 'name', 'path')\n\n    def test_add_route_no_path_no_pattern(self):\n        from pyramid.exceptions import ConfigurationError\n        config = self._makeOne()\n        self.assertRaises(ConfigurationError, config.add_route, 'name')\n\n    def test_add_route_with_pregenerator(self):\n        config = self._makeOne(autocommit=True)\n        config.add_route('name', 'pattern', pregenerator='123')\n        route = self._assertRoute(config, 'name', 'pattern')\n        self.assertEqual(route.pregenerator, '123')\n\n    def test_add_route_no_view_with_view_attr(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_attr='abc')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_context(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_context=DummyContext)\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_permission(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_permission='edit')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\n    def test_add_route_no_view_with_view_renderer(self):\n        config = self._makeOne(autocommit=True)\n        from pyramid.exceptions import ConfigurationError\n        try:\n            config.add_route('name', '/pattern', view_renderer='json')\n        except ConfigurationError:\n            pass\n        else: # pragma: no cover\n            raise AssertionError\n\nclass DummyRequest:\n    subpath = ()\n    matchdict = None\n    def __init__(self, environ=None):\n        if environ is None:\n            environ = {}\n        self.environ = environ\n        self.params = {}\n        self.cookies = {}\n"
    ],
    "test_file_names": [
        "test_1.py"
    ],
    "setup_res_code": 0,
    "setup_res_stdout": "",
    "setup_res_stderr": "Using CPython 3.8.20\nCreating virtual environment at: .venv\nActivate with: source .venv/bin/activate\nResolved 9 packages in 594ms\nPrepared 1 package in 702ms\nInstalled 9 packages in 16ms\n + pastedeploy==3.1.0\n + pyramid==1.6.dev0 (from file:///home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3)\n + repoze-lru==0.7\n + setuptools==75.3.0\n + translationstring==1.4\n + venusian==3.1.1\n + webob==1.8.9\n + zope-deprecation==5.0\n + zope-interface==7.2\nResolved 19 packages in 17ms\nInstalled 10 packages in 11ms\n + beautifulsoup4==4.12.3\n + coverage==7.6.1\n + distlib==0.3.9\n + filelock==3.16.1\n + nose==1.3.7\n + platformdirs==4.3.6\n + soupsieve==2.6\n + virtualenv==20.29.0\n + waitress==3.0.0\n + webtest==3.0.1\nResolved 16 packages in 7ms\nInstalled 12 packages in 43ms\n + cachetools==5.5.0\n + chardet==5.2.0\n + colorama==0.4.6\n + exceptiongroup==1.2.2\n + iniconfig==2.0.0\n + packaging==24.2\n + pluggy==1.5.0\n + pyproject-api==1.8.0\n + pytest==8.3.4\n + tomli==2.2.1\n + tox==4.23.2\n + typing-extensions==4.12.2\n",
    "new_commit_res_code": 1,
    "new_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3\ncollected 883 items\n\nr2e_tests/test_1.py ..........................                           [  2%]\nr2e_tests/test_config/test_adapters.py .FF..............F...             [  5%]\nr2e_tests/test_config/test_assets.py ...........FF...................... [  9%]\n.....F..........................                                         [ 12%]\nr2e_tests/test_config/test_factories.py ..................               [ 14%]\nr2e_tests/test_config/test_i18n.py FFF.FF...                             [ 15%]\nr2e_tests/test_config/test_init.py ..................................... [ 20%]\n.F..F....................F...........F....................FF...FFF...... [ 28%]\n..............                                                           [ 29%]\nr2e_tests/test_config/test_predicates.py ............................... [ 33%]\n........................................                                 [ 37%]\nr2e_tests/test_config/test_rendering.py ...                              [ 38%]\nr2e_tests/test_config/test_routes.py ..........................          [ 41%]\nr2e_tests/test_config/test_security.py ..........                        [ 42%]\nr2e_tests/test_config/test_settings.py .......................           [ 44%]\nr2e_tests/test_config/test_testing.py ............                       [ 46%]\nr2e_tests/test_config/test_tweens.py .................................   [ 50%]\nr2e_tests/test_config/test_util.py ..................................... [ 54%]\n.............                                                            [ 55%]\nr2e_tests/test_config/test_views.py .....................F............F. [ 59%]\n..................................FF.................................... [ 67%]\n..FF.................................................................... [ 76%]\n.....FF.........F...F....F.............................................. [ 84%]\n..............F                                                          [ 85%]\nr2e_tests/test_scripts/test_common.py ...                                [ 86%]\nr2e_tests/test_scripts/test_pcreate.py ...............                   [ 87%]\nr2e_tests/test_scripts/test_pdistreport.py ..                            [ 88%]\nr2e_tests/test_scripts/test_prequest.py F.FFFFFFFFF.F.FFF.               [ 90%]\nr2e_tests/test_scripts/test_proutes.py ...........                       [ 91%]\nr2e_tests/test_scripts/test_pserve.py ............................       [ 94%]\nr2e_tests/test_scripts/test_pshell.py ...................                [ 96%]\nr2e_tests/test_scripts/test_ptweens.py .....                             [ 97%]\nr2e_tests/test_scripts/test_pviews.py ................F......            [100%]\n\n=================================== FAILURES ===================================\n__ AdaptersConfiguratorMixinTests.test_add_resource_url_adapter_dotted_names ___\n\nself = <r2e_tests.test_config.test_adapters.AdaptersConfiguratorMixinTests testMethod=test_add_resource_url_adapter_dotted_names>\n\n    def test_add_resource_url_adapter_dotted_names(self):\n        from pyramid.interfaces import IResourceURL\n        config = self._makeOne(autocommit=True)\n        config.add_resource_url_adapter(\n            'pyramid.tests.test_config.test_adapters.DummyResourceURL',\n            'pyramid.tests.test_config.test_adapters.DummyIface',\n            )\n        iface = DummyIface()\n>       adapter = config.registry.getMultiAdapter((iface, iface),\n                                                    IResourceURL)\n\nr2e_tests/test_config/test_adapters.py:280: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Registry r2e_tests.test_config>\nobjects = (<r2e_tests.test_config.test_adapters.DummyIface object at 0x75b123afd6d0>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x75b123afd6d0>)\ninterface = <InterfaceClass pyramid.interfaces.IResourceURL>, name = ''\n\n    def getMultiAdapter(self, objects, interface, name=''):\n        adapter = self.adapters.queryMultiAdapter(objects, interface, name)\n        if adapter is None:\n>           raise ComponentLookupError(objects, interface, name)\nE           zope.interface.interfaces.ComponentLookupError: ((<r2e_tests.test_config.test_adapters.DummyIface object at 0x75b123afd6d0>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x75b123afd6d0>), <InterfaceClass pyramid.interfaces.IResourceURL>, '')\n\n.venv/lib/python3.8/site-packages/zope/interface/registry.py:379: ComponentLookupError\n_ AdaptersConfiguratorMixinTests.test_add_resource_url_adapter_introspectables _\n\nself = <r2e_tests.test_config.test_adapters.AdaptersConfiguratorMixinTests testMethod=test_add_resource_url_adapter_introspectables>\n\n    def test_add_resource_url_adapter_introspectables(self):\n        config = self._makeOne()\n        config.add_resource_url_adapter(DummyResourceURL, DummyIface)\n        actions = config.action_state.actions\n        self.assertEqual(len(actions), 1)\n        intrs  = actions[0]['introspectables']\n        self.assertEqual(len(intrs), 1)\n        intr = intrs[0]\n        self.assertEqual(intr.type_name, 'resource url adapter')\n        self.assertEqual(intr.discriminator,\n                         ('resource url adapter', DummyIface))\n        self.assertEqual(intr.category_name, 'resource url adapters')\n>       self.assertEqual(\n            intr.title,\n            \"resource url adapter for resource iface \"\n            \"<class 'pyramid.tests.test_config.test_adapters.DummyIface'>\"\n            )\nE       AssertionError: \"reso[34 chars]e <class 'r2e_tests.test_config.test_adapters.DummyIface'>\" != \"reso[34 chars]e <class 'pyramid.tests.test_config.test_adapters.DummyIface'>\"\nE       - resource url adapter for resource iface <class 'r2e_tests.test_config.test_adapters.DummyIface'>\nE       ?                                                  ^^^\nE       + resource url adapter for resource iface <class 'pyramid.tests.test_config.test_adapters.DummyIface'>\nE       ?                                                 ++ ^^^^^\n\nr2e_tests/test_config/test_adapters.py:326: AssertionError\n________ AdaptersConfiguratorMixinTests.test_add_traverser_dotted_names ________\n\nself = <r2e_tests.test_config.test_adapters.AdaptersConfiguratorMixinTests testMethod=test_add_traverser_dotted_names>\n\n    def test_add_traverser_dotted_names(self):\n        from pyramid.interfaces import ITraverser\n        config = self._makeOne(autocommit=True)\n        config.add_traverser(\n            'pyramid.tests.test_config.test_adapters.DummyTraverser',\n            'pyramid.tests.test_config.test_adapters.DummyIface')\n        iface = DummyIface()\n>       traverser = config.registry.getAdapter(iface, ITraverser)\n\nr2e_tests/test_config/test_adapters.py:237: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Registry r2e_tests.test_config>\nobject = <r2e_tests.test_config.test_adapters.DummyIface object at 0x75b123afd340>\ninterface = <InterfaceClass pyramid.interfaces.ITraverser>, name = ''\n\n    def getAdapter(self, object, interface, name=''):\n        adapter = self.adapters.queryAdapter(object, interface, name)\n        if adapter is None:\n>           raise ComponentLookupError(object, interface, name)\nE           zope.interface.interfaces.ComponentLookupError: (<r2e_tests.test_config.test_adapters.DummyIface object at 0x75b123afd340>, <InterfaceClass pyramid.interfaces.ITraverser>, '')\n\n.venv/lib/python3.8/site-packages/zope/interface/registry.py:368: ComponentLookupError\n_________ TestOverrideProvider.test_get_resource_filename_no_overrides _________\n\nself = <r2e_tests.test_config.test_assets.TestOverrideProvider testMethod=test_get_resource_filename_no_overrides>\n\n    def test_get_resource_filename_no_overrides(self):\n        import os\n        resource_name = 'test_assets.py'\n        import pyramid.tests.test_config\n        provider = self._makeOne(pyramid.tests.test_config)\n        here = os.path.dirname(os.path.abspath(__file__))\n        expected = os.path.join(here, resource_name)\n        result = provider.get_resource_filename(None, resource_name)\n>       self.assertEqual(result, expected)\nE       AssertionError: '/hom[73 chars]0da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]0da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py\nE       ?                                                                                                     ^^^\n\nr2e_tests/test_config/test_assets.py:158: AssertionError\n____ TestOverrideProvider.test_get_resource_filename_override_returns_None _____\n\nself = <r2e_tests.test_config.test_assets.TestOverrideProvider testMethod=test_get_resource_filename_override_returns_None>\n\n    def test_get_resource_filename_override_returns_None(self):\n        overrides = DummyOverrides(None)\n        self._registerOverrides(overrides)\n        import os\n        resource_name = 'test_assets.py'\n        import pyramid.tests.test_config\n        provider = self._makeOne(pyramid.tests.test_config)\n        here = os.path.dirname(os.path.abspath(__file__))\n        expected = os.path.join(here, resource_name)\n        result = provider.get_resource_filename(None, resource_name)\n>       self.assertEqual(result, expected)\nE       AssertionError: '/hom[73 chars]0da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]0da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py\nE       ?                                                                                                     ^^^\n\nr2e_tests/test_config/test_assets.py:212: AssertionError\n____________________ TestPackageOverrides.test_get_filename ____________________\n\nself = <r2e_tests.test_config.test_assets.TestPackageOverrides testMethod=test_get_filename>\n\n    def test_get_filename(self):\n        import os\n        overrides = [ DummyOverride(None), DummyOverride(\n            ('pyramid.tests.test_config', 'test_assets.py'))]\n        package = DummyPackage('package')\n        po = self._makeOne(package)\n        po.overrides= overrides\n        here = os.path.dirname(os.path.abspath(__file__))\n        expected = os.path.join(here, 'test_assets.py')\n>       self.assertEqual(po.get_filename('whatever'), expected)\nE       AssertionError: '/hom[73 chars]0da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]0da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py\nE       ?                                                                                                     ^^^\n\nr2e_tests/test_config/test_assets.py:425: AssertionError\n_________ TestI18NConfiguratorMixin.test_add_translation_dirs_abspath __________\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_abspath>\n\n    def test_add_translation_dirs_abspath(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n>       config.add_translation_dirs(locale)\n\nr2e_tests/test_config/test_i18n.py:86: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/util.py:528: in wrapper\n    result = wrapped(self, *arg, **kw)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <pyramid.config.Configurator object at 0x75b1242cb9a0>\nspecs = ('/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale',)\nintrospectables = []\nspec = '/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\npackage_name = None\n\n    @action_method\n    def add_translation_dirs(self, *specs):\n        \"\"\" Add one or more :term:`translation directory` paths to the\n        current configuration state.  The ``specs`` argument is a\n        sequence that may contain absolute directory paths\n        (e.g. ``/usr/share/locale``) or :term:`asset specification`\n        names naming a directory path (e.g. ``some.package:locale``)\n        or a combination of the two.\n    \n        Example:\n    \n        .. code-block:: python\n    \n           config.add_translation_dirs('/usr/share/locale',\n                                       'some.package:locale')\n    \n        Later calls to ``add_translation_dir`` insert directories into the\n        beginning of the list of translation directories created by earlier\n        calls.  This means that the same translation found in a directory\n        added later in the configuration process will be found before one\n        added earlier in the configuration process.  However, if multiple\n        specs are provided in a single call to ``add_translation_dirs``, the\n        directories will be inserted into the beginning of the directory list\n        in the order they're provided in the ``*specs`` list argument (items\n        earlier in the list trump ones later in the list).\n        \"\"\"\n        directories = []\n        introspectables = []\n    \n        for spec in specs[::-1]: # reversed\n            package_name, filename = self._split_spec(spec)\n            if package_name is None: # absolute filename\n                directory = filename\n            else:\n                __import__(package_name)\n                package = sys.modules[package_name]\n                directory = os.path.join(package_path(package), filename)\n    \n            if not os.path.isdir(os.path.realpath(directory)):\n>               raise ConfigurationError('\"%s\" is not a directory' %\n                                         directory)\nE               pyramid.exceptions.ConfigurationError: \"/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale\" is not a directory\n\npyramid/config/i18n.py:86: ConfigurationError\n________ TestI18NConfiguratorMixin.test_add_translation_dirs_asset_spec ________\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_asset_spec>\n\n    def test_add_translation_dirs_asset_spec(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')\n>       self.assertEqual(config.registry.getUtility(ITranslationDirectories),\n                         [locale])\nE       AssertionError: Lists differ: ['/ho[70 chars]82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'] != ['/ho[70 chars]82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale']\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale']\nE       ?                                                                                                       ^^^\n\nr2e_tests/test_config/test_i18n.py:54: AssertionError\n_ TestI18NConfiguratorMixin.test_add_translation_dirs_asset_spec_existing_translation_dirs _\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_asset_spec_existing_translation_dirs>\n\n    def test_add_translation_dirs_asset_spec_existing_translation_dirs(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        directories = ['abc']\n        config.registry.registerUtility(directories, ITranslationDirectories)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')\n        result = config.registry.getUtility(ITranslationDirectories)\n>       self.assertEqual(result, [locale, 'abc'])\nE       AssertionError: Lists differ: ['/ho[77 chars]74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale', 'abc'] != ['/ho[77 chars]74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale', 'abc']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale',\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale',\nE       ?                                                                                                       ^^^\nE       \nE          'abc']\n\nr2e_tests/test_config/test_i18n.py:64: AssertionError\n______ TestI18NConfiguratorMixin.test_add_translation_dirs_multiple_specs ______\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_multiple_specs>\n\n    def test_add_translation_dirs_multiple_specs(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',\n                                    'pyramid.tests.pkgs.localeapp:locale2')\n>       self.assertEqual(config.registry.getUtility(ITranslationDirectories),\n                         [locale, locale2])\nE       AssertionError: Lists differ: ['/ho[91 chars]33b3/pyramid/tests/pkgs/localeapp/locale', '/h[130 chars]le2'] != ['/ho[91 chars]33b3/r2e_tests/pkgs/localeapp/locale', '/home/[122 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\nE       \nE       Diff is 1002 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_i18n.py:71: AssertionError\n_ TestI18NConfiguratorMixin.test_add_translation_dirs_multiple_specs_multiple_calls _\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_multiple_specs_multiple_calls>\n\n    def test_add_translation_dirs_multiple_specs_multiple_calls(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',\n                                    'pyramid.tests.pkgs.localeapp:locale2')\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale3')\n>       self.assertEqual(config.registry.getUtility(ITranslationDirectories),\n                         [locale3, locale, locale2])\nE       AssertionError: Lists differ: ['/ho[91 chars]33b3/pyramid/tests/pkgs/localeapp/locale3', '/[269 chars]le2'] != ['/ho[91 chars]33b3/r2e_tests/pkgs/localeapp/locale3', '/home[257 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[69 chars]82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale3'\nE       '/hom[69 chars]82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale3'\nE       \nE       Diff is 1504 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_i18n.py:80: AssertionError\n___________________ ConfiguratorTests.test_ctor_no_registry ____________________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_ctor_no_registry>\n\n    def test_ctor_no_registry(self):\n        import sys\n        from pyramid.interfaces import ISettings\n        from pyramid.config import Configurator\n        from pyramid.interfaces import IRendererFactory\n        config = Configurator()\n        this_pkg = sys.modules['pyramid.tests.test_config']\n        self.assertTrue(config.registry.getUtility(ISettings))\n>       self.assertEqual(config.package, this_pkg)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:67: AssertionError\n_________ ConfiguratorTests.test_ctor_noreg_debug_logger_None_default __________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_ctor_noreg_debug_logger_None_default>\n\n    def test_ctor_noreg_debug_logger_None_default(self):\n        from pyramid.interfaces import IDebugLogger\n        config = self._makeOne()\n        logger = config.registry.getUtility(IDebugLogger)\n>       self.assertEqual(logger.name, 'pyramid.tests.test_config')\nE       AssertionError: 'r2e_tests.test_config' != 'pyramid.tests.test_config'\nE       - r2e_tests.test_config\nE       ?  ^^^\nE       + pyramid.tests.test_config\nE       ? ++ ^^^^^\n\nr2e_tests/test_config/test_init.py:123: AssertionError\n_______________ ConfiguratorTests.test_scan_integration_conflict _______________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_scan_integration_conflict>\n\n    def test_scan_integration_conflict(self):\n        from pyramid.tests.test_config.pkgs import selfscan\n        from pyramid.config import Configurator\n        c = Configurator()\n        c.scan(selfscan)\n        c.scan(selfscan)\n        try:\n>           c.commit()\n\nr2e_tests/test_config/test_init.py:999: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:610: in commit\n    self.action_state.execute_actions(introspector=self.introspector)\npyramid/config/__init__.py:1048: in execute_actions\n    for action in resolveConflicts(self.actions):\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nactions = []\n\n    def resolveConflicts(actions):\n        \"\"\"Resolve conflicting actions\n    \n        Given an actions list, identify and try to resolve conflicting actions.\n        Actions conflict if they have the same non-None discriminator.\n        Conflicting actions can be resolved if the include path of one of\n        the actions is a prefix of the includepaths of the other\n        conflicting actions and is unequal to the include paths in the\n        other conflicting actions.\n        \"\"\"\n    \n        def orderandpos(v):\n            n, v = v\n            if not isinstance(v, dict):\n                # old-style tuple action\n                v = expand_action(*v)\n            return (v['order'] or 0, n)\n    \n        sactions = sorted(enumerate(actions), key=orderandpos)\n    \n        def orderonly(v):\n            n, v = v\n            if not isinstance(v, dict):\n                # old-style tuple action\n                v = expand_action(*v)\n            return v['order'] or 0\n    \n        for order, actiongroup in itertools.groupby(sactions, orderonly):\n            # \"order\" is an integer grouping. Actions in a lower order will be\n            # executed before actions in a higher order.  All of the actions in\n            # one grouping will be executed (its callable, if any will be called)\n            # before any of the actions in the next.\n    \n            unique = {}\n            output = []\n    \n            for i, action in actiongroup:\n                # Within an order, actions are executed sequentially based on\n                # original action ordering (\"i\").\n    \n                if not isinstance(action, dict):\n                    # old-style tuple action\n                    action = expand_action(*action)\n    \n                # \"ainfo\" is a tuple of (order, i, action) where \"order\" is a\n                # user-supplied grouping, \"i\" is an integer expressing the relative\n                # position of this action in the action list being resolved, and\n                # \"action\" is an action dictionary.  The purpose of an ainfo is to\n                # associate an \"order\" and an \"i\" with a particular action; \"order\"\n                # and \"i\" exist for sorting purposes after conflict resolution.\n                ainfo = (order, i, action)\n    \n                discriminator = undefer(action['discriminator'])\n                action['discriminator'] = discriminator\n    \n                if discriminator is None:\n                    # The discriminator is None, so this action can never conflict.\n                    # We can add it directly to the result.\n                    output.append(ainfo)\n                    continue\n    \n                L = unique.setdefault(discriminator, [])\n                L.append(ainfo)\n    \n            # Check for conflicts\n            conflicts = {}\n    \n            for discriminator, ainfos in unique.items():\n                # We use (includepath, order, i) as a sort key because we need to\n                # sort the actions by the paths so that the shortest path with a\n                # given prefix comes first.  The \"first\" action is the one with the\n                # shortest include path.  We break sorting ties using \"order\", then\n                # \"i\".\n                def bypath(ainfo):\n                    path, order, i = ainfo[2]['includepath'], ainfo[0], ainfo[1]\n                    return path, order, i\n    \n                ainfos.sort(key=bypath)\n                ainfo, rest = ainfos[0], ainfos[1:]\n                output.append(ainfo)\n                _, _, action = ainfo\n                basepath, baseinfo, discriminator = (\n                    action['includepath'],\n                    action['info'],\n                    action['discriminator'],\n                    )\n    \n                for _, _, action in rest:\n                    includepath = action['includepath']\n                    # Test whether path is a prefix of opath\n                    if (includepath[:len(basepath)] != basepath # not a prefix\n                        or includepath == basepath):\n                        L = conflicts.setdefault(discriminator, [baseinfo])\n                        L.append(action['info'])\n    \n            if conflicts:\n>               raise ConfigurationConflictError(conflicts)\nE               pyramid.exceptions.ConfigurationConflictError: Conflicting configuration actions\nE                 For: ('view', None, '', None, 'd41d8cd98f00b204e9800998ecf8427e')\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/__init__.py:\nE                       def abc(request):\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/__init__.py:\nE                       def abc(request):\nE                 For: ('view', None, 'two', None, 'd41d8cd98f00b204e9800998ecf8427e')\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/another.py:\nE                       def two(request):\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/another.py:\nE                       def two(request):\n\npyramid/config/__init__.py:1176: ConfigurationConflictError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_scan_integration_conflict>\n\n    def test_scan_integration_conflict(self):\n        from pyramid.tests.test_config.pkgs import selfscan\n        from pyramid.config import Configurator\n        c = Configurator()\n        c.scan(selfscan)\n        c.scan(selfscan)\n        try:\n            c.commit()\n        except ConfigurationConflictError as why:\n            def scanconflicts(e):\n                conflicts = e._conflicts.values()\n                for conflict in conflicts:\n                    for confinst in conflict:\n                        yield confinst.src\n            which = list(scanconflicts(why))\n            self.assertEqual(len(which), 4)\n>           self.assertTrue(\"@view_config(renderer='string')\" in which)\nE           AssertionError: False is not true\n\nr2e_tests/test_config/test_init.py:1008: AssertionError\n_______ ConfiguratorTests.test_setup_registry_debug_logger_None_default ________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_setup_registry_debug_logger_None_default>\n\n    def test_setup_registry_debug_logger_None_default(self):\n        from pyramid.registry import Registry\n        from pyramid.interfaces import IDebugLogger\n        reg = Registry()\n        config = self._makeOne(reg)\n        config.setup_registry()\n        logger = reg.getUtility(IDebugLogger)\n>       self.assertEqual(logger.name, 'pyramid.tests.test_config')\nE       AssertionError: 'r2e_tests.test_config' != 'pyramid.tests.test_config'\nE       - r2e_tests.test_config\nE       ?  ^^^\nE       + pyramid.tests.test_config\nE       ? ++ ^^^^^\n\nr2e_tests/test_config/test_init.py:428: AssertionError\n____ TestConfigurator_add_directive.test_add_directive_with_custom_callable ____\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_add_directive_with_custom_callable>\n\n    def test_add_directive_with_custom_callable(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n                'dummy_callable', 'pyramid.tests.test_config.dummy_callable')\n        self.assertTrue(hasattr(config, 'dummy_callable'))\n        config.dummy_callable('discrim')\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'discrim')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1207: AssertionError\n________ TestConfigurator_add_directive.test_add_directive_with_partial ________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_add_directive_with_partial>\n\n    def test_add_directive_with_partial(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n                'dummy_partial', 'pyramid.tests.test_config.dummy_partial')\n        self.assertTrue(hasattr(config, 'dummy_partial'))\n        config.dummy_partial()\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'partial')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1194: AssertionError\n_________ TestConfigurator_add_directive.test_extend_with_dotted_name __________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_extend_with_dotted_name>\n\n    def test_extend_with_dotted_name(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n            'dummy_extend', 'pyramid.tests.test_config.dummy_extend')\n        self.assertTrue(hasattr(config, 'dummy_extend'))\n        config.dummy_extend('discrim')\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'discrim')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1181: AssertionError\n_______ TestConfigurator_add_directive.test_extend_with_python_callable ________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_extend_with_python_callable>\n\n    def test_extend_with_python_callable(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n            'dummy_extend', dummy_extend)\n        self.assertTrue(hasattr(config, 'dummy_extend'))\n        config.dummy_extend('discrim')\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'discrim')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1220: AssertionError\n_________ TestConfigurator__add_predicate.test_factory_as_dotted_name __________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator__add_predicate testMethod=test_factory_as_dotted_name>\n\n    def test_factory_as_dotted_name(self):\n        config = self._makeOne()\n    \n        def _fakeAction(discriminator, callable=None, args=(),\n                        kw=None, order=0, introspectables=(), **extra):\n            self.assertEqual(len(introspectables), 1)\n            self.assertEqual(introspectables[0]['name'], 'testing')\n            self.assertEqual(introspectables[0]['factory'], DummyPredicate)\n    \n        config.action = _fakeAction\n>       config._add_predicate(\n            'route',\n            'testing',\n            'pyramid.tests.test_config.test_init.DummyPredicate'\n            )\n\nr2e_tests/test_config/test_init.py:1284: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:499: in _add_predicate\n    self.action(discriminator, register, introspectables=(intr,),\nr2e_tests/test_config/test_init.py:1281: in _fakeAction\n    self.assertEqual(introspectables[0]['factory'], DummyPredicate)\nE   AssertionError: <class 'pyramid.tests.test_config.test_init.DummyPredicate'> != <class 'r2e_tests.test_config.test_init.DummyPredicate'>\n____ TestViewsConfigurationMixin.test_add_static_view_package_here_relative ____\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_static_view_package_here_relative>\n\n    def test_add_static_view_package_here_relative(self):\n        from pyramid.interfaces import IStaticURLInfo\n        info = DummyStaticURLInfo()\n        config = self._makeOne(autocommit=True)\n        config.registry.registerUtility(info, IStaticURLInfo)\n        config.add_static_view('static', 'files')\n>       self.assertEqual(\n            info.added,\n            [(config, 'static', 'pyramid.tests.test_config:files', {})])\nE       AssertionError: Lists differ: [(<py[39 chars]5b1238925e0>, 'static', 'r2e_tests.test_config:files', {})] != [(<py[39 chars]5b1238925e0>, 'static', 'pyramid.tests.test_config:files', {})]\nE       \nE       First differing element 0:\nE       (<pyr[37 chars]75b1238925e0>, 'static', 'r2e_tests.test_config:files', {})\nE       (<pyr[37 chars]75b1238925e0>, 'static', 'pyramid.tests.test_config:files', {})\nE       \nE         [(<pyramid.config.Configurator object at 0x75b1238925e0>,\nE           'static',\nE       -   'r2e_tests.test_config:files',\nE       ?     ^^^\nE       \nE       +   'pyramid.tests.test_config:files',\nE       ?    ++ ^^^^^\nE       \nE           {})]\n\nr2e_tests/test_config/test_views.py:1755: AssertionError\n_ TestViewsConfigurationMixin.test_add_view_custom_predicate_bests_standard_predicate _\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_custom_predicate_bests_standard_predicate>\n\n    def test_add_view_custom_predicate_bests_standard_predicate(self):\n        import warnings\n        from pyramid.renderers import null_renderer\n        view = lambda *arg: 'OK'\n        view2 = lambda *arg: 'NOT OK'\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request):\n            return True\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_view(view=view, custom_predicates=(pred1,),\n                        renderer=null_renderer)\n            config.add_view(view=view2, request_method='GET',\n                            renderer=null_renderer)\n>           self.assertEqual(len(w), 1)\nE           AssertionError: 3 != 1\n\nr2e_tests/test_config/test_views.py:1471: AssertionError\n____ TestViewsConfigurationMixin.test_add_view_with_custom_predicates_match ____\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_custom_predicates_match>\n\n    def test_add_view_with_custom_predicates_match(self):\n        import warnings\n        from pyramid.renderers import null_renderer\n        view = lambda *arg: 'OK'\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request):\n            return True\n        def pred2(context, request):\n            return True\n        predicates = (pred1, pred2)\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_view(view=view, custom_predicates=predicates,\n                            renderer=null_renderer)\n>           self.assertEqual(len(w), 1)\nE           AssertionError: 2 != 1\n\nr2e_tests/test_config/test_views.py:1435: AssertionError\n___ TestViewsConfigurationMixin.test_add_view_with_custom_predicates_nomatch ___\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_custom_predicates_nomatch>\n\n    def test_add_view_with_custom_predicates_nomatch(self):\n        import warnings\n        view = lambda *arg: 'OK'\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request):\n            return True\n        def pred2(context, request):\n            return False\n        predicates = (pred1, pred2)\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_view(view=view, custom_predicates=predicates)\n>           self.assertEqual(len(w), 1)\nE           AssertionError: 2 != 1\n\nr2e_tests/test_config/test_views.py:1452: AssertionError\n_______ TestViewsConfigurationMixin.test_add_view_with_template_renderer _______\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_template_renderer>\n\n    def test_add_view_with_template_renderer(self):\n        from pyramid.tests import test_config\n        from pyramid.interfaces import ISettings\n        class view(object):\n            def __init__(self, context, request):\n                self.request = request\n                self.context = context\n    \n            def __call__(self):\n                return {'a':'1'}\n        config = self._makeOne(autocommit=True)\n        renderer = self._registerRenderer(config)\n        fixture = 'pyramid.tests.test_config:files/minimal.txt'\n        config.introspection = False\n        config.add_view(view=view, renderer=fixture)\n        wrapper = self._getViewCallable(config)\n        request = self._makeRequest(config)\n        result = wrapper(None, request)\n        self.assertEqual(result.body, b'Hello!')\n        settings = config.registry.queryUtility(ISettings)\n        result = renderer.info\n        self.assertEqual(result.registry, config.registry)\n        self.assertEqual(result.type, '.txt')\n>       self.assertEqual(result.package, test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_views.py:1070: AssertionError\n_ TestViewsConfigurationMixin.test_add_view_with_template_renderer_no_callable _\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_template_renderer_no_callable>\n\n    def test_add_view_with_template_renderer_no_callable(self):\n        from pyramid.tests import test_config\n        from pyramid.interfaces import ISettings\n        config = self._makeOne(autocommit=True)\n        renderer = self._registerRenderer(config)\n        fixture = 'pyramid.tests.test_config:files/minimal.txt'\n        config.introspection = False\n        config.add_view(view=None, renderer=fixture)\n        wrapper = self._getViewCallable(config)\n        request = self._makeRequest(config)\n        result = wrapper(None, request)\n        self.assertEqual(result.body, b'Hello!')\n        settings = config.registry.queryUtility(ISettings)\n        result = renderer.info\n        self.assertEqual(result.registry, config.registry)\n        self.assertEqual(result.type, '.txt')\n>       self.assertEqual(result.package, test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_views.py:1111: AssertionError\n_____________ TestViewDeriver.test_function_returns_non_adaptable ______________\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable>\n\n    def test_function_returns_non_adaptable(self):\n        def view(request):\n            return None\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n>           result(None, None)\n\nr2e_tests/test_config/test_views.py:2366: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None, request = None\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable function r2e_tests.test_config.test_views.view into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable>\n\n    def test_function_returns_non_adaptable(self):\n        def view(request):\n            return None\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n            result(None, None)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                'Could not convert return value of the view callable function '\n                'pyramid.tests.test_config.test_views.view into a response '\n                'object. The value returned was None. You may have forgotten '\n                'to return a value from the view callable.'\n                )\nE           AssertionError: 'Coul[52 chars]tion r2e_tests.test_config.test_views.view int[110 chars]ble.' != 'Coul[52 chars]tion pyramid.tests.test_config.test_views.view[114 chars]ble.'\nE           Diff is 663 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2368: AssertionError\n___________ TestViewDeriver.test_function_returns_non_adaptable_dict ___________\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable_dict>\n\n    def test_function_returns_non_adaptable_dict(self):\n        def view(request):\n            return {'a':1}\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n>           result(None, None)\n\nr2e_tests/test_config/test_views.py:2385: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None, request = None\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable function r2e_tests.test_config.test_views.view into a response object. The value returned was {'a': 1}. You may have forgotten to define a renderer in the view configuration.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable_dict>\n\n    def test_function_returns_non_adaptable_dict(self):\n        def view(request):\n            return {'a':1}\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n            result(None, None)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                \"Could not convert return value of the view callable function \"\n                \"pyramid.tests.test_config.test_views.view into a response \"\n                \"object. The value returned was {'a': 1}. You may have \"\n                \"forgotten to define a renderer in the view configuration.\"\n                )\nE           AssertionError: \"Coul[52 chars]tion r2e_tests.test_config.test_views.view int[120 chars]ion.\" != \"Coul[52 chars]tion pyramid.tests.test_config.test_views.view[124 chars]ion.\"\nE           Diff is 683 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2387: AssertionError\n_____________ TestViewDeriver.test_instance_returns_non_adaptable ______________\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_instance_returns_non_adaptable>\n\n    def test_instance_returns_non_adaptable(self):\n        class AView(object):\n            def __call__(self, request):\n                return None\n        view = AView()\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n>           result(None, None)\n\nr2e_tests/test_config/test_views.py:2406: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None, request = None\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable object <r2e_tests.test_config.test_views.TestViewDeriver.test_instance_returns_non_adaptable.<locals>.AView object at 0x75b123892b50> into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_instance_returns_non_adaptable>\n\n    def test_instance_returns_non_adaptable(self):\n        class AView(object):\n            def __call__(self, request):\n                return None\n        view = AView()\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n            result(None, None)\n        except ValueError as e:\n            msg = e.args[0]\n>           self.assertTrue(msg.startswith(\n                'Could not convert return value of the view callable object '\n                '<pyramid.tests.test_config.test_views.'))\nE           AssertionError: False is not true\n\nr2e_tests/test_config/test_views.py:2409: AssertionError\n____ TestViewDeriver.test_requestonly_default_method_returns_non_adaptable _____\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_default_method_returns_non_adaptable>\n\n    def test_requestonly_default_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def __call__(self):\n                return None\n        deriver = self._makeOne()\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n>           result(None, request)\n\nr2e_tests/test_config/test_views.py:2452: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x75b123a02f40>\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable method __call__ of class r2e_tests.test_config.test_views.AView into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_default_method_returns_non_adaptable>\n\n    def test_requestonly_default_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def __call__(self):\n                return None\n        deriver = self._makeOne()\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n            result(None, request)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                'Could not convert return value of the view callable '\n                'method __call__ of '\n                'class pyramid.tests.test_config.test_views.AView into a '\n                'response object. The value returned was None. You may have '\n                'forgotten to return a value from the view callable.'\n                )\nE           AssertionError: 'Coul[68 chars]lass r2e_tests.test_config.test_views.AView in[111 chars]ble.' != 'Coul[68 chars]lass pyramid.tests.test_config.test_views.AVie[115 chars]ble.'\nE           Diff is 649 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2454: AssertionError\n___ TestViewDeriver.test_requestonly_nondefault_method_returns_non_adaptable ___\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_nondefault_method_returns_non_adaptable>\n\n    def test_requestonly_nondefault_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def theviewmethod(self):\n                return None\n        deriver = self._makeOne(attr='theviewmethod')\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n>           result(None, request)\n\nr2e_tests/test_config/test_views.py:2476: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x75b1241f01f0>\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable method theviewmethod of class r2e_tests.test_config.test_views.AView into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_nondefault_method_returns_non_adaptable>\n\n    def test_requestonly_nondefault_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def theviewmethod(self):\n                return None\n        deriver = self._makeOne(attr='theviewmethod')\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n            result(None, request)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                'Could not convert return value of the view callable '\n                'method theviewmethod of '\n                'class pyramid.tests.test_config.test_views.AView into a '\n                'response object. The value returned was None. You may have '\n                'forgotten to return a value from the view callable.'\n                )\nE           AssertionError: 'Coul[73 chars]lass r2e_tests.test_config.test_views.AView in[111 chars]ble.' != 'Coul[73 chars]lass pyramid.tests.test_config.test_views.AVie[115 chars]ble.'\nE           Diff is 669 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2478: AssertionError\n___________________ Test_view_description.test_without_text ____________________\n\nself = <r2e_tests.test_config.test_views.Test_view_description testMethod=test_without_text>\n\n    def test_without_text(self):\n        def view(): pass\n        result = self._callFUT(view)\n>       self.assertEqual(result,\n                         'function pyramid.tests.test_config.test_views.view')\nE       AssertionError: 'function r2e_tests.test_config.test_views.view' != 'function pyramid.tests.test_config.test_views.view'\nE       - function r2e_tests.test_config.test_views.view\nE       ?           ^^^\nE       + function pyramid.tests.test_config.test_views.view\nE       ?          ++ ^^^^^\n\nr2e_tests/test_config/test_views.py:3937: AssertionError\n_______________ TestPRequestCommand.test_command_display_headers _______________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_display_headers>\n\n    def test_command_display_headers(self):\n        command = self._makeOne(\n            ['', '--display-headers', 'development.ini', '/'])\n        command.run()\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(\n            self._out,\n            ['200 OK', 'Content-Type: text/html; charset=UTF-8', 'abc'])\nE       AssertionError: Lists differ: ['200 OK', b'abc'] != ['200 OK', 'Content-Type: text/html; charset=UTF-8', 'abc']\nE       \nE       First differing element 1:\nE       b'abc'\nE       'Content-Type: text/html; charset=UTF-8'\nE       \nE       Second list contains 1 additional elements.\nE       First extra element 2:\nE       'abc'\nE       \nE       - ['200 OK', b'abc']\nE       + ['200 OK', 'Content-Type: text/html; charset=UTF-8', 'abc']\n\nr2e_tests/test_scripts/test_prequest.py:202: AssertionError\n_________ TestPRequestCommand.test_command_has_content_type_header_var _________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_has_content_type_header_var>\n\n    def test_command_has_content_type_header_var(self):\n        command = self._makeOne(\n            ['', '--header=content-type:app/foo','development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['CONTENT_TYPE'], 'app/foo')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:92: AssertionError\n_____________ TestPRequestCommand.test_command_has_good_header_var _____________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_has_good_header_var>\n\n    def test_command_has_good_header_var(self):\n        command = self._makeOne(\n            ['', '--header=name:value','development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['HTTP_NAME'], 'value')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:69: AssertionError\n__________ TestPRequestCommand.test_command_has_multiple_header_vars ___________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_has_multiple_header_vars>\n\n    def test_command_has_multiple_header_vars(self):\n        command = self._makeOne(\n            ['',\n             '--header=name:value',\n             '--header=name2:value2',\n             'development.ini',\n             '/'])\n        command.run()\n        self.assertEqual(self._environ['HTTP_NAME'], 'value')\n        self.assertEqual(self._environ['HTTP_NAME2'], 'value2')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:107: AssertionError\n_________________ TestPRequestCommand.test_command_method_get __________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_get>\n\n    def test_command_method_get(self):\n        command = self._makeOne(['', '--method=GET', 'development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'GET')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:116: AssertionError\n_______________ TestPRequestCommand.test_command_method_options ________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_options>\n\n    def test_command_method_options(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=OPTIONS', 'development.ini',\n                                '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'OPTIONS')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:184: AssertionError\n________________ TestPRequestCommand.test_command_method_patch _________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_patch>\n\n    def test_command_method_patch(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=PATCH', 'development.ini', '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'PATCH')\n        self.assertEqual(self._environ['CONTENT_LENGTH'], '-1')\n        self.assertEqual(self._environ['wsgi.input'], stdin)\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:158: AssertionError\n_________________ TestPRequestCommand.test_command_method_post _________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_post>\n\n    def test_command_method_post(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=POST', 'development.ini', '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'POST')\n        self.assertEqual(self._environ['CONTENT_LENGTH'], '-1')\n        self.assertEqual(self._environ['wsgi.input'], stdin)\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:130: AssertionError\n_______________ TestPRequestCommand.test_command_method_propfind _______________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_propfind>\n\n    def test_command_method_propfind(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=PROPFIND', 'development.ini',\n                                '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'PROPFIND')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:171: AssertionError\n_________________ TestPRequestCommand.test_command_method_put __________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_put>\n\n    def test_command_method_put(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=PUT', 'development.ini', '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'PUT')\n        self.assertEqual(self._environ['CONTENT_LENGTH'], '-1')\n        self.assertEqual(self._environ['wsgi.input'], stdin)\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:144: AssertionError\n________ TestPRequestCommand.test_command_path_doesnt_start_with_slash _________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_path_doesnt_start_with_slash>\n\n    def test_command_path_doesnt_start_with_slash(self):\n        command = self._makeOne(['', 'development.ini', 'abc'])\n        command.run()\n        self.assertEqual(self._path_info, '/abc')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:50: AssertionError\n__________________ TestPRequestCommand.test_command_two_args ___________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_two_args>\n\n    def test_command_two_args(self):\n        command = self._makeOne(['', 'development.ini', '/'])\n        command.run()\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:42: AssertionError\n________________ TestPRequestCommand.test_command_w_basic_auth _________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_w_basic_auth>\n\n    def test_command_w_basic_auth(self):\n        command = self._makeOne(\n            ['', '--login=user:password',\n                 '--header=name:value','development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['HTTP_NAME'], 'value')\n        self.assertEqual(self._environ['HTTP_AUTHORIZATION'],\n                        'Basic dXNlcjpwYXNzd29yZA==')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:82: AssertionError\n______________ TestPRequestCommand.test_command_with_query_string ______________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_with_query_string>\n\n    def test_command_with_query_string(self):\n        command = self._makeOne(['', 'development.ini', '/abc?a=1&b=2&c'])\n        command.run()\n        self.assertEqual(self._environ['QUERY_STRING'], 'a=1&b=2&c')\n        self.assertEqual(self._path_info, '/abc')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:193: AssertionError\n_____ TestPViewsCommand.test_views_command_single_view_function_traversal ______\n\nself = <r2e_tests.test_scripts.test_pviews.TestPViewsCommand testMethod=test_views_command_single_view_function_traversal>\n\n    def test_views_command_single_view_function_traversal(self):\n        from pyramid.registry import Registry\n        registry = Registry()\n        command = self._makeOne(registry=registry)\n        L = []\n        command.out = L.append\n        def view(): pass\n        view.__request_attrs__ = {'context': 'context', 'view_name': 'a'}\n        command._find_view = lambda arg1: view\n        command.args = ('/foo/bar/myapp.ini#myapp', '/a')\n        result = command.run()\n        self.assertEqual(result, 0)\n        self.assertEqual(L[1], 'URL = /a')\n        self.assertEqual(L[3], '    context: context')\n        self.assertEqual(L[4], '    view name: a')\n>       self.assertEqual(L[8],\n                         '    pyramid.tests.test_scripts.test_pviews.view')\nE       AssertionError: '    r2e_tests.test_scripts.test_pviews.view' != '    pyramid.tests.test_scripts.test_pviews.view'\nE       -     r2e_tests.test_scripts.test_pviews.view\nE       ?      ^^^\nE       +     pyramid.tests.test_scripts.test_pviews.view\nE       ?     ++ ^^^^^\n\nr2e_tests/test_scripts/test_pviews.py:296: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_defaults\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_discriminator\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_path_no_pattern\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_pattern_with_path\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_attr\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_context\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_permission\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_renderer\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_accept\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_custom_predicates\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_empty_string_with_route_prefix\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_factory\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_factory_dottedname\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_header\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_highorder\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_regex\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_pregenerator\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_request_method\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_request_param\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_root_slash_with_route_prefix\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_route_prefix\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_static\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_xhr\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_already_registered\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_not_yet_registered\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_object_event_subscriber\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_default_resource_iface_means_Interface\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_nodefault_resource_iface\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_response_adapter\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_response_adapter_dottednames\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_response_adapter_self\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_defaults\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_dottednames\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_iface_specified\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_predicate\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_default_type_predicates_False\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_default_type_predicates_True\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_specific_type_and_predicates_False\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_specific_type_and_predicates_True\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_default_iface_means_Interface\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_introspectables\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_nondefault_iface\nPASSED r2e_tests/test_config/test_adapters.py::Test_eventonly::test_defaults\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test__override_already_registered\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test__override_not_yet_registered\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_directory_with_directory\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_directory_with_file\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_directory_with_package\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_file_with_directory\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_file_with_file\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_file_with_package\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_package_with_directory\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_package_with_package\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_samename\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_filename_override_returns_value\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_stream_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_stream_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_stream_override_returns_value\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_string_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_string_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_string_override_returns_value\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_has_resource_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_has_resource_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_has_resource_override_returns_True\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_isdir_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_isdir_override_returns_False\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_isdir_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_listdir_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_listdir_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_listdir_override_returns_values\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_class_conforms_to_IPEP302Loader\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_class_conforms_to_IPackageOverrides\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_package_already_has_loader_of_different_type\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_package_already_has_loader_of_same_type\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_registers_loader_type\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_sets_loader\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_sets_local_state\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_code_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_code_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_data_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_data_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_filename_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_source_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_source_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_stream\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_stream_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_string\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_string_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_has_resource\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_has_resource_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_insert_directory\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_insert_emptystring\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_insert_file\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_instance_conforms_to_IPEP302Loader\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_instance_conforms_to_IPackageOverrides\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_is_package_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_is_package_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_isdir_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_isdir_false\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_isdir_true\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_listdir\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_listdir_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_search_path\nPASSED r2e_tests/test_config/test_assets.py::TestDirectoryOverride::test_it_match\nPASSED r2e_tests/test_config/test_assets.py::TestDirectoryOverride::test_it_no_match\nPASSED r2e_tests/test_config/test_assets.py::TestFileOverride::test_it_match\nPASSED r2e_tests/test_config/test_assets.py::TestFileOverride::test_it_no_match\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_None_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_None_callable_and_no_name\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_None_callable_conflict\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_unnamed_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_multiple_request_methods_conflict\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_factory\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_factory_dottedname\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_root_factory\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_root_factory_as_None\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_root_factory_dottedname\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_session_factory\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_session_factory_dottedname\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_multiple_request_properties\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_multiple_request_properties_conflict\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_request_property_with_callable\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_request_property_with_property\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_request_property_with_unnamed_callable\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_missing_dir\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_no_specs\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_set_locale_negotiator\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_set_locale_negotiator_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__matches\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__matches_no_action_wrap\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__missing_when_directives_dont_exist\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__missing_when_directives_exist\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_has_listeners\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_notify\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_queryAdapterOrSelf\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_registerSelfAdapter\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_absolute_asset_spec_already_absolute\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_absolute_asset_spec_notastring\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_absolute_asset_spec_relative\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_autocommit_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_autocommit_with_introspectables_introspection_off\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_kw_is_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_kw_is_not_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_nonautocommit_with_config_info\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_nonautocommit_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_nonautocommit_without_config_info\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_nonautocommit_with_introspectables_introspection_off\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_autocommit_no_conflicts\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_begin\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_begin_with_request\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_resolved_with_include\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_resolved_with_two_includes_and_local\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_simple\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_with_two_includes\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_conflict_set_forbidden_view\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_conflict_set_notfound_view\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_alternate_renderers\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_authentication_policy\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_authorization_policy_only\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_permission\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_renderers\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_view_mapper\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_webob_response_adapter_registered\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_exceptionresponse_view_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_exceptionresponse_view_custom\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_httpexception_view_default\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_no_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_noreg_custom_settings\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_noreg_debug_logger_non_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_session_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_with_introspection\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_with_package_registry\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_with_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_end\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_hook_zca\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_dotted_name\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_missing_source_file\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_module_defaults_to_includeme\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_module_defaults_to_includeme_missing\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_nested_route_prefix\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_python_callable\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_route_prefix\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_introspector_decorator\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_make_wsgi_app\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_maybe_dotted_notstring_success\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_maybe_dotted_string_fail\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_maybe_dotted_string_success\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_dottedname_package\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_with_extra_kw\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_with_ignore\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_with_onerror\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_alternate_renderers\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authentication_policy\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authentication_policy_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authorization_policy_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authorization_policy_only\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_calls_fix_registry\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_custom_settings\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_debug_logger_name\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_debug_logger_non_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_default_permission\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_dottedname_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_explicit_notfound_trumps_iexceptionresponse\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_includes\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_includes_spaces\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_locale_negotiator\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_locale_negotiator_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_no_default_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_registers_default_exceptionresponse_views\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_registers_default_view_predicates\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_registers_default_webob_iresponse_adapter\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_request_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_request_factory_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_tweens\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_unhook_zca\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_with_package\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_with_package_module\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_with_package_package\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_directive_persists_across_configurator_creations\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_action_method_successful\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_same_name_doesnt_conflict\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator__add_predicate::test_factory_as_object\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_simple\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_includepath\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_includepath_and_info\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_info\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_order\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_dicts\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_error\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_tuples\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_with_introspectable_no_callable\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_it\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_processSpec\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_conflict\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_success_dicts\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_success_tuples\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_with_actions_grouped_by_order\nPASSED r2e_tests/test_config/test_init.py::TestGlobalRegistriesIntegration::test_global_registries\nPASSED r2e_tests/test_config/test_init.py::TestGlobalRegistriesIntegration::test_global_registries_empty\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test___call___true\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test___call___true_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test___call___true_single\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test_ctor_get_but_no_head\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test___call___true\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test_ctor_compilefail\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___false_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___true_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___true_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___true_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_phash_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_phash_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_text_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_text_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_text_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___matchdict_is_None\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___true_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___true_single\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test___call___true\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test_text_func_has___text__\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test_text_func_repr\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test___call__traverse_has_remainder_already\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test___call__traverse_matches\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test___call__traverse_matches_with_highorder_chars\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_it_call_val_False\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_it_call_val_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_it_call_val_str\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___false_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___true_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___true_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___true_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_phash_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_phash_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_phash_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_text_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_text_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_text_withval\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_False\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_context_has_no_name\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_val_list_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_val_str_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_val_tuple_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_authentication_policy_doesnt_provide_superset\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_authentication_policy_provides_superset\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_authentication_policy_provides_superset_implicit\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_no_authentication_policy\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_text_noniter\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_default_renderers\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_renderer\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_renderer_dottedname_factory\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_defaults\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_discriminator\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_path_no_pattern\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_pattern_with_path\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_attr\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_context\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_permission\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_renderer\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_accept\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_custom_predicates\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_empty_string_with_route_prefix\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_factory\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_factory_dottedname\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_header\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_highorder\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_regex\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_pregenerator\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_request_method\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_request_param\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_root_slash_with_route_prefix\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_route_prefix\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_static\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_xhr\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_already_registered\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_not_yet_registered\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_add_permission\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_no_authz_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_no_authz_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_with_authz_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_with_authz_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_no_authn_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_no_authn_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_with_authn_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_with_authn_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_default_permission\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test__set_settings_as_None\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test__set_settings_as_dictwithvalues\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_add_settings_settings_None\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_add_settings_settings_already_registered\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_add_settings_settings_not_yet_registered\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_get_settings_nosettings\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_get_settings_withsettings\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_all\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_authorization\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_notfound\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_routematch\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_templates\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_default_locale_name\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_getattr_fail\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_getattr_raises_attribute_error\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_getattr_success\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_noargs\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_originals_kept\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_prevent_http_cache\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_all\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_assets\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_resources\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_templates\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_renderer\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_renderer_explicitrenderer\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_renderer_twice\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_defaults\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_dottedname\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_multiple\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_single\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_template\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_resources\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_securitypolicy\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_securitypolicy_forget_result\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_securitypolicy_remember_result\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_dottedname\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_instance\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_name_ingress\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_name_main\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_over_ingress\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_over_ingress_iterable\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_under_main\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_under_main_iterable\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_unsuitable\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_conflict\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_distinct\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_with_over_nonstringoriter\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_with_under_nonstringoriter\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_with_underover\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test___call___explicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test___call___implicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_add_explicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_add_implicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_1\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_2\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_3\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_4\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_5\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_conflict_direct\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_conflict_indirect\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_over_and_under_partials\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_over_partial\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_over_partial_with_fallback\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_under_partial\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_under_partial_with_fallback\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_with_missing_fallbacks\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_with_multiple_matching_fallbacks\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_with_partial_fallbacks\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_custom_predicates_can_affect_traversal\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_different_custom_predicates_with_same_hash\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_dict\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_dict_fails\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_string\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_string_fails\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_notted\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_importance_and_number\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_importance_of_predicates\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_number_of_predicates\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_xhr_and_request_method_trump_only_containment\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_predicate_text_is_correct\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_request_method_ordering_hashes_same\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_request_method_sequence\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_traverse_has_remainder_already\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_traverse_matches\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_traverse_matches_with_highorder_chars\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_unknown_predicate\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_noargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_with_attr_false\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_with_attr_true\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_nocall\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_method_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_firstname_request_with_secondname\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_noargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_noargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_no_init\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_requestonly_newstyle_class_init_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_requestonly_newstyle_class_init_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_requestonly_newstyle_class_no_init\nPASSED r2e_tests/test_config/test_util.py::TestNotted::test_it_with_phash_val\nPASSED r2e_tests/test_config/test_util.py::TestNotted::test_it_without_phash_val\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_allows_other_predicates\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_context\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_for_\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_http_cache\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_with_view_defaults\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_allows_other_predicates\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_append_slash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_context\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_for_\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_http_cache\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_with_view_defaults\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_absolute\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_here_no_utility_registered\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_package_relative\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instance\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instance_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instancemethod\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instancemethod_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_oldstyle_class\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_oldstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_as_class\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_as_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_as_iface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_trumps_for\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_custom_more_preds_first_bests_fewer_preds_last\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_default_phash_overrides_default_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_default_phash_overrides_no_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_default_phash_overrides_default_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_default_phash_overrides_no_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_multiview_replaces_existing_securedview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_multiview_replaces_multiview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_mulview_replaces_existing_view_with___accept__\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_same_phash_overrides_existing_single_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_with_accept_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exception_register_secured_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_for__as_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_for_as_class\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_for_as_iface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_mixed_case_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview___discriminator__\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_call_ordering\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_context_superclass_then_subclass\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_exception_superclass_then_subclass\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_existing_securedview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_existing_view_with___accept__\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_multiview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_register_secured_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_same_phash_overrides_existing_single_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_same_predicates\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_view_callable_None_no_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_view_callable_None_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_view_callable_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_accept_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_accept_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_accept_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_containment_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_containment_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_containment_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_decorator\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_decorator_tuple\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_default_permission_no_explicit_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_default_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_function_callable\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_function_callable_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_badregex\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_noval_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_noval_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_val_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_val_missing\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_val_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_http_cache\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_mapper\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_name_unicode\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_no_default_permission_no_explicit_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_nonexistant_route_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_path_info_badregex\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_path_info_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_path_info_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_get_implies_head\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_sequence_conflict\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_sequence_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_sequence_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_noval_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_noval_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_val_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_val_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type_and_route_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type_as_iface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type_as_noniface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_route_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_route_name_exception\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_tmpl_renderer_factory_introspector_missing\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_tmpl_renderer_factory_no_renderer_factory\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_tmpl_renderer_factory_with_renderer_factory\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_config_and_view_defaults_conflicts\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_config_and_view_defaults_doesnt_conflict\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_defaults\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_defaults_viewname_is_dottedname_kwarg\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_defaults_viewname_is_dottedname_nonkwarg\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_xhr_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_xhr_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_wrapped_view_is_decorated\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_views_with_accept_multiview_replaces_existing\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_function\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_with_default_renderer_no_explicit_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_with_default_renderer_with_explicit_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_set_view_mapper\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_set_view_mapper_dottedname\nPASSED r2e_tests/test_config/test_views.py::Test_requestonly::test_defaults\nPASSED r2e_tests/test_config/test_views.py::Test_requestonly::test_otherattr\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_IException\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_IException_subinterface\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_exception_class\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_exception_instance\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call__\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call__intermediate_not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call__raise_not_found_isnt_interpreted_as_pred_mismatch\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call_permissive_has_call_permissive\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call_permissive_has_no_call_permissive\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call__not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call__with_accept_match\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call__with_accept_miss\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call_permissive__not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add_with_phash\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add_with_phash_override_accept\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add_with_phash_override_accept2\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_class_implements_ISecuredView\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views_best_match_returns_None\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views_no_self_accepts\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views_request_has_no_accept\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_instance_implements_ISecuredView\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_match_not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_match_predicate_fails\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_match_predicate_succeeds\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_multiple_with_functions_as_views\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_permitted\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_permitted_no_match_with__permitted__\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_permitted_no_views\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_function_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_function_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_context_and_request_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_requestonly_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_context_and_request_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_requestonly_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_cls_context_request_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_cls_requestonly_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_attr_wrapped_view_branching_default_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_attr_wrapped_view_branching_nondefault_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_class_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_class_without_attr\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_denied\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_denied2\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_overridden\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_permitted\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_permitted_no_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_true_Response_no_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_true_Response_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_prevent_http_cache_in_settings\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_bad_tuple\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_integer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_prevent_auto_set\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_timedelta\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_tuple\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_tuple_seconds_None\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_predicate_mismatch_exception_has_text_in_detail\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_predicate_mismatch_view_has_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_predicate_mismatch_view_has_no_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function_with_renderer_request_has_view\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function_with_renderer_request_override\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_authn_policy_no_authz_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_authz_policy_no_authn_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_raises_forbidden_no_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_raises_forbidden_with_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_authn_policy_no_authz_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_authz_policy_no_authn_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_no_authpol\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_no_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_predicates_all\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_predicates_checker\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_predicates_notall\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_view_mapper_config_specified\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_view_mapper_default_mapper_specified\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_view_mapper_view_specified\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_wrapper_viewname\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_wrapper_viewname_notfound\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test__view_as_function_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_function_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_function_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_function_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_context_and_request_and_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_context_and_request_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_context_and_request_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_different\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_different_with_existing_original_view\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_same\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_view_is_None\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_already_exists\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_url_noendslash\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_url_noscheme\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_url_withendslash\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_context\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_for_\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_permission\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_route_prefix\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_missing\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_quoting\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_registration_miss\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_registration_no_registry_on_request\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_route_url\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_slash_in_name1\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_slash_in_name2\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_quoted_remote\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_unquoted_local\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_with_custom_anchor\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_with_custom_query\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_verifyClass\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_verifyObject\nPASSED r2e_tests/test_config/test_views.py::Test_view_description::test_with_text\nPASSED r2e_tests/test_scripts/test_common.py::Test_logging_file_config::test_it\nPASSED r2e_tests/test_scripts/test_common.py::TestParseVars::test_parse_vars_bad\nPASSED r2e_tests/test_scripts/test_common.py::TestParseVars::test_parse_vars_good\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_absolute_path\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_multiple_rendered\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_single_rendered\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_with_path_as_project_target_rendered\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_no_project_name\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_run_no_scaffold_name\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_run_show_scaffolds_exist\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_run_show_scaffolds_none_exist\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_dev_pyramid_long_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_dev_pyramid_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_prod_pyramid_long_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_prod_pyramid_unparsable_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_prod_pyramid_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_unknown_scaffold_name\nPASSED r2e_tests/test_scripts/test_pcreate.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pdistreport.py::TestPDistReportCommand::test_no_dists\nPASSED r2e_tests/test_scripts/test_pdistreport.py::TestPDistReportCommand::test_with_dists\nPASSED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_bad_config_header\nPASSED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_not_enough_args\nPASSED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_response_has_no_charset\nPASSED r2e_tests/test_scripts/test_prequest.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test__get_mapper\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_bad_args\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_good_args\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_no_mapper\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_no_routes\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_route_with_no_slash_prefix\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_no_route_registered\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_no_views_registered\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_one_view_registered\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_one_view_registered_with_factory\nPASSED r2e_tests/test_scripts/test_proutes.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_get_options_no_command\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_get_options_with_command\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_parse_vars_bad\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_parse_vars_good\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_record_pid_not_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_record_pid_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_current_pid_is_not_pid_in_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_current_pid_is_not_written_pid\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_not_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_stale_pid_write_exception\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_unlink_exception\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_no_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_not_a_number\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_no_args\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_stop_daemon_bad_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_stop_daemon_invalid_pid_in_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_stop_daemon_no_such_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_read_pidfile::test_read_pidfile\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_read_pidfile::test_read_pidfile_no_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_read_pidfile::test_read_pidfile_not_a_number\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_flush\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_open\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_write\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_writeline\nPASSED r2e_tests/test_scripts/test_pserve.py::Test__methodwrapper::test___call__fail\nPASSED r2e_tests/test_scripts/test_pserve.py::Test__methodwrapper::test___call__succeed\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_custom_section_override\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_bpython_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_check_variable_override_order\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_custom_items\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_default_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_default_shell_with_unknown_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_ipython_v0_10\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_ipython_v0_11\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_ipython_v1_1\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_setup_from_options\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_setup\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_bpython_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_default_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_ipython_v0_10_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_ipython_v0_11_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_ipython_v1_1_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_shell_ipython_ordering\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_shell_ordering\nPASSED r2e_tests/test_scripts/test_pshell.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test__get_tweens\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test_command_implicit_and_explicit_tweens\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test_command_implicit_tweens_only\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test_command_no_tweens\nPASSED r2e_tests/test_scripts/test_ptweens.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_multi_routes_all_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_multi_routes_none_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_multi_routes_some_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_no_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_no_match_multiview_registered\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_route_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_route_multiview_no_view_registered\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_route_no_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_traversal\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_traversal_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multi_view_nested\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multiview_with_permission\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multiview_with_predicates\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_not_found\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_not_found_url_starts_without_slash\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_route\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_route_with_route_predicates\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_traversal\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_traversal_with_permission\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_traversal_with_predicates\nPASSED r2e_tests/test_scripts/test_pviews.py::Test_main::test_it\nFAILED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_adapter_dotted_names\nFAILED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_adapter_introspectables\nFAILED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_dotted_names\nFAILED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_filename_no_overrides\nFAILED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_filename_override_returns_None\nFAILED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_filename\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_abspath\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_asset_spec\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_asset_spec_existing_translation_dirs\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_multiple_specs\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_multiple_specs_multiple_calls\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_no_registry\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_noreg_debug_logger_None_default\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_conflict\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_debug_logger_None_default\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_add_directive_with_custom_callable\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_add_directive_with_partial\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_with_dotted_name\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_with_python_callable\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator__add_predicate::test_factory_as_dotted_name\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_package_here_relative\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_custom_predicate_bests_standard_predicate\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_custom_predicates_match\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_custom_predicates_nomatch\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_template_renderer\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_template_renderer_no_callable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_non_adaptable_dict\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_instance_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_default_method_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_nondefault_method_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::Test_view_description::test_without_text\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_display_headers\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_content_type_header_var\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_good_header_var\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_multiple_header_vars\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_get\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_options\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_patch\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_post\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_propfind\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_put\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_path_doesnt_start_with_slash\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_two_args\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_w_basic_auth\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_with_query_string\nFAILED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_function_traversal\n======================== 47 failed, 836 passed in 5.24s ========================\n",
    "new_commit_res_stderr": "",
    "old_commit_res_code": 1,
    "old_commit_res_stdout": "============================= test session starts ==============================\nplatform linux -- Python 3.8.20, pytest-8.3.4, pluggy-1.5.0\nrootdir: /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3\ncollected 883 items\n\nr2e_tests/test_1.py ..........F...............                           [  2%]\nr2e_tests/test_config/test_adapters.py .FF..............F...             [  5%]\nr2e_tests/test_config/test_assets.py ...........FF...................... [  9%]\n.....F..........................                                         [ 12%]\nr2e_tests/test_config/test_factories.py ..................               [ 14%]\nr2e_tests/test_config/test_i18n.py FFF.FF...                             [ 15%]\nr2e_tests/test_config/test_init.py ..................................... [ 20%]\n.F..F....................F...........F....................FF...FFF...... [ 28%]\n..............                                                           [ 29%]\nr2e_tests/test_config/test_predicates.py ............................... [ 33%]\n........................................                                 [ 37%]\nr2e_tests/test_config/test_rendering.py ...                              [ 38%]\nr2e_tests/test_config/test_routes.py ..........F...............          [ 41%]\nr2e_tests/test_config/test_security.py ..........                        [ 42%]\nr2e_tests/test_config/test_settings.py .......................           [ 44%]\nr2e_tests/test_config/test_testing.py ............                       [ 46%]\nr2e_tests/test_config/test_tweens.py .................................   [ 50%]\nr2e_tests/test_config/test_util.py ..................................... [ 54%]\n.............                                                            [ 55%]\nr2e_tests/test_config/test_views.py .....................F............F. [ 59%]\n..................................FF.................................... [ 67%]\n..FF.................................................................... [ 76%]\n.....FF.........F...F....F.............................................. [ 84%]\n..............F                                                          [ 85%]\nr2e_tests/test_scripts/test_common.py ...                                [ 86%]\nr2e_tests/test_scripts/test_pcreate.py ...............                   [ 87%]\nr2e_tests/test_scripts/test_pdistreport.py ..                            [ 88%]\nr2e_tests/test_scripts/test_prequest.py F.FFFFFFFFF.F.FFF.               [ 90%]\nr2e_tests/test_scripts/test_proutes.py ...........                       [ 91%]\nr2e_tests/test_scripts/test_pserve.py ............................       [ 94%]\nr2e_tests/test_scripts/test_pshell.py ...................                [ 96%]\nr2e_tests/test_scripts/test_ptweens.py .....                             [ 97%]\nr2e_tests/test_scripts/test_pviews.py ................F......            [100%]\n\n=================================== FAILURES ===================================\n_ RoutesConfiguratorMixinTests.test_add_route_with_empty_string_with_route_prefix _\n\nself = <r2e_tests.test_1.RoutesConfiguratorMixinTests testMethod=test_add_route_with_empty_string_with_route_prefix>\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n>       self._assertRoute(config, 'name', 'root')\n\nr2e_tests/test_1.py:57: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_1.py:20: in _assertRoute\n    self.assertEqual(route.path, path)\nE   AssertionError: 'root/' != 'root'\nE   - root/\nE   ?     -\nE   + root\n__ AdaptersConfiguratorMixinTests.test_add_resource_url_adapter_dotted_names ___\n\nself = <r2e_tests.test_config.test_adapters.AdaptersConfiguratorMixinTests testMethod=test_add_resource_url_adapter_dotted_names>\n\n    def test_add_resource_url_adapter_dotted_names(self):\n        from pyramid.interfaces import IResourceURL\n        config = self._makeOne(autocommit=True)\n        config.add_resource_url_adapter(\n            'pyramid.tests.test_config.test_adapters.DummyResourceURL',\n            'pyramid.tests.test_config.test_adapters.DummyIface',\n            )\n        iface = DummyIface()\n>       adapter = config.registry.getMultiAdapter((iface, iface),\n                                                    IResourceURL)\n\nr2e_tests/test_config/test_adapters.py:280: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Registry r2e_tests.test_config>\nobjects = (<r2e_tests.test_config.test_adapters.DummyIface object at 0x7ad5a40b3430>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x7ad5a40b3430>)\ninterface = <InterfaceClass pyramid.interfaces.IResourceURL>, name = ''\n\n    def getMultiAdapter(self, objects, interface, name=''):\n        adapter = self.adapters.queryMultiAdapter(objects, interface, name)\n        if adapter is None:\n>           raise ComponentLookupError(objects, interface, name)\nE           zope.interface.interfaces.ComponentLookupError: ((<r2e_tests.test_config.test_adapters.DummyIface object at 0x7ad5a40b3430>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x7ad5a40b3430>), <InterfaceClass pyramid.interfaces.IResourceURL>, '')\n\n.venv/lib/python3.8/site-packages/zope/interface/registry.py:379: ComponentLookupError\n_ AdaptersConfiguratorMixinTests.test_add_resource_url_adapter_introspectables _\n\nself = <r2e_tests.test_config.test_adapters.AdaptersConfiguratorMixinTests testMethod=test_add_resource_url_adapter_introspectables>\n\n    def test_add_resource_url_adapter_introspectables(self):\n        config = self._makeOne()\n        config.add_resource_url_adapter(DummyResourceURL, DummyIface)\n        actions = config.action_state.actions\n        self.assertEqual(len(actions), 1)\n        intrs  = actions[0]['introspectables']\n        self.assertEqual(len(intrs), 1)\n        intr = intrs[0]\n        self.assertEqual(intr.type_name, 'resource url adapter')\n        self.assertEqual(intr.discriminator,\n                         ('resource url adapter', DummyIface))\n        self.assertEqual(intr.category_name, 'resource url adapters')\n>       self.assertEqual(\n            intr.title,\n            \"resource url adapter for resource iface \"\n            \"<class 'pyramid.tests.test_config.test_adapters.DummyIface'>\"\n            )\nE       AssertionError: \"reso[34 chars]e <class 'r2e_tests.test_config.test_adapters.DummyIface'>\" != \"reso[34 chars]e <class 'pyramid.tests.test_config.test_adapters.DummyIface'>\"\nE       - resource url adapter for resource iface <class 'r2e_tests.test_config.test_adapters.DummyIface'>\nE       ?                                                  ^^^\nE       + resource url adapter for resource iface <class 'pyramid.tests.test_config.test_adapters.DummyIface'>\nE       ?                                                 ++ ^^^^^\n\nr2e_tests/test_config/test_adapters.py:326: AssertionError\n________ AdaptersConfiguratorMixinTests.test_add_traverser_dotted_names ________\n\nself = <r2e_tests.test_config.test_adapters.AdaptersConfiguratorMixinTests testMethod=test_add_traverser_dotted_names>\n\n    def test_add_traverser_dotted_names(self):\n        from pyramid.interfaces import ITraverser\n        config = self._makeOne(autocommit=True)\n        config.add_traverser(\n            'pyramid.tests.test_config.test_adapters.DummyTraverser',\n            'pyramid.tests.test_config.test_adapters.DummyIface')\n        iface = DummyIface()\n>       traverser = config.registry.getAdapter(iface, ITraverser)\n\nr2e_tests/test_config/test_adapters.py:237: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <Registry r2e_tests.test_config>\nobject = <r2e_tests.test_config.test_adapters.DummyIface object at 0x7ad5a4083550>\ninterface = <InterfaceClass pyramid.interfaces.ITraverser>, name = ''\n\n    def getAdapter(self, object, interface, name=''):\n        adapter = self.adapters.queryAdapter(object, interface, name)\n        if adapter is None:\n>           raise ComponentLookupError(object, interface, name)\nE           zope.interface.interfaces.ComponentLookupError: (<r2e_tests.test_config.test_adapters.DummyIface object at 0x7ad5a4083550>, <InterfaceClass pyramid.interfaces.ITraverser>, '')\n\n.venv/lib/python3.8/site-packages/zope/interface/registry.py:368: ComponentLookupError\n_________ TestOverrideProvider.test_get_resource_filename_no_overrides _________\n\nself = <r2e_tests.test_config.test_assets.TestOverrideProvider testMethod=test_get_resource_filename_no_overrides>\n\n    def test_get_resource_filename_no_overrides(self):\n        import os\n        resource_name = 'test_assets.py'\n        import pyramid.tests.test_config\n        provider = self._makeOne(pyramid.tests.test_config)\n        here = os.path.dirname(os.path.abspath(__file__))\n        expected = os.path.join(here, resource_name)\n        result = provider.get_resource_filename(None, resource_name)\n>       self.assertEqual(result, expected)\nE       AssertionError: '/hom[73 chars]0da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]0da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py\nE       ?                                                                                                     ^^^\n\nr2e_tests/test_config/test_assets.py:158: AssertionError\n____ TestOverrideProvider.test_get_resource_filename_override_returns_None _____\n\nself = <r2e_tests.test_config.test_assets.TestOverrideProvider testMethod=test_get_resource_filename_override_returns_None>\n\n    def test_get_resource_filename_override_returns_None(self):\n        overrides = DummyOverrides(None)\n        self._registerOverrides(overrides)\n        import os\n        resource_name = 'test_assets.py'\n        import pyramid.tests.test_config\n        provider = self._makeOne(pyramid.tests.test_config)\n        here = os.path.dirname(os.path.abspath(__file__))\n        expected = os.path.join(here, resource_name)\n        result = provider.get_resource_filename(None, resource_name)\n>       self.assertEqual(result, expected)\nE       AssertionError: '/hom[73 chars]0da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]0da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py\nE       ?                                                                                                     ^^^\n\nr2e_tests/test_config/test_assets.py:212: AssertionError\n____________________ TestPackageOverrides.test_get_filename ____________________\n\nself = <r2e_tests.test_config.test_assets.TestPackageOverrides testMethod=test_get_filename>\n\n    def test_get_filename(self):\n        import os\n        overrides = [ DummyOverride(None), DummyOverride(\n            ('pyramid.tests.test_config', 'test_assets.py'))]\n        package = DummyPackage('package')\n        po = self._makeOne(package)\n        po.overrides= overrides\n        here = os.path.dirname(os.path.abspath(__file__))\n        expected = os.path.join(here, 'test_assets.py')\n>       self.assertEqual(po.get_filename('whatever'), expected)\nE       AssertionError: '/hom[73 chars]0da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]0da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/test_config/test_assets.py\nE       ?                                                                                                     ^^^\n\nr2e_tests/test_config/test_assets.py:425: AssertionError\n_________ TestI18NConfiguratorMixin.test_add_translation_dirs_abspath __________\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_abspath>\n\n    def test_add_translation_dirs_abspath(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n>       config.add_translation_dirs(locale)\n\nr2e_tests/test_config/test_i18n.py:86: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/util.py:528: in wrapper\n    result = wrapped(self, *arg, **kw)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <pyramid.config.Configurator object at 0x7ad5a40d8760>\nspecs = ('/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale',)\nintrospectables = []\nspec = '/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\npackage_name = None\n\n    @action_method\n    def add_translation_dirs(self, *specs):\n        \"\"\" Add one or more :term:`translation directory` paths to the\n        current configuration state.  The ``specs`` argument is a\n        sequence that may contain absolute directory paths\n        (e.g. ``/usr/share/locale``) or :term:`asset specification`\n        names naming a directory path (e.g. ``some.package:locale``)\n        or a combination of the two.\n    \n        Example:\n    \n        .. code-block:: python\n    \n           config.add_translation_dirs('/usr/share/locale',\n                                       'some.package:locale')\n    \n        Later calls to ``add_translation_dir`` insert directories into the\n        beginning of the list of translation directories created by earlier\n        calls.  This means that the same translation found in a directory\n        added later in the configuration process will be found before one\n        added earlier in the configuration process.  However, if multiple\n        specs are provided in a single call to ``add_translation_dirs``, the\n        directories will be inserted into the beginning of the directory list\n        in the order they're provided in the ``*specs`` list argument (items\n        earlier in the list trump ones later in the list).\n        \"\"\"\n        directories = []\n        introspectables = []\n    \n        for spec in specs[::-1]: # reversed\n            package_name, filename = self._split_spec(spec)\n            if package_name is None: # absolute filename\n                directory = filename\n            else:\n                __import__(package_name)\n                package = sys.modules[package_name]\n                directory = os.path.join(package_path(package), filename)\n    \n            if not os.path.isdir(os.path.realpath(directory)):\n>               raise ConfigurationError('\"%s\" is not a directory' %\n                                         directory)\nE               pyramid.exceptions.ConfigurationError: \"/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale\" is not a directory\n\npyramid/config/i18n.py:86: ConfigurationError\n________ TestI18NConfiguratorMixin.test_add_translation_dirs_asset_spec ________\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_asset_spec>\n\n    def test_add_translation_dirs_asset_spec(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')\n>       self.assertEqual(config.registry.getUtility(ITranslationDirectories),\n                         [locale])\nE       AssertionError: Lists differ: ['/ho[70 chars]82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'] != ['/ho[70 chars]82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale']\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale']\nE       ?                                                                                                       ^^^\n\nr2e_tests/test_config/test_i18n.py:54: AssertionError\n_ TestI18NConfiguratorMixin.test_add_translation_dirs_asset_spec_existing_translation_dirs _\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_asset_spec_existing_translation_dirs>\n\n    def test_add_translation_dirs_asset_spec_existing_translation_dirs(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        directories = ['abc']\n        config.registry.registerUtility(directories, ITranslationDirectories)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')\n        result = config.registry.getUtility(ITranslationDirectories)\n>       self.assertEqual(result, [locale, 'abc'])\nE       AssertionError: Lists differ: ['/ho[77 chars]74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale', 'abc'] != ['/ho[77 chars]74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale', 'abc']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale',\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale',\nE       ?                                                                                                       ^^^\nE       \nE          'abc']\n\nr2e_tests/test_config/test_i18n.py:64: AssertionError\n______ TestI18NConfiguratorMixin.test_add_translation_dirs_multiple_specs ______\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_multiple_specs>\n\n    def test_add_translation_dirs_multiple_specs(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',\n                                    'pyramid.tests.pkgs.localeapp:locale2')\n>       self.assertEqual(config.registry.getUtility(ITranslationDirectories),\n                         [locale, locale2])\nE       AssertionError: Lists differ: ['/ho[91 chars]33b3/pyramid/tests/pkgs/localeapp/locale', '/h[130 chars]le2'] != ['/ho[91 chars]33b3/r2e_tests/pkgs/localeapp/locale', '/home/[122 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]e82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale'\nE       \nE       Diff is 1002 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_i18n.py:71: AssertionError\n_ TestI18NConfiguratorMixin.test_add_translation_dirs_multiple_specs_multiple_calls _\n\nself = <r2e_tests.test_config.test_i18n.TestI18NConfiguratorMixin testMethod=test_add_translation_dirs_multiple_specs_multiple_calls>\n\n    def test_add_translation_dirs_multiple_specs_multiple_calls(self):\n        from pyramid.interfaces import ITranslationDirectories\n        config = self._makeOne(autocommit=True)\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',\n                                    'pyramid.tests.pkgs.localeapp:locale2')\n        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale3')\n>       self.assertEqual(config.registry.getUtility(ITranslationDirectories),\n                         [locale3, locale, locale2])\nE       AssertionError: Lists differ: ['/ho[91 chars]33b3/pyramid/tests/pkgs/localeapp/locale3', '/[269 chars]le2'] != ['/ho[91 chars]33b3/r2e_tests/pkgs/localeapp/locale3', '/home[257 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[69 chars]82530da74f1c0fd21ab9033b3/pyramid/tests/pkgs/localeapp/locale3'\nE       '/hom[69 chars]82530da74f1c0fd21ab9033b3/r2e_tests/pkgs/localeapp/locale3'\nE       \nE       Diff is 1504 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_i18n.py:80: AssertionError\n___________________ ConfiguratorTests.test_ctor_no_registry ____________________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_ctor_no_registry>\n\n    def test_ctor_no_registry(self):\n        import sys\n        from pyramid.interfaces import ISettings\n        from pyramid.config import Configurator\n        from pyramid.interfaces import IRendererFactory\n        config = Configurator()\n        this_pkg = sys.modules['pyramid.tests.test_config']\n        self.assertTrue(config.registry.getUtility(ISettings))\n>       self.assertEqual(config.package, this_pkg)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:67: AssertionError\n_________ ConfiguratorTests.test_ctor_noreg_debug_logger_None_default __________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_ctor_noreg_debug_logger_None_default>\n\n    def test_ctor_noreg_debug_logger_None_default(self):\n        from pyramid.interfaces import IDebugLogger\n        config = self._makeOne()\n        logger = config.registry.getUtility(IDebugLogger)\n>       self.assertEqual(logger.name, 'pyramid.tests.test_config')\nE       AssertionError: 'r2e_tests.test_config' != 'pyramid.tests.test_config'\nE       - r2e_tests.test_config\nE       ?  ^^^\nE       + pyramid.tests.test_config\nE       ? ++ ^^^^^\n\nr2e_tests/test_config/test_init.py:123: AssertionError\n_______________ ConfiguratorTests.test_scan_integration_conflict _______________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_scan_integration_conflict>\n\n    def test_scan_integration_conflict(self):\n        from pyramid.tests.test_config.pkgs import selfscan\n        from pyramid.config import Configurator\n        c = Configurator()\n        c.scan(selfscan)\n        c.scan(selfscan)\n        try:\n>           c.commit()\n\nr2e_tests/test_config/test_init.py:999: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:610: in commit\n    self.action_state.execute_actions(introspector=self.introspector)\npyramid/config/__init__.py:1048: in execute_actions\n    for action in resolveConflicts(self.actions):\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nactions = []\n\n    def resolveConflicts(actions):\n        \"\"\"Resolve conflicting actions\n    \n        Given an actions list, identify and try to resolve conflicting actions.\n        Actions conflict if they have the same non-None discriminator.\n        Conflicting actions can be resolved if the include path of one of\n        the actions is a prefix of the includepaths of the other\n        conflicting actions and is unequal to the include paths in the\n        other conflicting actions.\n        \"\"\"\n    \n        def orderandpos(v):\n            n, v = v\n            if not isinstance(v, dict):\n                # old-style tuple action\n                v = expand_action(*v)\n            return (v['order'] or 0, n)\n    \n        sactions = sorted(enumerate(actions), key=orderandpos)\n    \n        def orderonly(v):\n            n, v = v\n            if not isinstance(v, dict):\n                # old-style tuple action\n                v = expand_action(*v)\n            return v['order'] or 0\n    \n        for order, actiongroup in itertools.groupby(sactions, orderonly):\n            # \"order\" is an integer grouping. Actions in a lower order will be\n            # executed before actions in a higher order.  All of the actions in\n            # one grouping will be executed (its callable, if any will be called)\n            # before any of the actions in the next.\n    \n            unique = {}\n            output = []\n    \n            for i, action in actiongroup:\n                # Within an order, actions are executed sequentially based on\n                # original action ordering (\"i\").\n    \n                if not isinstance(action, dict):\n                    # old-style tuple action\n                    action = expand_action(*action)\n    \n                # \"ainfo\" is a tuple of (order, i, action) where \"order\" is a\n                # user-supplied grouping, \"i\" is an integer expressing the relative\n                # position of this action in the action list being resolved, and\n                # \"action\" is an action dictionary.  The purpose of an ainfo is to\n                # associate an \"order\" and an \"i\" with a particular action; \"order\"\n                # and \"i\" exist for sorting purposes after conflict resolution.\n                ainfo = (order, i, action)\n    \n                discriminator = undefer(action['discriminator'])\n                action['discriminator'] = discriminator\n    \n                if discriminator is None:\n                    # The discriminator is None, so this action can never conflict.\n                    # We can add it directly to the result.\n                    output.append(ainfo)\n                    continue\n    \n                L = unique.setdefault(discriminator, [])\n                L.append(ainfo)\n    \n            # Check for conflicts\n            conflicts = {}\n    \n            for discriminator, ainfos in unique.items():\n                # We use (includepath, order, i) as a sort key because we need to\n                # sort the actions by the paths so that the shortest path with a\n                # given prefix comes first.  The \"first\" action is the one with the\n                # shortest include path.  We break sorting ties using \"order\", then\n                # \"i\".\n                def bypath(ainfo):\n                    path, order, i = ainfo[2]['includepath'], ainfo[0], ainfo[1]\n                    return path, order, i\n    \n                ainfos.sort(key=bypath)\n                ainfo, rest = ainfos[0], ainfos[1:]\n                output.append(ainfo)\n                _, _, action = ainfo\n                basepath, baseinfo, discriminator = (\n                    action['includepath'],\n                    action['info'],\n                    action['discriminator'],\n                    )\n    \n                for _, _, action in rest:\n                    includepath = action['includepath']\n                    # Test whether path is a prefix of opath\n                    if (includepath[:len(basepath)] != basepath # not a prefix\n                        or includepath == basepath):\n                        L = conflicts.setdefault(discriminator, [baseinfo])\n                        L.append(action['info'])\n    \n            if conflicts:\n>               raise ConfigurationConflictError(conflicts)\nE               pyramid.exceptions.ConfigurationConflictError: Conflicting configuration actions\nE                 For: ('view', None, '', None, 'd41d8cd98f00b204e9800998ecf8427e')\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/__init__.py:\nE                       def abc(request):\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/__init__.py:\nE                       def abc(request):\nE                 For: ('view', None, 'two', None, 'd41d8cd98f00b204e9800998ecf8427e')\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/another.py:\nE                       def two(request):\nE                   Line 4 of file /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_855fe374108779e82530da74f1c0fd21ab9033b3/pyramid/tests/test_config/pkgs/selfscan/another.py:\nE                       def two(request):\n\npyramid/config/__init__.py:1176: ConfigurationConflictError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_scan_integration_conflict>\n\n    def test_scan_integration_conflict(self):\n        from pyramid.tests.test_config.pkgs import selfscan\n        from pyramid.config import Configurator\n        c = Configurator()\n        c.scan(selfscan)\n        c.scan(selfscan)\n        try:\n            c.commit()\n        except ConfigurationConflictError as why:\n            def scanconflicts(e):\n                conflicts = e._conflicts.values()\n                for conflict in conflicts:\n                    for confinst in conflict:\n                        yield confinst.src\n            which = list(scanconflicts(why))\n            self.assertEqual(len(which), 4)\n>           self.assertTrue(\"@view_config(renderer='string')\" in which)\nE           AssertionError: False is not true\n\nr2e_tests/test_config/test_init.py:1008: AssertionError\n_______ ConfiguratorTests.test_setup_registry_debug_logger_None_default ________\n\nself = <r2e_tests.test_config.test_init.ConfiguratorTests testMethod=test_setup_registry_debug_logger_None_default>\n\n    def test_setup_registry_debug_logger_None_default(self):\n        from pyramid.registry import Registry\n        from pyramid.interfaces import IDebugLogger\n        reg = Registry()\n        config = self._makeOne(reg)\n        config.setup_registry()\n        logger = reg.getUtility(IDebugLogger)\n>       self.assertEqual(logger.name, 'pyramid.tests.test_config')\nE       AssertionError: 'r2e_tests.test_config' != 'pyramid.tests.test_config'\nE       - r2e_tests.test_config\nE       ?  ^^^\nE       + pyramid.tests.test_config\nE       ? ++ ^^^^^\n\nr2e_tests/test_config/test_init.py:428: AssertionError\n____ TestConfigurator_add_directive.test_add_directive_with_custom_callable ____\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_add_directive_with_custom_callable>\n\n    def test_add_directive_with_custom_callable(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n                'dummy_callable', 'pyramid.tests.test_config.dummy_callable')\n        self.assertTrue(hasattr(config, 'dummy_callable'))\n        config.dummy_callable('discrim')\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'discrim')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1207: AssertionError\n________ TestConfigurator_add_directive.test_add_directive_with_partial ________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_add_directive_with_partial>\n\n    def test_add_directive_with_partial(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n                'dummy_partial', 'pyramid.tests.test_config.dummy_partial')\n        self.assertTrue(hasattr(config, 'dummy_partial'))\n        config.dummy_partial()\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'partial')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1194: AssertionError\n_________ TestConfigurator_add_directive.test_extend_with_dotted_name __________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_extend_with_dotted_name>\n\n    def test_extend_with_dotted_name(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n            'dummy_extend', 'pyramid.tests.test_config.dummy_extend')\n        self.assertTrue(hasattr(config, 'dummy_extend'))\n        config.dummy_extend('discrim')\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'discrim')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1181: AssertionError\n_______ TestConfigurator_add_directive.test_extend_with_python_callable ________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator_add_directive testMethod=test_extend_with_python_callable>\n\n    def test_extend_with_python_callable(self):\n        from pyramid.tests import test_config\n        config = self.config\n        config.add_directive(\n            'dummy_extend', dummy_extend)\n        self.assertTrue(hasattr(config, 'dummy_extend'))\n        config.dummy_extend('discrim')\n        after = config.action_state\n        action = after.actions[-1]\n        self.assertEqual(action['discriminator'], 'discrim')\n        self.assertEqual(action['callable'], None)\n>       self.assertEqual(action['args'], test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_init.py:1220: AssertionError\n_________ TestConfigurator__add_predicate.test_factory_as_dotted_name __________\n\nself = <r2e_tests.test_config.test_init.TestConfigurator__add_predicate testMethod=test_factory_as_dotted_name>\n\n    def test_factory_as_dotted_name(self):\n        config = self._makeOne()\n    \n        def _fakeAction(discriminator, callable=None, args=(),\n                        kw=None, order=0, introspectables=(), **extra):\n            self.assertEqual(len(introspectables), 1)\n            self.assertEqual(introspectables[0]['name'], 'testing')\n            self.assertEqual(introspectables[0]['factory'], DummyPredicate)\n    \n        config.action = _fakeAction\n>       config._add_predicate(\n            'route',\n            'testing',\n            'pyramid.tests.test_config.test_init.DummyPredicate'\n            )\n\nr2e_tests/test_config/test_init.py:1284: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:499: in _add_predicate\n    self.action(discriminator, register, introspectables=(intr,),\nr2e_tests/test_config/test_init.py:1281: in _fakeAction\n    self.assertEqual(introspectables[0]['factory'], DummyPredicate)\nE   AssertionError: <class 'pyramid.tests.test_config.test_init.DummyPredicate'> != <class 'r2e_tests.test_config.test_init.DummyPredicate'>\n_ RoutesConfiguratorMixinTests.test_add_route_with_empty_string_with_route_prefix _\n\nself = <r2e_tests.test_config.test_routes.RoutesConfiguratorMixinTests testMethod=test_add_route_with_empty_string_with_route_prefix>\n\n    def test_add_route_with_empty_string_with_route_prefix(self):\n        config = self._makeOne(autocommit=True)\n        config.route_prefix = 'root'\n        config.add_route('name', '')\n>       self._assertRoute(config, 'name', 'root')\n\nr2e_tests/test_config/test_routes.py:57: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_config/test_routes.py:20: in _assertRoute\n    self.assertEqual(route.path, path)\nE   AssertionError: 'root/' != 'root'\nE   - root/\nE   ?     -\nE   + root\n____ TestViewsConfigurationMixin.test_add_static_view_package_here_relative ____\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_static_view_package_here_relative>\n\n    def test_add_static_view_package_here_relative(self):\n        from pyramid.interfaces import IStaticURLInfo\n        info = DummyStaticURLInfo()\n        config = self._makeOne(autocommit=True)\n        config.registry.registerUtility(info, IStaticURLInfo)\n        config.add_static_view('static', 'files')\n>       self.assertEqual(\n            info.added,\n            [(config, 'static', 'pyramid.tests.test_config:files', {})])\nE       AssertionError: Lists differ: [(<py[39 chars]ad5a420d820>, 'static', 'r2e_tests.test_config:files', {})] != [(<py[39 chars]ad5a420d820>, 'static', 'pyramid.tests.test_config:files', {})]\nE       \nE       First differing element 0:\nE       (<pyr[37 chars]7ad5a420d820>, 'static', 'r2e_tests.test_config:files', {})\nE       (<pyr[37 chars]7ad5a420d820>, 'static', 'pyramid.tests.test_config:files', {})\nE       \nE         [(<pyramid.config.Configurator object at 0x7ad5a420d820>,\nE           'static',\nE       -   'r2e_tests.test_config:files',\nE       ?     ^^^\nE       \nE       +   'pyramid.tests.test_config:files',\nE       ?    ++ ^^^^^\nE       \nE           {})]\n\nr2e_tests/test_config/test_views.py:1755: AssertionError\n_ TestViewsConfigurationMixin.test_add_view_custom_predicate_bests_standard_predicate _\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_custom_predicate_bests_standard_predicate>\n\n    def test_add_view_custom_predicate_bests_standard_predicate(self):\n        import warnings\n        from pyramid.renderers import null_renderer\n        view = lambda *arg: 'OK'\n        view2 = lambda *arg: 'NOT OK'\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request):\n            return True\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_view(view=view, custom_predicates=(pred1,),\n                        renderer=null_renderer)\n            config.add_view(view=view2, request_method='GET',\n                            renderer=null_renderer)\n>           self.assertEqual(len(w), 1)\nE           AssertionError: 3 != 1\n\nr2e_tests/test_config/test_views.py:1471: AssertionError\n____ TestViewsConfigurationMixin.test_add_view_with_custom_predicates_match ____\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_custom_predicates_match>\n\n    def test_add_view_with_custom_predicates_match(self):\n        import warnings\n        from pyramid.renderers import null_renderer\n        view = lambda *arg: 'OK'\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request):\n            return True\n        def pred2(context, request):\n            return True\n        predicates = (pred1, pred2)\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_view(view=view, custom_predicates=predicates,\n                            renderer=null_renderer)\n>           self.assertEqual(len(w), 1)\nE           AssertionError: 2 != 1\n\nr2e_tests/test_config/test_views.py:1435: AssertionError\n___ TestViewsConfigurationMixin.test_add_view_with_custom_predicates_nomatch ___\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_custom_predicates_nomatch>\n\n    def test_add_view_with_custom_predicates_nomatch(self):\n        import warnings\n        view = lambda *arg: 'OK'\n        config = self._makeOne(autocommit=True)\n        def pred1(context, request):\n            return True\n        def pred2(context, request):\n            return False\n        predicates = (pred1, pred2)\n        with warnings.catch_warnings(record=True) as w:\n            warnings.filterwarnings('always')\n            config.add_view(view=view, custom_predicates=predicates)\n>           self.assertEqual(len(w), 1)\nE           AssertionError: 2 != 1\n\nr2e_tests/test_config/test_views.py:1452: AssertionError\n_______ TestViewsConfigurationMixin.test_add_view_with_template_renderer _______\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_template_renderer>\n\n    def test_add_view_with_template_renderer(self):\n        from pyramid.tests import test_config\n        from pyramid.interfaces import ISettings\n        class view(object):\n            def __init__(self, context, request):\n                self.request = request\n                self.context = context\n    \n            def __call__(self):\n                return {'a':'1'}\n        config = self._makeOne(autocommit=True)\n        renderer = self._registerRenderer(config)\n        fixture = 'pyramid.tests.test_config:files/minimal.txt'\n        config.introspection = False\n        config.add_view(view=view, renderer=fixture)\n        wrapper = self._getViewCallable(config)\n        request = self._makeRequest(config)\n        result = wrapper(None, request)\n        self.assertEqual(result.body, b'Hello!')\n        settings = config.registry.queryUtility(ISettings)\n        result = renderer.info\n        self.assertEqual(result.registry, config.registry)\n        self.assertEqual(result.type, '.txt')\n>       self.assertEqual(result.package, test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_views.py:1070: AssertionError\n_ TestViewsConfigurationMixin.test_add_view_with_template_renderer_no_callable _\n\nself = <r2e_tests.test_config.test_views.TestViewsConfigurationMixin testMethod=test_add_view_with_template_renderer_no_callable>\n\n    def test_add_view_with_template_renderer_no_callable(self):\n        from pyramid.tests import test_config\n        from pyramid.interfaces import ISettings\n        config = self._makeOne(autocommit=True)\n        renderer = self._registerRenderer(config)\n        fixture = 'pyramid.tests.test_config:files/minimal.txt'\n        config.introspection = False\n        config.add_view(view=None, renderer=fixture)\n        wrapper = self._getViewCallable(config)\n        request = self._makeRequest(config)\n        result = wrapper(None, request)\n        self.assertEqual(result.body, b'Hello!')\n        settings = config.registry.queryUtility(ISettings)\n        result = renderer.info\n        self.assertEqual(result.registry, config.registry)\n        self.assertEqual(result.type, '.txt')\n>       self.assertEqual(result.package, test_config)\nE       AssertionError: <module 'r2e_tests.test_config' from '/home/gcpuse[117 chars].py'> != <module 'pyramid.tests.test_config' from '/home/gc[125 chars].py'>\n\nr2e_tests/test_config/test_views.py:1111: AssertionError\n_____________ TestViewDeriver.test_function_returns_non_adaptable ______________\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable>\n\n    def test_function_returns_non_adaptable(self):\n        def view(request):\n            return None\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n>           result(None, None)\n\nr2e_tests/test_config/test_views.py:2366: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None, request = None\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable function r2e_tests.test_config.test_views.view into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable>\n\n    def test_function_returns_non_adaptable(self):\n        def view(request):\n            return None\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n            result(None, None)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                'Could not convert return value of the view callable function '\n                'pyramid.tests.test_config.test_views.view into a response '\n                'object. The value returned was None. You may have forgotten '\n                'to return a value from the view callable.'\n                )\nE           AssertionError: 'Coul[52 chars]tion r2e_tests.test_config.test_views.view int[110 chars]ble.' != 'Coul[52 chars]tion pyramid.tests.test_config.test_views.view[114 chars]ble.'\nE           Diff is 663 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2368: AssertionError\n___________ TestViewDeriver.test_function_returns_non_adaptable_dict ___________\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable_dict>\n\n    def test_function_returns_non_adaptable_dict(self):\n        def view(request):\n            return {'a':1}\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n>           result(None, None)\n\nr2e_tests/test_config/test_views.py:2385: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None, request = None\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable function r2e_tests.test_config.test_views.view into a response object. The value returned was {'a': 1}. You may have forgotten to define a renderer in the view configuration.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_function_returns_non_adaptable_dict>\n\n    def test_function_returns_non_adaptable_dict(self):\n        def view(request):\n            return {'a':1}\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n            result(None, None)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                \"Could not convert return value of the view callable function \"\n                \"pyramid.tests.test_config.test_views.view into a response \"\n                \"object. The value returned was {'a': 1}. You may have \"\n                \"forgotten to define a renderer in the view configuration.\"\n                )\nE           AssertionError: \"Coul[52 chars]tion r2e_tests.test_config.test_views.view int[120 chars]ion.\" != \"Coul[52 chars]tion pyramid.tests.test_config.test_views.view[124 chars]ion.\"\nE           Diff is 683 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2387: AssertionError\n_____________ TestViewDeriver.test_instance_returns_non_adaptable ______________\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_instance_returns_non_adaptable>\n\n    def test_instance_returns_non_adaptable(self):\n        class AView(object):\n            def __call__(self, request):\n                return None\n        view = AView()\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n>           result(None, None)\n\nr2e_tests/test_config/test_views.py:2406: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None, request = None\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable object <r2e_tests.test_config.test_views.TestViewDeriver.test_instance_returns_non_adaptable.<locals>.AView object at 0x7ad5a423b8b0> into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_instance_returns_non_adaptable>\n\n    def test_instance_returns_non_adaptable(self):\n        class AView(object):\n            def __call__(self, request):\n                return None\n        view = AView()\n        deriver = self._makeOne()\n        result = deriver(view)\n        self.assertFalse(result is view)\n        try:\n            result(None, None)\n        except ValueError as e:\n            msg = e.args[0]\n>           self.assertTrue(msg.startswith(\n                'Could not convert return value of the view callable object '\n                '<pyramid.tests.test_config.test_views.'))\nE           AssertionError: False is not true\n\nr2e_tests/test_config/test_views.py:2409: AssertionError\n____ TestViewDeriver.test_requestonly_default_method_returns_non_adaptable _____\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_default_method_returns_non_adaptable>\n\n    def test_requestonly_default_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def __call__(self):\n                return None\n        deriver = self._makeOne()\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n>           result(None, request)\n\nr2e_tests/test_config/test_views.py:2452: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x7ad5a3eef7f0>\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable method __call__ of class r2e_tests.test_config.test_views.AView into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_default_method_returns_non_adaptable>\n\n    def test_requestonly_default_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def __call__(self):\n                return None\n        deriver = self._makeOne()\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n            result(None, request)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                'Could not convert return value of the view callable '\n                'method __call__ of '\n                'class pyramid.tests.test_config.test_views.AView into a '\n                'response object. The value returned was None. You may have '\n                'forgotten to return a value from the view callable.'\n                )\nE           AssertionError: 'Coul[68 chars]lass r2e_tests.test_config.test_views.AView in[111 chars]ble.' != 'Coul[68 chars]lass pyramid.tests.test_config.test_views.AVie[115 chars]ble.'\nE           Diff is 649 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2454: AssertionError\n___ TestViewDeriver.test_requestonly_nondefault_method_returns_non_adaptable ___\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_nondefault_method_returns_non_adaptable>\n\n    def test_requestonly_nondefault_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def theviewmethod(self):\n                return None\n        deriver = self._makeOne(attr='theviewmethod')\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n>           result(None, request)\n\nr2e_tests/test_config/test_views.py:2476: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x7ad5a3a79b50>\n\n    def viewresult_to_response(context, request):\n        result = view(context, request)\n        if result.__class__ is Response: # common case\n            response = result\n        else:\n            response = registry.queryAdapterOrSelf(result, IResponse)\n            if response is None:\n                if result is None:\n                    append = (' You may have forgotten to return a value '\n                              'from the view callable.')\n                elif isinstance(result, dict):\n                    append = (' You may have forgotten to define a '\n                              'renderer in the view configuration.')\n                else:\n                    append = ''\n    \n                msg = ('Could not convert return value of the view '\n                       'callable %s into a response object. '\n                       'The value returned was %r.' + append)\n    \n>               raise ValueError(msg % (view_description(view), result))\nE               ValueError: Could not convert return value of the view callable method theviewmethod of class r2e_tests.test_config.test_views.AView into a response object. The value returned was None. You may have forgotten to return a value from the view callable.\n\npyramid/config/views.py:404: ValueError\n\nDuring handling of the above exception, another exception occurred:\n\nself = <r2e_tests.test_config.test_views.TestViewDeriver testMethod=test_requestonly_nondefault_method_returns_non_adaptable>\n\n    def test_requestonly_nondefault_method_returns_non_adaptable(self):\n        request = DummyRequest()\n        class AView(object):\n            def __init__(self, request):\n                pass\n            def theviewmethod(self):\n                return None\n        deriver = self._makeOne(attr='theviewmethod')\n        result = deriver(AView)\n        self.assertFalse(result is AView)\n        try:\n            result(None, request)\n        except ValueError as e:\n>           self.assertEqual(\n                e.args[0],\n                'Could not convert return value of the view callable '\n                'method theviewmethod of '\n                'class pyramid.tests.test_config.test_views.AView into a '\n                'response object. The value returned was None. You may have '\n                'forgotten to return a value from the view callable.'\n                )\nE           AssertionError: 'Coul[73 chars]lass r2e_tests.test_config.test_views.AView in[111 chars]ble.' != 'Coul[73 chars]lass pyramid.tests.test_config.test_views.AVie[115 chars]ble.'\nE           Diff is 669 characters long. Set self.maxDiff to None to see it.\n\nr2e_tests/test_config/test_views.py:2478: AssertionError\n___________________ Test_view_description.test_without_text ____________________\n\nself = <r2e_tests.test_config.test_views.Test_view_description testMethod=test_without_text>\n\n    def test_without_text(self):\n        def view(): pass\n        result = self._callFUT(view)\n>       self.assertEqual(result,\n                         'function pyramid.tests.test_config.test_views.view')\nE       AssertionError: 'function r2e_tests.test_config.test_views.view' != 'function pyramid.tests.test_config.test_views.view'\nE       - function r2e_tests.test_config.test_views.view\nE       ?           ^^^\nE       + function pyramid.tests.test_config.test_views.view\nE       ?          ++ ^^^^^\n\nr2e_tests/test_config/test_views.py:3937: AssertionError\n_______________ TestPRequestCommand.test_command_display_headers _______________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_display_headers>\n\n    def test_command_display_headers(self):\n        command = self._makeOne(\n            ['', '--display-headers', 'development.ini', '/'])\n        command.run()\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(\n            self._out,\n            ['200 OK', 'Content-Type: text/html; charset=UTF-8', 'abc'])\nE       AssertionError: Lists differ: ['200 OK', b'abc'] != ['200 OK', 'Content-Type: text/html; charset=UTF-8', 'abc']\nE       \nE       First differing element 1:\nE       b'abc'\nE       'Content-Type: text/html; charset=UTF-8'\nE       \nE       Second list contains 1 additional elements.\nE       First extra element 2:\nE       'abc'\nE       \nE       - ['200 OK', b'abc']\nE       + ['200 OK', 'Content-Type: text/html; charset=UTF-8', 'abc']\n\nr2e_tests/test_scripts/test_prequest.py:202: AssertionError\n_________ TestPRequestCommand.test_command_has_content_type_header_var _________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_has_content_type_header_var>\n\n    def test_command_has_content_type_header_var(self):\n        command = self._makeOne(\n            ['', '--header=content-type:app/foo','development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['CONTENT_TYPE'], 'app/foo')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:92: AssertionError\n_____________ TestPRequestCommand.test_command_has_good_header_var _____________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_has_good_header_var>\n\n    def test_command_has_good_header_var(self):\n        command = self._makeOne(\n            ['', '--header=name:value','development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['HTTP_NAME'], 'value')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:69: AssertionError\n__________ TestPRequestCommand.test_command_has_multiple_header_vars ___________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_has_multiple_header_vars>\n\n    def test_command_has_multiple_header_vars(self):\n        command = self._makeOne(\n            ['',\n             '--header=name:value',\n             '--header=name2:value2',\n             'development.ini',\n             '/'])\n        command.run()\n        self.assertEqual(self._environ['HTTP_NAME'], 'value')\n        self.assertEqual(self._environ['HTTP_NAME2'], 'value2')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:107: AssertionError\n_________________ TestPRequestCommand.test_command_method_get __________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_get>\n\n    def test_command_method_get(self):\n        command = self._makeOne(['', '--method=GET', 'development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'GET')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:116: AssertionError\n_______________ TestPRequestCommand.test_command_method_options ________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_options>\n\n    def test_command_method_options(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=OPTIONS', 'development.ini',\n                                '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'OPTIONS')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:184: AssertionError\n________________ TestPRequestCommand.test_command_method_patch _________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_patch>\n\n    def test_command_method_patch(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=PATCH', 'development.ini', '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'PATCH')\n        self.assertEqual(self._environ['CONTENT_LENGTH'], '-1')\n        self.assertEqual(self._environ['wsgi.input'], stdin)\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:158: AssertionError\n_________________ TestPRequestCommand.test_command_method_post _________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_post>\n\n    def test_command_method_post(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=POST', 'development.ini', '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'POST')\n        self.assertEqual(self._environ['CONTENT_LENGTH'], '-1')\n        self.assertEqual(self._environ['wsgi.input'], stdin)\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:130: AssertionError\n_______________ TestPRequestCommand.test_command_method_propfind _______________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_propfind>\n\n    def test_command_method_propfind(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=PROPFIND', 'development.ini',\n                                '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'PROPFIND')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:171: AssertionError\n_________________ TestPRequestCommand.test_command_method_put __________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_method_put>\n\n    def test_command_method_put(self):\n        from pyramid.compat import NativeIO\n        command = self._makeOne(['', '--method=PUT', 'development.ini', '/'])\n        stdin = NativeIO()\n        command.stdin = stdin\n        command.run()\n        self.assertEqual(self._environ['REQUEST_METHOD'], 'PUT')\n        self.assertEqual(self._environ['CONTENT_LENGTH'], '-1')\n        self.assertEqual(self._environ['wsgi.input'], stdin)\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:144: AssertionError\n________ TestPRequestCommand.test_command_path_doesnt_start_with_slash _________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_path_doesnt_start_with_slash>\n\n    def test_command_path_doesnt_start_with_slash(self):\n        command = self._makeOne(['', 'development.ini', 'abc'])\n        command.run()\n        self.assertEqual(self._path_info, '/abc')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:50: AssertionError\n__________________ TestPRequestCommand.test_command_two_args ___________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_two_args>\n\n    def test_command_two_args(self):\n        command = self._makeOne(['', 'development.ini', '/'])\n        command.run()\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:42: AssertionError\n________________ TestPRequestCommand.test_command_w_basic_auth _________________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_w_basic_auth>\n\n    def test_command_w_basic_auth(self):\n        command = self._makeOne(\n            ['', '--login=user:password',\n                 '--header=name:value','development.ini', '/'])\n        command.run()\n        self.assertEqual(self._environ['HTTP_NAME'], 'value')\n        self.assertEqual(self._environ['HTTP_AUTHORIZATION'],\n                        'Basic dXNlcjpwYXNzd29yZA==')\n        self.assertEqual(self._path_info, '/')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:82: AssertionError\n______________ TestPRequestCommand.test_command_with_query_string ______________\n\nself = <r2e_tests.test_scripts.test_prequest.TestPRequestCommand testMethod=test_command_with_query_string>\n\n    def test_command_with_query_string(self):\n        command = self._makeOne(['', 'development.ini', '/abc?a=1&b=2&c'])\n        command.run()\n        self.assertEqual(self._environ['QUERY_STRING'], 'a=1&b=2&c')\n        self.assertEqual(self._path_info, '/abc')\n        self.assertEqual(self._spec, 'development.ini')\n        self.assertEqual(self._app_name, None)\n>       self.assertEqual(self._out, ['abc'])\nE       AssertionError: Lists differ: [b'abc'] != ['abc']\nE       \nE       First differing element 0:\nE       b'abc'\nE       'abc'\nE       \nE       - [b'abc']\nE       ?  -\nE       \nE       + ['abc']\n\nr2e_tests/test_scripts/test_prequest.py:193: AssertionError\n_____ TestPViewsCommand.test_views_command_single_view_function_traversal ______\n\nself = <r2e_tests.test_scripts.test_pviews.TestPViewsCommand testMethod=test_views_command_single_view_function_traversal>\n\n    def test_views_command_single_view_function_traversal(self):\n        from pyramid.registry import Registry\n        registry = Registry()\n        command = self._makeOne(registry=registry)\n        L = []\n        command.out = L.append\n        def view(): pass\n        view.__request_attrs__ = {'context': 'context', 'view_name': 'a'}\n        command._find_view = lambda arg1: view\n        command.args = ('/foo/bar/myapp.ini#myapp', '/a')\n        result = command.run()\n        self.assertEqual(result, 0)\n        self.assertEqual(L[1], 'URL = /a')\n        self.assertEqual(L[3], '    context: context')\n        self.assertEqual(L[4], '    view name: a')\n>       self.assertEqual(L[8],\n                         '    pyramid.tests.test_scripts.test_pviews.view')\nE       AssertionError: '    r2e_tests.test_scripts.test_pviews.view' != '    pyramid.tests.test_scripts.test_pviews.view'\nE       -     r2e_tests.test_scripts.test_pviews.view\nE       ?      ^^^\nE       +     pyramid.tests.test_scripts.test_pviews.view\nE       ?     ++ ^^^^^\n\nr2e_tests/test_scripts/test_pviews.py:296: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_defaults\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_discriminator\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_path_no_pattern\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_pattern_with_path\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_attr\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_context\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_permission\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_renderer\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_accept\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_custom_predicates\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_factory\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_factory_dottedname\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_header\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_highorder\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_regex\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_pregenerator\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_request_method\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_request_param\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_root_slash_with_route_prefix\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_route_prefix\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_static\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_xhr\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_already_registered\nPASSED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_not_yet_registered\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_object_event_subscriber\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_default_resource_iface_means_Interface\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_nodefault_resource_iface\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_response_adapter\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_response_adapter_dottednames\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_response_adapter_self\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_defaults\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_dottednames\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_iface_specified\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_predicate\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_default_type_predicates_False\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_default_type_predicates_True\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_specific_type_and_predicates_False\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_subscriber_with_specific_type_and_predicates_True\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_default_iface_means_Interface\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_introspectables\nPASSED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_nondefault_iface\nPASSED r2e_tests/test_config/test_adapters.py::Test_eventonly::test_defaults\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test__override_already_registered\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test__override_not_yet_registered\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_directory_with_directory\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_directory_with_file\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_directory_with_package\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_file_with_directory\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_file_with_file\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_file_with_package\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_package_with_directory\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_package_with_package\nPASSED r2e_tests/test_config/test_assets.py::TestAssetsConfiguratorMixin::test_override_asset_samename\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_filename_override_returns_value\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_stream_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_stream_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_stream_override_returns_value\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_string_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_string_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_string_override_returns_value\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_has_resource_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_has_resource_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_has_resource_override_returns_True\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_isdir_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_isdir_override_returns_False\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_isdir_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_listdir_no_overrides\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_listdir_override_returns_None\nPASSED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_resource_listdir_override_returns_values\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_class_conforms_to_IPEP302Loader\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_class_conforms_to_IPackageOverrides\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_package_already_has_loader_of_different_type\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_package_already_has_loader_of_same_type\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_registers_loader_type\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_sets_loader\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_ctor_sets_local_state\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_code_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_code_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_data_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_data_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_filename_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_source_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_source_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_stream\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_stream_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_string\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_string_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_has_resource\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_has_resource_file_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_insert_directory\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_insert_emptystring\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_insert_file\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_instance_conforms_to_IPEP302Loader\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_instance_conforms_to_IPackageOverrides\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_is_package_pkg_has___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_is_package_pkg_has_no___loader__\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_isdir_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_isdir_false\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_isdir_true\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_listdir\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_listdir_doesnt_exist\nPASSED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_search_path\nPASSED r2e_tests/test_config/test_assets.py::TestDirectoryOverride::test_it_match\nPASSED r2e_tests/test_config/test_assets.py::TestDirectoryOverride::test_it_no_match\nPASSED r2e_tests/test_config/test_assets.py::TestFileOverride::test_it_match\nPASSED r2e_tests/test_config/test_assets.py::TestFileOverride::test_it_no_match\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_None_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_None_callable_and_no_name\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_None_callable_conflict\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_add_request_method_with_unnamed_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_multiple_request_methods_conflict\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_factory\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_factory_dottedname\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_root_factory\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_root_factory_as_None\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_root_factory_dottedname\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_session_factory\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_session_factory_dottedname\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_multiple_request_properties\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_multiple_request_properties_conflict\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_request_property_with_callable\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_request_property_with_property\nPASSED r2e_tests/test_config/test_factories.py::TestDeprecatedFactoriesMixinMethods::test_set_request_property_with_unnamed_callable\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_missing_dir\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_no_specs\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_set_locale_negotiator\nPASSED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_set_locale_negotiator_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__matches\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__matches_no_action_wrap\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__missing_when_directives_dont_exist\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test___getattr__missing_when_directives_exist\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_has_listeners\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_notify\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_queryAdapterOrSelf\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test__fix_registry_registerSelfAdapter\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_absolute_asset_spec_already_absolute\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_absolute_asset_spec_notastring\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_absolute_asset_spec_relative\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_autocommit_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_autocommit_with_introspectables_introspection_off\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_kw_is_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_kw_is_not_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_nonautocommit_with_config_info\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_nonautocommit_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_branching_nonautocommit_without_config_info\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_action_nonautocommit_with_introspectables_introspection_off\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_autocommit_no_conflicts\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_begin\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_begin_with_request\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_resolved_with_include\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_resolved_with_two_includes_and_local\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_simple\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_commit_conflict_with_two_includes\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_conflict_set_forbidden_view\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_conflict_set_notfound_view\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_alternate_renderers\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_authentication_policy\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_authorization_policy_only\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_permission\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_renderers\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_view_mapper\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_default_webob_response_adapter_registered\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_exceptionresponse_view_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_exceptionresponse_view_custom\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_httpexception_view_default\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_no_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_noreg_custom_settings\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_noreg_debug_logger_non_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_session_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_with_introspection\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_with_package_registry\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_with_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_end\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_hook_zca\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_dotted_name\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_missing_source_file\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_module_defaults_to_includeme\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_module_defaults_to_includeme_missing\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_nested_route_prefix\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_python_callable\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_include_with_route_prefix\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_introspector_decorator\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_make_wsgi_app\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_maybe_dotted_notstring_success\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_maybe_dotted_string_fail\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_maybe_dotted_string_success\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_dottedname_package\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_with_extra_kw\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_with_ignore\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_with_onerror\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_alternate_renderers\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authentication_policy\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authentication_policy_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authorization_policy_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_authorization_policy_only\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_calls_fix_registry\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_custom_settings\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_debug_logger_name\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_debug_logger_non_None\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_default_permission\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_dottedname_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_explicit_notfound_trumps_iexceptionresponse\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_includes\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_includes_spaces\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_locale_negotiator\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_locale_negotiator_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_no_default_root_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_registers_default_exceptionresponse_views\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_registers_default_view_predicates\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_registers_default_webob_iresponse_adapter\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_request_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_request_factory_dottedname\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_tweens\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_unhook_zca\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_with_package\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_with_package_module\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_with_package_package\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_directive_persists_across_configurator_creations\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_action_method_successful\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_same_name_doesnt_conflict\nPASSED r2e_tests/test_config/test_init.py::TestConfigurator__add_predicate::test_factory_as_object\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_simple\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_includepath\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_includepath_and_info\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_info\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_action_with_order\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_dicts\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_error\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_tuples\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_with_introspectable_no_callable\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_execute_actions_with_introspectables\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_it\nPASSED r2e_tests/test_config/test_init.py::TestActionState::test_processSpec\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_conflict\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_success_dicts\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_success_tuples\nPASSED r2e_tests/test_config/test_init.py::Test_resolveConflicts::test_it_with_actions_grouped_by_order\nPASSED r2e_tests/test_config/test_init.py::TestGlobalRegistriesIntegration::test_global_registries\nPASSED r2e_tests/test_config/test_init.py::TestGlobalRegistriesIntegration::test_global_registries_empty\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test___call___true\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestXHRPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test___call___true_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test___call___true_single\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test_ctor_get_but_no_head\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestMethodPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test___call___true\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test_ctor_compilefail\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestPathInfoPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___false_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___true_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___true_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test___call___true_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_phash_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_phash_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_text_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_text_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestRequestParamPredicate::test_text_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___matchdict_is_None\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___true_multi\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test___call___true_single\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestMatchParamPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test___call___true\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test_text_func_has___text__\nPASSED r2e_tests/test_config/test_predicates.py::TestCustomPredicate::test_text_func_repr\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test___call__traverse_has_remainder_already\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test___call__traverse_matches\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test___call__traverse_matches_with_highorder_chars\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::TestTraversePredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_it_call_val_False\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_it_call_val_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_it_call_val_str\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::Test_CheckCSRFTokenPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___false\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___false_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___true_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___true_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test___call___true_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_phash_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_phash_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_phash_withval\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_text_exists\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_text_withregex\nPASSED r2e_tests/test_config/test_predicates.py::TestHeaderPredicate::test_text_withval\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_False\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_context_has_no_name\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_val_list_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_val_str_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_it_call_val_tuple_True\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::Test_PhysicalPathPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_authentication_policy_doesnt_provide_superset\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_authentication_policy_provides_superset\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_authentication_policy_provides_superset_implicit\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_it_call_no_authentication_policy\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_phash\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_text\nPASSED r2e_tests/test_config/test_predicates.py::Test_EffectivePrincipalsPredicate::test_text_noniter\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_default_renderers\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_renderer\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_renderer_dottedname_factory\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_defaults\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_discriminator\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_path_no_pattern\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_pattern_with_path\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_attr\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_context\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_permission\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_no_view_with_view_renderer\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_accept\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_custom_predicates\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_factory\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_factory_dottedname\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_header\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_highorder\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_path_info_regex\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_pregenerator\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_request_method\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_request_param\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_root_slash_with_route_prefix\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_route_prefix\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_static\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_xhr\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_already_registered\nPASSED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_get_routes_mapper_not_yet_registered\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_add_permission\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_no_authz_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_no_authz_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_with_authz_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authentication_policy_with_authz_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_no_authn_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_no_authn_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_with_authn_policy\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_authorization_policy_with_authn_policy_autocommit\nPASSED r2e_tests/test_config/test_security.py::ConfiguratorSecurityMethodsTests::test_set_default_permission\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test__set_settings_as_None\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test__set_settings_as_dictwithvalues\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_add_settings_settings_None\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_add_settings_settings_already_registered\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_add_settings_settings_not_yet_registered\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_get_settings_nosettings\nPASSED r2e_tests/test_config/test_settings.py::TestSettingsConfiguratorMixin::test_get_settings_withsettings\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_all\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_authorization\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_notfound\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_routematch\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_debug_templates\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_default_locale_name\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_getattr_fail\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_getattr_raises_attribute_error\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_getattr_success\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_noargs\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_originals_kept\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_prevent_http_cache\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_all\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_assets\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_resources\nPASSED r2e_tests/test_config/test_settings.py::TestSettings::test_reload_templates\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_renderer\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_renderer_explicitrenderer\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_renderer_twice\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_defaults\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_dottedname\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_multiple\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_subscriber_single\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_add_template\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_resources\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_securitypolicy\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_securitypolicy_forget_result\nPASSED r2e_tests/test_config/test_testing.py::TestingConfiguratorMixinTests::test_testing_securitypolicy_remember_result\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_dottedname\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_instance\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_name_ingress\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_name_main\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_over_ingress\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_over_ingress_iterable\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_under_main\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_under_main_iterable\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tween_unsuitable\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_conflict\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_distinct\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_with_over_nonstringoriter\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_with_under_nonstringoriter\nPASSED r2e_tests/test_config/test_tweens.py::TestTweensConfiguratorMixin::test_add_tweens_names_with_underover\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test___call___explicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test___call___implicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_add_explicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_add_implicit\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_1\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_2\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_3\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_4\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_5\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_conflict_direct\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_conflict_indirect\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_over_and_under_partials\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_over_partial\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_over_partial_with_fallback\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_under_partial\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_missing_under_partial_with_fallback\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_with_missing_fallbacks\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_with_multiple_matching_fallbacks\nPASSED r2e_tests/test_config/test_tweens.py::TestTweens::test_implicit_ordering_with_partial_fallbacks\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_custom_predicates_can_affect_traversal\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_different_custom_predicates_with_same_hash\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_dict\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_dict_fails\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_string\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_match_param_from_string_fails\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_notted\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_importance_and_number\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_importance_of_predicates\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_number_of_predicates\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_ordering_xhr_and_request_method_trump_only_containment\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_predicate_text_is_correct\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_request_method_ordering_hashes_same\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_request_method_sequence\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_traverse_has_remainder_already\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_traverse_matches\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_traverse_matches_with_highorder_chars\nPASSED r2e_tests/test_config/test_util.py::TestPredicateList::test_unknown_predicate\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_noargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_with_attr_false\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_function_with_attr_true\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_defaultargs_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_nocall\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_instance_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_method_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_firstname_request_with_secondname\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_noargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_newstyle_class_init_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_defaultargs_firstname_not_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_defaultargs_firstname_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_noargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_onearg_named_somethingelse\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_init_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_oldstyle_class_no_init\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_requestonly_newstyle_class_init_onearg_named_request\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_requestonly_newstyle_class_init_toomanyargs\nPASSED r2e_tests/test_config/test_util.py::Test_takes_one_arg::test_requestonly_newstyle_class_no_init\nPASSED r2e_tests/test_config/test_util.py::TestNotted::test_it_with_phash_val\nPASSED r2e_tests/test_config/test_util.py::TestNotted::test_it_without_phash_val\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_allows_other_predicates\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_context\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_for_\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_http_cache\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_disallows_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_forbidden_view_with_view_defaults\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_allows_other_predicates\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_append_slash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_context\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_for_\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_http_cache\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_disallows_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_notfound_view_with_view_defaults\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_absolute\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_here_no_utility_registered\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_package_relative\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instance\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instance_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instancemethod\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_instancemethod_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_oldstyle_class\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_as_oldstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_as_class\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_as_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_as_iface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_context_trumps_for\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_custom_more_preds_first_bests_fewer_preds_last\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_default_phash_overrides_default_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_default_phash_overrides_no_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_default_phash_overrides_default_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_default_phash_overrides_no_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_multiview_replaces_existing_securedview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_multiview_replaces_multiview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_mulview_replaces_existing_view_with___accept__\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_same_phash_overrides_existing_single_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exc_with_accept_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_exception_register_secured_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_for__as_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_for_as_class\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_for_as_iface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_mixed_case_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview___discriminator__\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_call_ordering\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_context_superclass_then_subclass\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_exception_superclass_then_subclass\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_existing_securedview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_existing_view_with___accept__\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_multiview_replaces_multiview\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_register_secured_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_same_phash_overrides_existing_single_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_same_predicates\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_view_callable_None_no_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_view_callable_None_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_view_callable_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_accept_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_accept_multiview_replaces_existing_view\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_accept_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_containment_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_containment_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_containment_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_decorator\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_decorator_tuple\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_default_permission_no_explicit_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_default_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_function_callable\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_function_callable_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_badregex\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_noval_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_noval_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_val_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_val_missing\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_header_val_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_http_cache\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_mapper\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_name_unicode\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_no_default_permission_no_explicit_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_nonexistant_route_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_path_info_badregex\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_path_info_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_path_info_nomatch\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_get_implies_head\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_sequence_conflict\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_sequence_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_sequence_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_method_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_noval_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_noval_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_val_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_param_val_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type_and_route_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type_as_iface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_request_type_as_noniface\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_route_name\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_route_name_exception\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_tmpl_renderer_factory_introspector_missing\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_tmpl_renderer_factory_no_renderer_factory\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_tmpl_renderer_factory_with_renderer_factory\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_config_and_view_defaults_conflicts\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_config_and_view_defaults_doesnt_conflict\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_defaults\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_defaults_viewname_is_dottedname_kwarg\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_view_defaults_viewname_is_dottedname_nonkwarg\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_xhr_false\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_xhr_true\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_wrapped_view_is_decorated\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_views_with_accept_multiview_replaces_existing\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_dottedname\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_function\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_with_default_renderer_no_explicit_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_derive_view_with_default_renderer_with_explicit_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_set_view_mapper\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_set_view_mapper_dottedname\nPASSED r2e_tests/test_config/test_views.py::Test_requestonly::test_defaults\nPASSED r2e_tests/test_config/test_views.py::Test_requestonly::test_otherattr\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_IException\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_IException_subinterface\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_exception_class\nPASSED r2e_tests/test_config/test_views.py::Test_isexception::test_is_exception_instance\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call__\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call__intermediate_not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call__raise_not_found_isnt_interpreted_as_pred_mismatch\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call_permissive_has_call_permissive\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test___call_permissive_has_no_call_permissive\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call__not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call__with_accept_match\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call__with_accept_miss\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test__call_permissive__not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add_with_phash\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add_with_phash_override_accept\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_add_with_phash_override_accept2\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_class_implements_ISecuredView\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views_best_match_returns_None\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views_no_self_accepts\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_get_views_request_has_no_accept\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_instance_implements_ISecuredView\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_match_not_found\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_match_predicate_fails\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_match_predicate_succeeds\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_multiple_with_functions_as_views\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_permitted\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_permitted_no_match_with__permitted__\nPASSED r2e_tests/test_config/test_views.py::TestMultiView::test_permitted_no_views\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_function_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_function_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_context_and_request_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_instance_requestonly_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_context_and_request_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_newstyle_class_requestonly_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_cls_context_request_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_as_oldstyle_cls_requestonly_attr_and_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_attr_wrapped_view_branching_default_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_attr_wrapped_view_branching_nondefault_phash\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_class_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_class_without_attr\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_denied\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_denied2\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_overridden\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_permitted\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_debug_auth_permission_authpol_permitted_no_request\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_true_Response_no_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_true_Response_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_prevent_http_cache_in_settings\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_bad_tuple\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_integer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_prevent_auto_set\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_timedelta\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_tuple\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_http_cached_view_tuple_seconds_None\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_predicate_mismatch_exception_has_text_in_detail\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_predicate_mismatch_view_has_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_predicate_mismatch_view_has_no_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function_with_renderer_request_has_view\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_function_with_renderer_request_override\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_authn_policy_no_authz_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_authz_policy_no_authn_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_raises_forbidden_no_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_secured_view_raises_forbidden_with_name\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_authn_policy_no_authz_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_authz_policy_no_authn_policy\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_no_authpol\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_debug_authorization_no_permission\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_predicates_all\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_predicates_checker\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_predicates_notall\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_view_mapper_config_specified\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_view_mapper_default_mapper_specified\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_view_mapper_view_specified\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_wrapper_viewname\nPASSED r2e_tests/test_config/test_views.py::TestViewDeriver::test_with_wrapper_viewname_notfound\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test__view_as_function_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_function_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_function_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_function_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_context_and_request_and_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_instance_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_context_and_request_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_newstyle_class_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_context_and_request\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_context_and_request_with_attr\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_requestonly\nPASSED r2e_tests/test_config/test_views.py::TestDefaultViewMapper::test_view_as_oldstyle_class_requestonly_with_attr\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_different\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_different_with_existing_original_view\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_same\nPASSED r2e_tests/test_config/test_views.py::Test_preserve_view_attrs::test_it_view_is_None\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_already_exists\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_url_noendslash\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_url_noscheme\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_url_withendslash\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_context\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_for_\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_permission\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_renderer\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_add_viewname_with_route_prefix\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_missing\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_quoting\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_registration_miss\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_registration_no_registry_on_request\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_route_url\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_slash_in_name1\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_slash_in_name2\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_quoted_remote\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_unquoted_local\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_with_custom_anchor\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_generate_url_with_custom_query\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_verifyClass\nPASSED r2e_tests/test_config/test_views.py::TestStaticURLInfo::test_verifyObject\nPASSED r2e_tests/test_config/test_views.py::Test_view_description::test_with_text\nPASSED r2e_tests/test_scripts/test_common.py::Test_logging_file_config::test_it\nPASSED r2e_tests/test_scripts/test_common.py::TestParseVars::test_parse_vars_bad\nPASSED r2e_tests/test_scripts/test_common.py::TestParseVars::test_parse_vars_good\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_absolute_path\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_multiple_rendered\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_single_rendered\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_known_scaffold_with_path_as_project_target_rendered\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_no_project_name\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_run_no_scaffold_name\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_run_show_scaffolds_exist\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_run_show_scaffolds_none_exist\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_dev_pyramid_long_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_dev_pyramid_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_prod_pyramid_long_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_prod_pyramid_unparsable_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_scaffold_with_prod_pyramid_version\nPASSED r2e_tests/test_scripts/test_pcreate.py::TestPCreateCommand::test_unknown_scaffold_name\nPASSED r2e_tests/test_scripts/test_pcreate.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pdistreport.py::TestPDistReportCommand::test_no_dists\nPASSED r2e_tests/test_scripts/test_pdistreport.py::TestPDistReportCommand::test_with_dists\nPASSED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_bad_config_header\nPASSED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_not_enough_args\nPASSED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_response_has_no_charset\nPASSED r2e_tests/test_scripts/test_prequest.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test__get_mapper\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_bad_args\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_good_args\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_no_mapper\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_no_routes\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_route_with_no_slash_prefix\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_no_route_registered\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_no_views_registered\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_one_view_registered\nPASSED r2e_tests/test_scripts/test_proutes.py::TestPRoutesCommand::test_single_route_one_view_registered_with_factory\nPASSED r2e_tests/test_scripts/test_proutes.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_get_options_no_command\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_get_options_with_command\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_parse_vars_bad\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_parse_vars_good\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_record_pid_not_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_record_pid_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_current_pid_is_not_pid_in_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_current_pid_is_not_written_pid\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_not_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_stale_pid_write_exception\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_unlink_exception\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_file_verbose\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_no_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_remove_pid_not_a_number\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_no_args\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_stop_daemon_bad_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_stop_daemon_invalid_pid_in_file\nPASSED r2e_tests/test_scripts/test_pserve.py::TestPServeCommand::test_run_stop_daemon_no_such_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_read_pidfile::test_read_pidfile\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_read_pidfile::test_read_pidfile_no_pid_file\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_read_pidfile::test_read_pidfile_not_a_number\nPASSED r2e_tests/test_scripts/test_pserve.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_flush\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_open\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_write\nPASSED r2e_tests/test_scripts/test_pserve.py::TestLazyWriter::test_writeline\nPASSED r2e_tests/test_scripts/test_pserve.py::Test__methodwrapper::test___call__fail\nPASSED r2e_tests/test_scripts/test_pserve.py::Test__methodwrapper::test___call__succeed\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_custom_section_override\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_bpython_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_check_variable_override_order\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_custom_items\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_default_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_default_shell_with_unknown_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_ipython_v0_10\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_ipython_v0_11\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_ipython_v1_1\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_loads_setup_from_options\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_command_setup\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_bpython_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_default_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_ipython_v0_10_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_ipython_v0_11_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_make_ipython_v1_1_shell\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_shell_ipython_ordering\nPASSED r2e_tests/test_scripts/test_pshell.py::TestPShellCommand::test_shell_ordering\nPASSED r2e_tests/test_scripts/test_pshell.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test__get_tweens\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test_command_implicit_and_explicit_tweens\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test_command_implicit_tweens_only\nPASSED r2e_tests/test_scripts/test_ptweens.py::TestPTweensCommand::test_command_no_tweens\nPASSED r2e_tests/test_scripts/test_ptweens.py::Test_main::test_it\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_multi_routes_all_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_multi_routes_none_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_multi_routes_some_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_no_match\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_no_match_multiview_registered\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_route_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_route_multiview_no_view_registered\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_route_no_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_traversal\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test__find_view_traversal_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multi_view_nested\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multiview\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multiview_with_permission\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_multiview_with_predicates\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_not_found\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_not_found_url_starts_without_slash\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_route\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_route_with_route_predicates\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_traversal\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_traversal_with_permission\nPASSED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_traversal_with_predicates\nPASSED r2e_tests/test_scripts/test_pviews.py::Test_main::test_it\nFAILED r2e_tests/test_1.py::RoutesConfiguratorMixinTests::test_add_route_with_empty_string_with_route_prefix\nFAILED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_adapter_dotted_names\nFAILED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_resource_url_adapter_introspectables\nFAILED r2e_tests/test_config/test_adapters.py::AdaptersConfiguratorMixinTests::test_add_traverser_dotted_names\nFAILED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_filename_no_overrides\nFAILED r2e_tests/test_config/test_assets.py::TestOverrideProvider::test_get_resource_filename_override_returns_None\nFAILED r2e_tests/test_config/test_assets.py::TestPackageOverrides::test_get_filename\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_abspath\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_asset_spec\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_asset_spec_existing_translation_dirs\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_multiple_specs\nFAILED r2e_tests/test_config/test_i18n.py::TestI18NConfiguratorMixin::test_add_translation_dirs_multiple_specs_multiple_calls\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_no_registry\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_ctor_noreg_debug_logger_None_default\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_scan_integration_conflict\nFAILED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_debug_logger_None_default\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_add_directive_with_custom_callable\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_add_directive_with_partial\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_with_dotted_name\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator_add_directive::test_extend_with_python_callable\nFAILED r2e_tests/test_config/test_init.py::TestConfigurator__add_predicate::test_factory_as_dotted_name\nFAILED r2e_tests/test_config/test_routes.py::RoutesConfiguratorMixinTests::test_add_route_with_empty_string_with_route_prefix\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_static_view_package_here_relative\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_custom_predicate_bests_standard_predicate\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_custom_predicates_match\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_custom_predicates_nomatch\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_template_renderer\nFAILED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_template_renderer_no_callable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_function_returns_non_adaptable_dict\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_instance_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_default_method_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::TestViewDeriver::test_requestonly_nondefault_method_returns_non_adaptable\nFAILED r2e_tests/test_config/test_views.py::Test_view_description::test_without_text\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_display_headers\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_content_type_header_var\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_good_header_var\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_has_multiple_header_vars\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_get\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_options\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_patch\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_post\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_propfind\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_method_put\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_path_doesnt_start_with_slash\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_two_args\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_w_basic_auth\nFAILED r2e_tests/test_scripts/test_prequest.py::TestPRequestCommand::test_command_with_query_string\nFAILED r2e_tests/test_scripts/test_pviews.py::TestPViewsCommand::test_views_command_single_view_function_traversal\n======================== 49 failed, 834 passed in 4.40s ========================\n",
    "old_commit_res_stderr": ""
}
docs/narr/urldispatch.rst pyramid/config/routes.py pyramid/tests/test_config/test_routes.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
### Route Path Includes Unwanted Trailing Slash When Adding Route with Empty Path and Prefix

**Description**

When adding a route with an empty string as the path while a `route_prefix` is set, the resulting route path incorrectly includes a trailing slash. This leads to inconsistencies in URL routing, where the base URL unexpectedly ends with a slash.

**Buggy Code Example**

```python
from pyramid.config import Configurator

config = Configurator(autocommit=True)
config.route_prefix = 'root'
config.add_route('home', '')
mapper = config.get_routes_mapper()
route = mapper.get_routes()[0]
print(route.path)  # Outputs: 'root/'
```

**Expected Behavior**

The route path should be `'root'` without a trailing slash when an empty string is provided as the path.

**Actual Behavior**

The route path is `'root/'` with a trailing slash, which is not the intended behavior and can cause routing issues.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### pyramid/config/routes.py
import warnings

from pyramid.compat import urlparse
from pyramid.interfaces import (
    IRequest,
    IRouteRequest,
    IRoutesMapper,
    PHASE2_CONFIG,
    )

from pyramid.exceptions import ConfigurationError
from pyramid.registry import predvalseq
from pyramid.request import route_request_iface
from pyramid.urldispatch import RoutesMapper

from pyramid.config.util import (
    action_method,
    as_sorted_tuple,
    )

import pyramid.config.predicates

class RoutesConfiguratorMixin(object):
    @action_method
    def add_route(self,
                  name,
                  pattern=None,
                  permission=None,
                  factory=None,
                  for_=None,
                  header=None,
                  xhr=None,
                  accept=None,
                  path_info=None,
                  request_method=None,
                  request_param=None,
                  traverse=None,
                  custom_predicates=(),
                  use_global_views=False,
                  path=None,
                  pregenerator=None,
                  static=False,
                  **predicates):
        """ Add a :term:`route configuration` to the current
        configuration state, as well as possibly a :term:`view
        configuration` to be used to specify a :term:`view callable`
        that will be invoked when this route matches.  The arguments
        to this method are divided into *predicate*, *non-predicate*,
        and *view-related* types.  :term:`Route predicate` arguments
        narrow the circumstances in which a route will be match a
        request; non-predicate arguments are informational.

        Non-Predicate Arguments

        name

          The name of the route, e.g. ``myroute``.  This attribute is
          required.  It must be unique among all defined routes in a given
          application.

        factory

          A Python object (often a function or a class) or a :term:`dotted
          Python name` which refers to the same object that will generate a
          :app:`Pyramid` root resource object when this route matches. For
          example, ``mypackage.resources.MyFactory``.  If this argument is
          not specified, a default root factory will be used.  See
          :ref:`the_resource_tree` for more information about root factories.

        traverse

          If you would like to cause the :term:`context` to be
          something other than the :term:`root` object when this route
          matches, you can spell a traversal pattern as the
          ``traverse`` argument.  This traversal pattern will be used
          as the traversal path: traversal will begin at the root
          object implied by this route (either the global root, or the
          object returned by the ``factory`` associated with this
          route).

          The syntax of the ``traverse`` argument is the same as it is
          for ``pattern``. For example, if the ``pattern`` provided to
          ``add_route`` is ``articles/{article}/edit``, and the
          ``traverse`` argument provided to ``add_route`` is
          ``/{article}``, when a request comes in that causes the route
          to match in such a way that the ``article`` match value is
          ``'1'`` (when the request URI is ``/articles/1/edit``), the
          traversal path will be generated as ``/1``.  This means that
          the root object's ``__getitem__`` will be called with the
          name ``'1'`` during the traversal phase.  If the ``'1'`` object
          exists, it will become the :term:`context` of the request.
          :ref:`traversal_chapter` has more information about
          traversal.

          If the traversal path contains segment marker names which
          are not present in the ``pattern`` argument, a runtime error
          will occur.  The ``traverse`` pattern should not contain
          segment markers that do not exist in the ``pattern``
          argument.

          A similar combining of routing and traversal is available
          when a route is matched which contains a ``*traverse``
          remainder marker in its pattern (see
          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``
          argument to add_route allows you to associate route patterns
          with an arbitrary traversal path without using a
          ``*traverse`` remainder marker; instead you can use other
          match information.

          Note that the ``traverse`` argument to ``add_route`` is
          ignored when attached to a route that has a ``*traverse``
          remainder marker in its pattern.

        pregenerator

           This option should be a callable object that implements the
           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A
           :term:`pregenerator` is a callable called by the
           :meth:`pyramid.request.Request.route_url` function to augment or
           replace the arguments it is passed when generating a URL for the
           route.  This is a feature not often used directly by applications,
           it is meant to be hooked by frameworks that use :app:`Pyramid` as
           a base.

        use_global_views

          When a request matches this route, and view lookup cannot
          find a view which has a ``route_name`` predicate argument
          that matches the route, try to fall back to using a view
          that otherwise matches the context, request, and view name
          (but which does not match the route_name predicate).

        static

          If ``static`` is ``True``, this route will never match an incoming
          request; it will only be useful for URL generation.  By default,
          ``static`` is ``False``.  See :ref:`static_route_narr`.

          .. versionadded:: 1.1

        Predicate Arguments

        pattern

          The pattern of the route e.g. ``ideas/{idea}``.  This
          argument is required.  See :ref:`route_pattern_syntax`
          for information about the syntax of route patterns.  If the
          pattern doesn't match the current URL, route matching
          continues.

          .. note::

             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a
             ``path`` keyword argument passed to this function will be used to
             represent the pattern value if the ``pattern`` argument is
             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``
             wins.

        xhr

          This value should be either ``True`` or ``False``.  If this
          value is specified and is ``True``, the :term:`request` must
          possess an ``HTTP_X_REQUESTED_WITH`` (aka
          ``X-Requested-With``) header for this route to match.  This
          is useful for detecting AJAX requests issued from jQuery,
          Prototype and other Javascript libraries.  If this predicate
          returns ``False``, route matching continues.

        request_method

          A string representing an HTTP method name, e.g. ``GET``, ``POST``,
          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing
          HTTP method names.  If this argument is not specified, this route
          will match if the request has *any* request method.  If this
          predicate returns ``False``, route matching continues.

          .. versionchanged:: 1.2
             The ability to pass a tuple of items as ``request_method``.
             Previous versions allowed only a string.

        path_info

          This value represents a regular expression pattern that will
          be tested against the ``PATH_INFO`` WSGI environment
          variable.  If the regex matches, this predicate will return
          ``True``.  If this predicate returns ``False``, route
          matching continues.

        request_param

          This value can be any string.  A view declaration with this
          argument ensures that the associated route will only match
          when the request has a key in the ``request.params``
          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a
          name which matches the supplied value.  If the value
          supplied as the argument has a ``=`` sign in it,
          e.g. ``request_param="foo=123"``, then the key
          (``foo``) must both exist in the ``request.params`` dictionary, and
          the value must match the right hand side of the expression (``123``)
          for the route to "match" the current request.  If this predicate
          returns ``False``, route matching continues.

        header

          This argument represents an HTTP header name or a header
          name/value pair.  If the argument contains a ``:`` (colon),
          it will be considered a name/value pair
          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If
          the value contains a colon, the value portion should be a
          regular expression.  If the value does not contain a colon,
          the entire value will be considered to be the header name
          (e.g. ``If-Modified-Since``).  If the value evaluates to a
          header name only without a value, the header specified by
          the name must be present in the request for this predicate
          to be true.  If the value evaluates to a header name/value
          pair, the header specified by the name must be present in
          the request *and* the regular expression specified as the
          value must match the header value.  Whether or not the value
          represents a header name or a header name/value pair, the
          case of the header name is not significant.  If this
          predicate returns ``False``, route matching continues.

        accept

          This value represents a match query for one or more
          mimetypes in the ``Accept`` HTTP request header.  If this
          value is specified, it must be in one of the following
          forms: a mimetype match token in the form ``text/plain``, a
          wildcard mimetype match token in the form ``text/*`` or a
          match-all wildcard mimetype match token in the form ``*/*``.
          If any of the forms matches the ``Accept`` header of the
          request, or if the ``Accept`` header isn't set at all in the
          request, this predicate will be true. If this predicate
          returns ``False``, route matching continues.

        effective_principals

          If specified, this value should be a :term:`principal` identifier or
          a sequence of principal identifiers.  If the
          :attr:`pyramid.request.Request.effective_principals` property
          indicates that every principal named in the argument list is present
          in the current request, this predicate will return True; otherwise it
          will return False.  For example:
          ``effective_principals=pyramid.security.Authenticated`` or
          ``effective_principals=('fred', 'group:admins')``.

          .. versionadded:: 1.4a4

        custom_predicates

          .. deprecated:: 1.5
              This value should be a sequence of references to custom
              predicate callables.  Use custom predicates when no set of
              predefined predicates does what you need.  Custom predicates
              can be combined with predefined predicates as necessary.
              Each custom predicate callable should accept two arguments:
              ``info`` and ``request`` and should return either ``True``
              or ``False`` after doing arbitrary evaluation of the info
              and/or the request.  If all custom and non-custom predicate
              callables return ``True`` the associated route will be
              considered viable for a given request.  If any predicate
              callable returns ``False``, route matching continues.  Note
              that the value ``info`` passed to a custom route predicate
              is a dictionary containing matching information; see
              :ref:`custom_route_predicates` for more information about
              ``info``.

        predicates

          Pass a key/value pair here to use a third-party predicate
          registered via
          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than
          one key/value pair can be used at the same time.  See
          :ref:`view_and_route_predicates` for more information about
          third-party predicates.

          .. versionadded:: 1.4

        """
        if custom_predicates:
            warnings.warn(
                ('The "custom_predicates" argument to Configurator.add_route '
                 'is deprecated as of Pyramid 1.5.  Use '
                 '"config.add_route_predicate" and use the registered '
                 'route predicate as a predicate argument to add_route '
                 'instead. See "Adding A Third Party View, Route, or '
                 'Subscriber Predicate" in the "Hooks" chapter of the '
                 'documentation for more information.'),
                DeprecationWarning,
                stacklevel=3
                )
        # these are route predicates; if they do not match, the next route
        # in the routelist will be tried
        if request_method is not None:
            request_method = as_sorted_tuple(request_method)

        factory = self.maybe_dotted(factory)
        if pattern is None:
            pattern = path
        if pattern is None:
            raise ConfigurationError('"pattern" argument may not be None')

        # check for an external route; an external route is one which is
        # is a full url (e.g. 'http://example.com/{id}')
        parsed = urlparse.urlparse(pattern)
        if parsed.hostname:
            pattern = parsed.path

            original_pregenerator = pregenerator
            def external_url_pregenerator(request, elements, kw):
                if '_app_url' in kw:
                    raise ValueError(
                        'You cannot generate a path to an external route '
                        'pattern via request.route_path nor pass an _app_url '
                        'to request.route_url when generating a URL for an '
                        'external route pattern (pattern was "%s") ' %
                        (pattern,)
                        )
                if '_scheme' in kw:
                    scheme = kw['_scheme']
                elif parsed.scheme:
                    scheme = parsed.scheme
                else:
                    scheme = request.scheme
                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)

                if original_pregenerator:
                    elements, kw = original_pregenerator(
                        request, elements, kw)
                return elements, kw

            pregenerator = external_url_pregenerator
            static = True

        elif self.route_prefix:
            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')

        mapper = self.get_routes_mapper()

        introspectables = []

        intr = self.introspectable('routes',
                                   name,
                                   '%s (pattern: %r)' % (name, pattern),
                                   'route')
        intr['name'] = name
        intr['pattern'] = pattern
        intr['factory'] = factory
        intr['xhr'] = xhr
        intr['request_methods'] = request_method
        intr['path_info'] = path_info
        intr['request_param'] = request_param
        intr['header'] = header
        intr['accept'] = accept
        intr['traverse'] = traverse
        intr['custom_predicates'] = custom_predicates
        intr['pregenerator'] = pregenerator
        intr['static'] = static
        intr['use_global_views'] = use_global_views
        introspectables.append(intr)

        if factory:
            factory_intr = self.introspectable('root factories',
                                               name,
                                               self.object_description(factory),
                                               'root factory')
            factory_intr['factory'] = factory
            factory_intr['route_name'] = name
            factory_intr.relate('routes', name)
            introspectables.append(factory_intr)

        def register_route_request_iface():
            request_iface = self.registry.queryUtility(IRouteRequest, name=name)
            if request_iface is None:
                if use_global_views:
                    bases = (IRequest,)
                else:
                    bases = ()
                request_iface = route_request_iface(name, bases)
                self.registry.registerUtility(
                    request_iface, IRouteRequest, name=name)

        def register_connect():
            pvals = predicates.copy()
            pvals.update(
                dict(
                    xhr=xhr,
                    request_method=request_method,
                    path_info=path_info,
                    request_param=request_param,
                    header=header,
                    accept=accept,
                    traverse=traverse,
                    custom=predvalseq(custom_predicates),
                    )
                )

            predlist = self.get_predlist('route')
            _, preds, _ = predlist.make(self, **pvals)
            route = mapper.connect(
                name, pattern, factory, predicates=preds,
                pregenerator=pregenerator, static=static
                )
            intr['object'] = route
            return route

        # We have to connect routes in the order they were provided;
        # we can't use a phase to do that, because when the actions are
        # sorted, actions in the same phase lose relative ordering
        self.action(('route-connect', name), register_connect)

        # But IRouteRequest interfaces must be registered before we begin to
        # process view registrations (in phase 3)
        self.action(('route', name), register_route_request_iface,
                    order=PHASE2_CONFIG, introspectables=introspectables)

    @action_method
    def add_route_predicate(self, name, factory, weighs_more_than=None,
                           weighs_less_than=None):
        """ Adds a route predicate factory.  The view predicate can later be
        named as a keyword argument to
        :meth:`pyramid.config.Configurator.add_route`.

        ``name`` should be the name of the predicate.  It must be a valid
        Python identifier (it will be used as a keyword argument to
        ``add_view``).

        ``factory`` should be a :term:`predicate factory` or :term:`dotted
        Python name` which refers to a predicate factory.

        See :ref:`view_and_route_predicates` for more information.

        .. versionadded:: 1.4
        """
        self._add_predicate(
            'route',
            name,
            factory,
            weighs_more_than=weighs_more_than,
            weighs_less_than=weighs_less_than
            )

    def add_default_route_predicates(self):
        p = pyramid.config.predicates
        for (name, factory) in (
            ('xhr', p.XHRPredicate),
            ('request_method', p.RequestMethodPredicate),
            ('path_info', p.PathInfoPredicate),
            ('request_param', p.RequestParamPredicate),
            ('header', p.HeaderPredicate),
            ('accept', p.AcceptPredicate),
            ('effective_principals', p.EffectivePrincipalsPredicate),
            ('custom', p.CustomPredicate),
            ('traverse', p.TraversePredicate),
            ):
            self.add_route_predicate(name, factory)

    def get_routes_mapper(self):
        """ Return the :term:`routes mapper` object associated with
        this configurator's :term:`registry`."""
        mapper = self.registry.queryUtility(IRoutesMapper)
        if mapper is None:
            mapper = RoutesMapper()
            self.registry.registerUtility(mapper, IRoutesMapper)
        return mapper


```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
[ISSUE]
### Route Path Includes Unwanted Trailing Slash When Adding Route with Empty Path and Prefix

**Description**

When adding a route with an empty string as the path while a `route_prefix` is set, the resulting route path incorrectly includes a trailing slash. This leads to inconsistencies in URL routing, where the base URL unexpectedly ends with a slash.

**Buggy Code Example**

```python
from pyramid.config import Configurator

config = Configurator(autocommit=True)
config.route_prefix = 'root'
config.add_route('home', '')
mapper = config.get_routes_mapper()
route = mapper.get_routes()[0]
print(route.path)  # Outputs: 'root/'
```

**Expected Behavior**

The route path should be `'root'` without a trailing slash when an empty string is provided as the path.

**Actual Behavior**

The route path is `'root/'` with a trailing slash, which is not the intended behavior and can cause routing issues.

[/ISSUE]
{
    "RoutesConfiguratorMixinTests.test_add_route_defaults": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_discriminator": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_no_path_no_pattern": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_no_pattern_with_path": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_no_view_with_view_attr": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_no_view_with_view_context": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_no_view_with_view_permission": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_no_view_with_view_renderer": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_accept": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_custom_predicates": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_empty_string_with_route_prefix": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_factory": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_factory_dottedname": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_header": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_path_info": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_path_info_highorder": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_path_info_regex": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_pregenerator": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_request_method": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_request_param": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_root_slash_with_route_prefix": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_route_prefix": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_static": "PASSED",
    "RoutesConfiguratorMixinTests.test_add_route_with_xhr": "PASSED",
    "RoutesConfiguratorMixinTests.test_get_routes_mapper_already_registered": "PASSED",
    "RoutesConfiguratorMixinTests.test_get_routes_mapper_not_yet_registered": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_object_event_subscriber": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_resource_url_default_resource_iface_means_Interface": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_resource_url_nodefault_resource_iface": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_response_adapter": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_response_adapter_dottednames": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_response_adapter_self": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_defaults": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_dottednames": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_iface_specified": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_predicate": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_with_default_type_predicates_False": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_with_default_type_predicates_True": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_with_specific_type_and_predicates_False": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_subscriber_with_specific_type_and_predicates_True": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_traverser_default_iface_means_Interface": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_traverser_introspectables": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_traverser_nondefault_iface": "PASSED",
    "Test_eventonly.test_defaults": "PASSED",
    "TestAssetsConfiguratorMixin.test__override_already_registered": "PASSED",
    "TestAssetsConfiguratorMixin.test__override_not_yet_registered": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_directory_with_directory": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_directory_with_file": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_directory_with_package": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_file_with_directory": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_file_with_file": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_file_with_package": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_package_with_directory": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_package_with_package": "PASSED",
    "TestAssetsConfiguratorMixin.test_override_asset_samename": "PASSED",
    "TestOverrideProvider.test_get_resource_filename_override_returns_value": "PASSED",
    "TestOverrideProvider.test_get_resource_stream_no_overrides": "PASSED",
    "TestOverrideProvider.test_get_resource_stream_override_returns_None": "PASSED",
    "TestOverrideProvider.test_get_resource_stream_override_returns_value": "PASSED",
    "TestOverrideProvider.test_get_resource_string_no_overrides": "PASSED",
    "TestOverrideProvider.test_get_resource_string_override_returns_None": "PASSED",
    "TestOverrideProvider.test_get_resource_string_override_returns_value": "PASSED",
    "TestOverrideProvider.test_has_resource_no_overrides": "PASSED",
    "TestOverrideProvider.test_has_resource_override_returns_None": "PASSED",
    "TestOverrideProvider.test_has_resource_override_returns_True": "PASSED",
    "TestOverrideProvider.test_resource_isdir_no_overrides": "PASSED",
    "TestOverrideProvider.test_resource_isdir_override_returns_False": "PASSED",
    "TestOverrideProvider.test_resource_isdir_override_returns_None": "PASSED",
    "TestOverrideProvider.test_resource_listdir_no_overrides": "PASSED",
    "TestOverrideProvider.test_resource_listdir_override_returns_None": "PASSED",
    "TestOverrideProvider.test_resource_listdir_override_returns_values": "PASSED",
    "TestPackageOverrides.test_class_conforms_to_IPEP302Loader": "PASSED",
    "TestPackageOverrides.test_class_conforms_to_IPackageOverrides": "PASSED",
    "TestPackageOverrides.test_ctor_package_already_has_loader_of_different_type": "PASSED",
    "TestPackageOverrides.test_ctor_package_already_has_loader_of_same_type": "PASSED",
    "TestPackageOverrides.test_ctor_registers_loader_type": "PASSED",
    "TestPackageOverrides.test_ctor_sets_loader": "PASSED",
    "TestPackageOverrides.test_ctor_sets_local_state": "PASSED",
    "TestPackageOverrides.test_get_code_pkg_has___loader__": "PASSED",
    "TestPackageOverrides.test_get_code_pkg_has_no___loader__": "PASSED",
    "TestPackageOverrides.test_get_data_pkg_has___loader__": "PASSED",
    "TestPackageOverrides.test_get_data_pkg_has_no___loader__": "PASSED",
    "TestPackageOverrides.test_get_filename_file_doesnt_exist": "PASSED",
    "TestPackageOverrides.test_get_source_pkg_has___loader__": "PASSED",
    "TestPackageOverrides.test_get_source_pkg_has_no___loader__": "PASSED",
    "TestPackageOverrides.test_get_stream": "PASSED",
    "TestPackageOverrides.test_get_stream_file_doesnt_exist": "PASSED",
    "TestPackageOverrides.test_get_string": "PASSED",
    "TestPackageOverrides.test_get_string_file_doesnt_exist": "PASSED",
    "TestPackageOverrides.test_has_resource": "PASSED",
    "TestPackageOverrides.test_has_resource_file_doesnt_exist": "PASSED",
    "TestPackageOverrides.test_insert_directory": "PASSED",
    "TestPackageOverrides.test_insert_emptystring": "PASSED",
    "TestPackageOverrides.test_insert_file": "PASSED",
    "TestPackageOverrides.test_instance_conforms_to_IPEP302Loader": "PASSED",
    "TestPackageOverrides.test_instance_conforms_to_IPackageOverrides": "PASSED",
    "TestPackageOverrides.test_is_package_pkg_has___loader__": "PASSED",
    "TestPackageOverrides.test_is_package_pkg_has_no___loader__": "PASSED",
    "TestPackageOverrides.test_isdir_doesnt_exist": "PASSED",
    "TestPackageOverrides.test_isdir_false": "PASSED",
    "TestPackageOverrides.test_isdir_true": "PASSED",
    "TestPackageOverrides.test_listdir": "PASSED",
    "TestPackageOverrides.test_listdir_doesnt_exist": "PASSED",
    "TestPackageOverrides.test_search_path": "PASSED",
    "TestDirectoryOverride.test_it_match": "PASSED",
    "TestDirectoryOverride.test_it_no_match": "PASSED",
    "TestFileOverride.test_it_match": "PASSED",
    "TestFileOverride.test_it_no_match": "PASSED",
    "TestFactoriesMixin.test_add_request_method_with_None_callable": "PASSED",
    "TestFactoriesMixin.test_add_request_method_with_None_callable_and_no_name": "PASSED",
    "TestFactoriesMixin.test_add_request_method_with_None_callable_conflict": "PASSED",
    "TestFactoriesMixin.test_add_request_method_with_callable": "PASSED",
    "TestFactoriesMixin.test_add_request_method_with_unnamed_callable": "PASSED",
    "TestFactoriesMixin.test_set_multiple_request_methods_conflict": "PASSED",
    "TestFactoriesMixin.test_set_request_factory": "PASSED",
    "TestFactoriesMixin.test_set_request_factory_dottedname": "PASSED",
    "TestFactoriesMixin.test_set_root_factory": "PASSED",
    "TestFactoriesMixin.test_set_root_factory_as_None": "PASSED",
    "TestFactoriesMixin.test_set_root_factory_dottedname": "PASSED",
    "TestFactoriesMixin.test_set_session_factory": "PASSED",
    "TestFactoriesMixin.test_set_session_factory_dottedname": "PASSED",
    "TestDeprecatedFactoriesMixinMethods.test_set_multiple_request_properties": "PASSED",
    "TestDeprecatedFactoriesMixinMethods.test_set_multiple_request_properties_conflict": "PASSED",
    "TestDeprecatedFactoriesMixinMethods.test_set_request_property_with_callable": "PASSED",
    "TestDeprecatedFactoriesMixinMethods.test_set_request_property_with_property": "PASSED",
    "TestDeprecatedFactoriesMixinMethods.test_set_request_property_with_unnamed_callable": "PASSED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_missing_dir": "PASSED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_no_specs": "PASSED",
    "TestI18NConfiguratorMixin.test_set_locale_negotiator": "PASSED",
    "TestI18NConfiguratorMixin.test_set_locale_negotiator_dottedname": "PASSED",
    "ConfiguratorTests.test___getattr__matches": "PASSED",
    "ConfiguratorTests.test___getattr__matches_no_action_wrap": "PASSED",
    "ConfiguratorTests.test___getattr__missing_when_directives_dont_exist": "PASSED",
    "ConfiguratorTests.test___getattr__missing_when_directives_exist": "PASSED",
    "ConfiguratorTests.test__fix_registry_has_listeners": "PASSED",
    "ConfiguratorTests.test__fix_registry_notify": "PASSED",
    "ConfiguratorTests.test__fix_registry_queryAdapterOrSelf": "PASSED",
    "ConfiguratorTests.test__fix_registry_registerSelfAdapter": "PASSED",
    "ConfiguratorTests.test_absolute_asset_spec_already_absolute": "PASSED",
    "ConfiguratorTests.test_absolute_asset_spec_notastring": "PASSED",
    "ConfiguratorTests.test_absolute_asset_spec_relative": "PASSED",
    "ConfiguratorTests.test_action_autocommit_with_introspectables": "PASSED",
    "ConfiguratorTests.test_action_autocommit_with_introspectables_introspection_off": "PASSED",
    "ConfiguratorTests.test_action_branching_kw_is_None": "PASSED",
    "ConfiguratorTests.test_action_branching_kw_is_not_None": "PASSED",
    "ConfiguratorTests.test_action_branching_nonautocommit_with_config_info": "PASSED",
    "ConfiguratorTests.test_action_branching_nonautocommit_with_introspectables": "PASSED",
    "ConfiguratorTests.test_action_branching_nonautocommit_without_config_info": "PASSED",
    "ConfiguratorTests.test_action_nonautocommit_with_introspectables_introspection_off": "PASSED",
    "ConfiguratorTests.test_autocommit_no_conflicts": "PASSED",
    "ConfiguratorTests.test_begin": "PASSED",
    "ConfiguratorTests.test_begin_with_request": "PASSED",
    "ConfiguratorTests.test_commit_conflict_resolved_with_include": "PASSED",
    "ConfiguratorTests.test_commit_conflict_resolved_with_two_includes_and_local": "PASSED",
    "ConfiguratorTests.test_commit_conflict_simple": "PASSED",
    "ConfiguratorTests.test_commit_conflict_with_two_includes": "PASSED",
    "ConfiguratorTests.test_conflict_set_forbidden_view": "PASSED",
    "ConfiguratorTests.test_conflict_set_notfound_view": "PASSED",
    "ConfiguratorTests.test_ctor_alternate_renderers": "PASSED",
    "ConfiguratorTests.test_ctor_authentication_policy": "PASSED",
    "ConfiguratorTests.test_ctor_authorization_policy_only": "PASSED",
    "ConfiguratorTests.test_ctor_default_permission": "PASSED",
    "ConfiguratorTests.test_ctor_default_renderers": "PASSED",
    "ConfiguratorTests.test_ctor_default_view_mapper": "PASSED",
    "ConfiguratorTests.test_ctor_default_webob_response_adapter_registered": "PASSED",
    "ConfiguratorTests.test_ctor_exceptionresponse_view_None": "PASSED",
    "ConfiguratorTests.test_ctor_exceptionresponse_view_custom": "PASSED",
    "ConfiguratorTests.test_ctor_httpexception_view_default": "PASSED",
    "ConfiguratorTests.test_ctor_no_root_factory": "PASSED",
    "ConfiguratorTests.test_ctor_noreg_custom_settings": "PASSED",
    "ConfiguratorTests.test_ctor_noreg_debug_logger_non_None": "PASSED",
    "ConfiguratorTests.test_ctor_session_factory": "PASSED",
    "ConfiguratorTests.test_ctor_with_introspection": "PASSED",
    "ConfiguratorTests.test_ctor_with_package_registry": "PASSED",
    "ConfiguratorTests.test_ctor_with_root_factory": "PASSED",
    "ConfiguratorTests.test_end": "PASSED",
    "ConfiguratorTests.test_hook_zca": "PASSED",
    "ConfiguratorTests.test_include_with_dotted_name": "PASSED",
    "ConfiguratorTests.test_include_with_missing_source_file": "PASSED",
    "ConfiguratorTests.test_include_with_module_defaults_to_includeme": "PASSED",
    "ConfiguratorTests.test_include_with_module_defaults_to_includeme_missing": "PASSED",
    "ConfiguratorTests.test_include_with_nested_route_prefix": "PASSED",
    "ConfiguratorTests.test_include_with_python_callable": "PASSED",
    "ConfiguratorTests.test_include_with_route_prefix": "PASSED",
    "ConfiguratorTests.test_introspector_decorator": "PASSED",
    "ConfiguratorTests.test_make_wsgi_app": "PASSED",
    "ConfiguratorTests.test_maybe_dotted_notstring_success": "PASSED",
    "ConfiguratorTests.test_maybe_dotted_string_fail": "PASSED",
    "ConfiguratorTests.test_maybe_dotted_string_success": "PASSED",
    "ConfiguratorTests.test_scan_integration": "PASSED",
    "ConfiguratorTests.test_scan_integration_dottedname_package": "PASSED",
    "ConfiguratorTests.test_scan_integration_with_extra_kw": "PASSED",
    "ConfiguratorTests.test_scan_integration_with_ignore": "PASSED",
    "ConfiguratorTests.test_scan_integration_with_onerror": "PASSED",
    "ConfiguratorTests.test_setup_registry_alternate_renderers": "PASSED",
    "ConfiguratorTests.test_setup_registry_authentication_policy": "PASSED",
    "ConfiguratorTests.test_setup_registry_authentication_policy_dottedname": "PASSED",
    "ConfiguratorTests.test_setup_registry_authorization_policy_dottedname": "PASSED",
    "ConfiguratorTests.test_setup_registry_authorization_policy_only": "PASSED",
    "ConfiguratorTests.test_setup_registry_calls_fix_registry": "PASSED",
    "ConfiguratorTests.test_setup_registry_custom_settings": "PASSED",
    "ConfiguratorTests.test_setup_registry_debug_logger_name": "PASSED",
    "ConfiguratorTests.test_setup_registry_debug_logger_non_None": "PASSED",
    "ConfiguratorTests.test_setup_registry_default_permission": "PASSED",
    "ConfiguratorTests.test_setup_registry_dottedname_root_factory": "PASSED",
    "ConfiguratorTests.test_setup_registry_explicit_notfound_trumps_iexceptionresponse": "PASSED",
    "ConfiguratorTests.test_setup_registry_includes": "PASSED",
    "ConfiguratorTests.test_setup_registry_includes_spaces": "PASSED",
    "ConfiguratorTests.test_setup_registry_locale_negotiator": "PASSED",
    "ConfiguratorTests.test_setup_registry_locale_negotiator_dottedname": "PASSED",
    "ConfiguratorTests.test_setup_registry_no_default_root_factory": "PASSED",
    "ConfiguratorTests.test_setup_registry_registers_default_exceptionresponse_views": "PASSED",
    "ConfiguratorTests.test_setup_registry_registers_default_view_predicates": "PASSED",
    "ConfiguratorTests.test_setup_registry_registers_default_webob_iresponse_adapter": "PASSED",
    "ConfiguratorTests.test_setup_registry_request_factory": "PASSED",
    "ConfiguratorTests.test_setup_registry_request_factory_dottedname": "PASSED",
    "ConfiguratorTests.test_setup_registry_tweens": "PASSED",
    "ConfiguratorTests.test_unhook_zca": "PASSED",
    "ConfiguratorTests.test_with_package": "PASSED",
    "ConfiguratorTests.test_with_package_module": "PASSED",
    "ConfiguratorTests.test_with_package_package": "PASSED",
    "TestConfigurator_add_directive.test_directive_persists_across_configurator_creations": "PASSED",
    "TestConfigurator_add_directive.test_extend_action_method_successful": "PASSED",
    "TestConfigurator_add_directive.test_extend_same_name_doesnt_conflict": "PASSED",
    "TestConfigurator__add_predicate.test_factory_as_object": "PASSED",
    "TestActionState.test_action_simple": "PASSED",
    "TestActionState.test_action_with_includepath": "PASSED",
    "TestActionState.test_action_with_includepath_and_info": "PASSED",
    "TestActionState.test_action_with_info": "PASSED",
    "TestActionState.test_action_with_introspectables": "PASSED",
    "TestActionState.test_action_with_order": "PASSED",
    "TestActionState.test_execute_actions_dicts": "PASSED",
    "TestActionState.test_execute_actions_error": "PASSED",
    "TestActionState.test_execute_actions_tuples": "PASSED",
    "TestActionState.test_execute_actions_with_introspectable_no_callable": "PASSED",
    "TestActionState.test_execute_actions_with_introspectables": "PASSED",
    "TestActionState.test_it": "PASSED",
    "TestActionState.test_processSpec": "PASSED",
    "Test_resolveConflicts.test_it_conflict": "PASSED",
    "Test_resolveConflicts.test_it_success_dicts": "PASSED",
    "Test_resolveConflicts.test_it_success_tuples": "PASSED",
    "Test_resolveConflicts.test_it_with_actions_grouped_by_order": "PASSED",
    "TestGlobalRegistriesIntegration.test_global_registries": "PASSED",
    "TestGlobalRegistriesIntegration.test_global_registries_empty": "PASSED",
    "TestXHRPredicate.test___call___false": "PASSED",
    "TestXHRPredicate.test___call___true": "PASSED",
    "TestXHRPredicate.test_phash": "PASSED",
    "TestXHRPredicate.test_text": "PASSED",
    "TestRequestMethodPredicate.test___call___false": "PASSED",
    "TestRequestMethodPredicate.test___call___true_multi": "PASSED",
    "TestRequestMethodPredicate.test___call___true_single": "PASSED",
    "TestRequestMethodPredicate.test_ctor_get_but_no_head": "PASSED",
    "TestRequestMethodPredicate.test_phash": "PASSED",
    "TestRequestMethodPredicate.test_text": "PASSED",
    "TestPathInfoPredicate.test___call___false": "PASSED",
    "TestPathInfoPredicate.test___call___true": "PASSED",
    "TestPathInfoPredicate.test_ctor_compilefail": "PASSED",
    "TestPathInfoPredicate.test_phash": "PASSED",
    "TestPathInfoPredicate.test_text": "PASSED",
    "TestRequestParamPredicate.test___call___false": "PASSED",
    "TestRequestParamPredicate.test___call___false_multi": "PASSED",
    "TestRequestParamPredicate.test___call___true_exists": "PASSED",
    "TestRequestParamPredicate.test___call___true_multi": "PASSED",
    "TestRequestParamPredicate.test___call___true_withval": "PASSED",
    "TestRequestParamPredicate.test_phash_exists": "PASSED",
    "TestRequestParamPredicate.test_phash_withval": "PASSED",
    "TestRequestParamPredicate.test_text_exists": "PASSED",
    "TestRequestParamPredicate.test_text_multi": "PASSED",
    "TestRequestParamPredicate.test_text_withval": "PASSED",
    "TestMatchParamPredicate.test___call___false": "PASSED",
    "TestMatchParamPredicate.test___call___matchdict_is_None": "PASSED",
    "TestMatchParamPredicate.test___call___true_multi": "PASSED",
    "TestMatchParamPredicate.test___call___true_single": "PASSED",
    "TestMatchParamPredicate.test_phash": "PASSED",
    "TestMatchParamPredicate.test_text": "PASSED",
    "TestCustomPredicate.test___call___false": "PASSED",
    "TestCustomPredicate.test___call___true": "PASSED",
    "TestCustomPredicate.test_phash": "PASSED",
    "TestCustomPredicate.test_text_func_has___text__": "PASSED",
    "TestCustomPredicate.test_text_func_repr": "PASSED",
    "TestTraversePredicate.test___call__traverse_has_remainder_already": "PASSED",
    "TestTraversePredicate.test___call__traverse_matches": "PASSED",
    "TestTraversePredicate.test___call__traverse_matches_with_highorder_chars": "PASSED",
    "TestTraversePredicate.test_phash": "PASSED",
    "TestTraversePredicate.test_text": "PASSED",
    "Test_CheckCSRFTokenPredicate.test_it_call_val_False": "PASSED",
    "Test_CheckCSRFTokenPredicate.test_it_call_val_True": "PASSED",
    "Test_CheckCSRFTokenPredicate.test_it_call_val_str": "PASSED",
    "Test_CheckCSRFTokenPredicate.test_phash": "PASSED",
    "Test_CheckCSRFTokenPredicate.test_text": "PASSED",
    "TestHeaderPredicate.test___call___false": "PASSED",
    "TestHeaderPredicate.test___call___false_withregex": "PASSED",
    "TestHeaderPredicate.test___call___true_exists": "PASSED",
    "TestHeaderPredicate.test___call___true_withregex": "PASSED",
    "TestHeaderPredicate.test___call___true_withval": "PASSED",
    "TestHeaderPredicate.test_phash_exists": "PASSED",
    "TestHeaderPredicate.test_phash_withregex": "PASSED",
    "TestHeaderPredicate.test_phash_withval": "PASSED",
    "TestHeaderPredicate.test_text_exists": "PASSED",
    "TestHeaderPredicate.test_text_withregex": "PASSED",
    "TestHeaderPredicate.test_text_withval": "PASSED",
    "Test_PhysicalPathPredicate.test_it_call_False": "PASSED",
    "Test_PhysicalPathPredicate.test_it_call_context_has_no_name": "PASSED",
    "Test_PhysicalPathPredicate.test_it_call_val_list_True": "PASSED",
    "Test_PhysicalPathPredicate.test_it_call_val_str_True": "PASSED",
    "Test_PhysicalPathPredicate.test_it_call_val_tuple_True": "PASSED",
    "Test_PhysicalPathPredicate.test_phash": "PASSED",
    "Test_PhysicalPathPredicate.test_text": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_it_call_authentication_policy_doesnt_provide_superset": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_it_call_authentication_policy_provides_superset": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_it_call_authentication_policy_provides_superset_implicit": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_it_call_no_authentication_policy": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_phash": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_text": "PASSED",
    "Test_EffectivePrincipalsPredicate.test_text_noniter": "PASSED",
    "TestRenderingConfiguratorMixin.test_add_default_renderers": "PASSED",
    "TestRenderingConfiguratorMixin.test_add_renderer": "PASSED",
    "TestRenderingConfiguratorMixin.test_add_renderer_dottedname_factory": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_add_permission": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authentication_policy_no_authz_policy": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authentication_policy_no_authz_policy_autocommit": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authentication_policy_with_authz_policy": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authentication_policy_with_authz_policy_autocommit": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authorization_policy_no_authn_policy": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authorization_policy_no_authn_policy_autocommit": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authorization_policy_with_authn_policy": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_authorization_policy_with_authn_policy_autocommit": "PASSED",
    "ConfiguratorSecurityMethodsTests.test_set_default_permission": "PASSED",
    "TestSettingsConfiguratorMixin.test__set_settings_as_None": "PASSED",
    "TestSettingsConfiguratorMixin.test__set_settings_as_dictwithvalues": "PASSED",
    "TestSettingsConfiguratorMixin.test_add_settings_settings_None": "PASSED",
    "TestSettingsConfiguratorMixin.test_add_settings_settings_already_registered": "PASSED",
    "TestSettingsConfiguratorMixin.test_add_settings_settings_not_yet_registered": "PASSED",
    "TestSettingsConfiguratorMixin.test_get_settings_nosettings": "PASSED",
    "TestSettingsConfiguratorMixin.test_get_settings_withsettings": "PASSED",
    "TestSettings.test_debug_all": "PASSED",
    "TestSettings.test_debug_authorization": "PASSED",
    "TestSettings.test_debug_notfound": "PASSED",
    "TestSettings.test_debug_routematch": "PASSED",
    "TestSettings.test_debug_templates": "PASSED",
    "TestSettings.test_default_locale_name": "PASSED",
    "TestSettings.test_getattr_fail": "PASSED",
    "TestSettings.test_getattr_raises_attribute_error": "PASSED",
    "TestSettings.test_getattr_success": "PASSED",
    "TestSettings.test_noargs": "PASSED",
    "TestSettings.test_originals_kept": "PASSED",
    "TestSettings.test_prevent_http_cache": "PASSED",
    "TestSettings.test_reload_all": "PASSED",
    "TestSettings.test_reload_assets": "PASSED",
    "TestSettings.test_reload_resources": "PASSED",
    "TestSettings.test_reload_templates": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_renderer": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_renderer_explicitrenderer": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_renderer_twice": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_subscriber_defaults": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_subscriber_dottedname": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_subscriber_multiple": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_subscriber_single": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_add_template": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_resources": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_securitypolicy": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_securitypolicy_forget_result": "PASSED",
    "TestingConfiguratorMixinTests.test_testing_securitypolicy_remember_result": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_dottedname": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_instance": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_name_ingress": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_name_main": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_over_ingress": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_over_ingress_iterable": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_under_main": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_under_main_iterable": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tween_unsuitable": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tweens_conflict": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tweens_names_distinct": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tweens_names_with_over_nonstringoriter": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tweens_names_with_under_nonstringoriter": "PASSED",
    "TestTweensConfiguratorMixin.test_add_tweens_names_with_underover": "PASSED",
    "TestTweens.test___call___explicit": "PASSED",
    "TestTweens.test___call___implicit": "PASSED",
    "TestTweens.test_add_explicit": "PASSED",
    "TestTweens.test_add_implicit": "PASSED",
    "TestTweens.test_implicit_ordering_1": "PASSED",
    "TestTweens.test_implicit_ordering_2": "PASSED",
    "TestTweens.test_implicit_ordering_3": "PASSED",
    "TestTweens.test_implicit_ordering_4": "PASSED",
    "TestTweens.test_implicit_ordering_5": "PASSED",
    "TestTweens.test_implicit_ordering_conflict_direct": "PASSED",
    "TestTweens.test_implicit_ordering_conflict_indirect": "PASSED",
    "TestTweens.test_implicit_ordering_missing_over_and_under_partials": "PASSED",
    "TestTweens.test_implicit_ordering_missing_over_partial": "PASSED",
    "TestTweens.test_implicit_ordering_missing_over_partial_with_fallback": "PASSED",
    "TestTweens.test_implicit_ordering_missing_under_partial": "PASSED",
    "TestTweens.test_implicit_ordering_missing_under_partial_with_fallback": "PASSED",
    "TestTweens.test_implicit_ordering_with_missing_fallbacks": "PASSED",
    "TestTweens.test_implicit_ordering_with_multiple_matching_fallbacks": "PASSED",
    "TestTweens.test_implicit_ordering_with_partial_fallbacks": "PASSED",
    "TestPredicateList.test_custom_predicates_can_affect_traversal": "PASSED",
    "TestPredicateList.test_different_custom_predicates_with_same_hash": "PASSED",
    "TestPredicateList.test_match_param_from_dict": "PASSED",
    "TestPredicateList.test_match_param_from_dict_fails": "PASSED",
    "TestPredicateList.test_match_param_from_string": "PASSED",
    "TestPredicateList.test_match_param_from_string_fails": "PASSED",
    "TestPredicateList.test_notted": "PASSED",
    "TestPredicateList.test_ordering_importance_and_number": "PASSED",
    "TestPredicateList.test_ordering_importance_of_predicates": "PASSED",
    "TestPredicateList.test_ordering_number_of_predicates": "PASSED",
    "TestPredicateList.test_ordering_xhr_and_request_method_trump_only_containment": "PASSED",
    "TestPredicateList.test_predicate_text_is_correct": "PASSED",
    "TestPredicateList.test_request_method_ordering_hashes_same": "PASSED",
    "TestPredicateList.test_request_method_sequence": "PASSED",
    "TestPredicateList.test_traverse_has_remainder_already": "PASSED",
    "TestPredicateList.test_traverse_matches": "PASSED",
    "TestPredicateList.test_traverse_matches_with_highorder_chars": "PASSED",
    "TestPredicateList.test_unknown_predicate": "PASSED",
    "Test_takes_one_arg.test_function_defaultargs_firstname_not_request": "PASSED",
    "Test_takes_one_arg.test_function_defaultargs_firstname_request": "PASSED",
    "Test_takes_one_arg.test_function_noargs": "PASSED",
    "Test_takes_one_arg.test_function_onearg_named_request": "PASSED",
    "Test_takes_one_arg.test_function_onearg_named_somethingelse": "PASSED",
    "Test_takes_one_arg.test_function_toomanyargs": "PASSED",
    "Test_takes_one_arg.test_function_with_attr_false": "PASSED",
    "Test_takes_one_arg.test_function_with_attr_true": "PASSED",
    "Test_takes_one_arg.test_instance_defaultargs_firstname_not_request": "PASSED",
    "Test_takes_one_arg.test_instance_defaultargs_firstname_request": "PASSED",
    "Test_takes_one_arg.test_instance_defaultargs_onearg_named_request": "PASSED",
    "Test_takes_one_arg.test_instance_defaultargs_onearg_named_somethingelse": "PASSED",
    "Test_takes_one_arg.test_instance_nocall": "PASSED",
    "Test_takes_one_arg.test_instance_toomanyargs": "PASSED",
    "Test_takes_one_arg.test_method_onearg_named_request": "PASSED",
    "Test_takes_one_arg.test_newstyle_class_init_defaultargs_firstname_not_request": "PASSED",
    "Test_takes_one_arg.test_newstyle_class_init_defaultargs_firstname_request": "PASSED",
    "Test_takes_one_arg.test_newstyle_class_init_firstname_request_with_secondname": "PASSED",
    "Test_takes_one_arg.test_newstyle_class_init_noargs": "PASSED",
    "Test_takes_one_arg.test_newstyle_class_init_onearg_named_somethingelse": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_init_defaultargs_firstname_not_request": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_init_defaultargs_firstname_request": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_init_noargs": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_init_onearg_named_request": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_init_onearg_named_somethingelse": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_init_toomanyargs": "PASSED",
    "Test_takes_one_arg.test_oldstyle_class_no_init": "PASSED",
    "Test_takes_one_arg.test_requestonly_newstyle_class_init_onearg_named_request": "PASSED",
    "Test_takes_one_arg.test_requestonly_newstyle_class_init_toomanyargs": "PASSED",
    "Test_takes_one_arg.test_requestonly_newstyle_class_no_init": "PASSED",
    "TestNotted.test_it_with_phash_val": "PASSED",
    "TestNotted.test_it_without_phash_val": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_allows_other_predicates": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_disallows_context": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_disallows_for_": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_disallows_http_cache": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_disallows_name": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_disallows_permission": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_with_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_add_forbidden_view_with_view_defaults": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_allows_other_predicates": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_append_slash": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_disallows_context": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_disallows_for_": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_disallows_http_cache": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_disallows_name": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_disallows_permission": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_with_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_add_notfound_view_with_view_defaults": "PASSED",
    "TestViewsConfigurationMixin.test_add_static_view_absolute": "PASSED",
    "TestViewsConfigurationMixin.test_add_static_view_here_no_utility_registered": "PASSED",
    "TestViewsConfigurationMixin.test_add_static_view_package_relative": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_as_instance": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_as_instance_requestonly": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_as_instancemethod": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_as_instancemethod_requestonly": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_as_oldstyle_class": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_as_oldstyle_class_requestonly": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_context_as_class": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_context_as_dottedname": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_context_as_iface": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_context_trumps_for": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_custom_more_preds_first_bests_fewer_preds_last": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_default_phash_overrides_default_phash": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_default_phash_overrides_no_phash": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_default_phash_overrides_default_phash": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_default_phash_overrides_no_phash": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_multiview_replaces_existing_securedview": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_multiview_replaces_existing_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_multiview_replaces_multiview": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_mulview_replaces_existing_view_with___accept__": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_same_phash_overrides_existing_single_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exc_with_accept_multiview_replaces_existing_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_exception_register_secured_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_for__as_dottedname": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_for_as_class": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_for_as_iface": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_mixed_case_replaces_existing_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview___discriminator__": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_call_ordering": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_context_superclass_then_subclass": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_exception_superclass_then_subclass": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_replaces_existing_securedview": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_replaces_existing_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_replaces_existing_view_with___accept__": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_multiview_replaces_multiview": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_register_secured_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_same_phash_overrides_existing_single_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_same_predicates": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_view_callable_None_no_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_view_callable_None_with_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_view_callable_dottedname": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_accept_match": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_accept_multiview_replaces_existing_view": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_accept_nomatch": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_containment_dottedname": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_containment_false": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_containment_true": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_decorator": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_decorator_tuple": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_default_permission_no_explicit_permission": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_default_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_function_callable": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_function_callable_requestonly": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_header_badregex": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_header_noval_match": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_header_noval_nomatch": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_header_val_match": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_header_val_missing": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_header_val_nomatch": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_http_cache": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_mapper": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_name": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_name_unicode": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_no_default_permission_no_explicit_permission": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_nonexistant_route_name": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_path_info_badregex": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_path_info_match": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_path_info_nomatch": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_permission": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_method_false": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_method_get_implies_head": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_method_sequence_conflict": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_method_sequence_false": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_method_sequence_true": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_method_true": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_param_noval_false": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_param_noval_true": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_param_val_false": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_param_val_true": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_type": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_type_and_route_name": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_type_as_iface": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_request_type_as_noniface": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_route_name": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_route_name_exception": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_tmpl_renderer_factory_introspector_missing": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_tmpl_renderer_factory_no_renderer_factory": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_tmpl_renderer_factory_with_renderer_factory": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_view_config_and_view_defaults_conflicts": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_view_config_and_view_defaults_doesnt_conflict": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_view_defaults": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_view_defaults_viewname_is_dottedname_kwarg": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_view_defaults_viewname_is_dottedname_nonkwarg": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_xhr_false": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_xhr_true": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_wrapped_view_is_decorated": "PASSED",
    "TestViewsConfigurationMixin.test_add_views_with_accept_multiview_replaces_existing": "PASSED",
    "TestViewsConfigurationMixin.test_derive_view_dottedname": "PASSED",
    "TestViewsConfigurationMixin.test_derive_view_function": "PASSED",
    "TestViewsConfigurationMixin.test_derive_view_with_default_renderer_no_explicit_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_derive_view_with_default_renderer_with_explicit_renderer": "PASSED",
    "TestViewsConfigurationMixin.test_set_view_mapper": "PASSED",
    "TestViewsConfigurationMixin.test_set_view_mapper_dottedname": "PASSED",
    "Test_requestonly.test_defaults": "PASSED",
    "Test_requestonly.test_otherattr": "PASSED",
    "Test_isexception.test_is_IException": "PASSED",
    "Test_isexception.test_is_IException_subinterface": "PASSED",
    "Test_isexception.test_is_exception_class": "PASSED",
    "Test_isexception.test_is_exception_instance": "PASSED",
    "TestMultiView.test___call__": "PASSED",
    "TestMultiView.test___call__intermediate_not_found": "PASSED",
    "TestMultiView.test___call__raise_not_found_isnt_interpreted_as_pred_mismatch": "PASSED",
    "TestMultiView.test___call_permissive_has_call_permissive": "PASSED",
    "TestMultiView.test___call_permissive_has_no_call_permissive": "PASSED",
    "TestMultiView.test__call__not_found": "PASSED",
    "TestMultiView.test__call__with_accept_match": "PASSED",
    "TestMultiView.test__call__with_accept_miss": "PASSED",
    "TestMultiView.test__call_permissive__not_found": "PASSED",
    "TestMultiView.test_add": "PASSED",
    "TestMultiView.test_add_with_phash": "PASSED",
    "TestMultiView.test_add_with_phash_override_accept": "PASSED",
    "TestMultiView.test_add_with_phash_override_accept2": "PASSED",
    "TestMultiView.test_class_implements_ISecuredView": "PASSED",
    "TestMultiView.test_get_views": "PASSED",
    "TestMultiView.test_get_views_best_match_returns_None": "PASSED",
    "TestMultiView.test_get_views_no_self_accepts": "PASSED",
    "TestMultiView.test_get_views_request_has_no_accept": "PASSED",
    "TestMultiView.test_instance_implements_ISecuredView": "PASSED",
    "TestMultiView.test_match_not_found": "PASSED",
    "TestMultiView.test_match_predicate_fails": "PASSED",
    "TestMultiView.test_match_predicate_succeeds": "PASSED",
    "TestMultiView.test_multiple_with_functions_as_views": "PASSED",
    "TestMultiView.test_permitted": "PASSED",
    "TestMultiView.test_permitted_no_match_with__permitted__": "PASSED",
    "TestMultiView.test_permitted_no_views": "PASSED",
    "TestViewDeriver.test_as_function_context_and_request": "PASSED",
    "TestViewDeriver.test_as_function_requestonly": "PASSED",
    "TestViewDeriver.test_as_instance_context_and_request": "PASSED",
    "TestViewDeriver.test_as_instance_context_and_request_attr_and_renderer": "PASSED",
    "TestViewDeriver.test_as_instance_requestonly": "PASSED",
    "TestViewDeriver.test_as_instance_requestonly_attr_and_renderer": "PASSED",
    "TestViewDeriver.test_as_newstyle_class_context_and_request": "PASSED",
    "TestViewDeriver.test_as_newstyle_class_context_and_request_attr_and_renderer": "PASSED",
    "TestViewDeriver.test_as_newstyle_class_requestonly": "PASSED",
    "TestViewDeriver.test_as_newstyle_class_requestonly_attr_and_renderer": "PASSED",
    "TestViewDeriver.test_as_oldstyle_class_context_and_request": "PASSED",
    "TestViewDeriver.test_as_oldstyle_class_requestonly": "PASSED",
    "TestViewDeriver.test_as_oldstyle_cls_context_request_attr_and_renderer": "PASSED",
    "TestViewDeriver.test_as_oldstyle_cls_requestonly_attr_and_renderer": "PASSED",
    "TestViewDeriver.test_attr_wrapped_view_branching_default_phash": "PASSED",
    "TestViewDeriver.test_attr_wrapped_view_branching_nondefault_phash": "PASSED",
    "TestViewDeriver.test_class_with_attr": "PASSED",
    "TestViewDeriver.test_class_without_attr": "PASSED",
    "TestViewDeriver.test_debug_auth_permission_authpol_denied": "PASSED",
    "TestViewDeriver.test_debug_auth_permission_authpol_denied2": "PASSED",
    "TestViewDeriver.test_debug_auth_permission_authpol_overridden": "PASSED",
    "TestViewDeriver.test_debug_auth_permission_authpol_permitted": "PASSED",
    "TestViewDeriver.test_debug_auth_permission_authpol_permitted_no_request": "PASSED",
    "TestViewDeriver.test_function_returns_true_Response_no_renderer": "PASSED",
    "TestViewDeriver.test_function_returns_true_Response_with_renderer": "PASSED",
    "TestViewDeriver.test_http_cached_prevent_http_cache_in_settings": "PASSED",
    "TestViewDeriver.test_http_cached_view_bad_tuple": "PASSED",
    "TestViewDeriver.test_http_cached_view_integer": "PASSED",
    "TestViewDeriver.test_http_cached_view_prevent_auto_set": "PASSED",
    "TestViewDeriver.test_http_cached_view_timedelta": "PASSED",
    "TestViewDeriver.test_http_cached_view_tuple": "PASSED",
    "TestViewDeriver.test_http_cached_view_tuple_seconds_None": "PASSED",
    "TestViewDeriver.test_predicate_mismatch_exception_has_text_in_detail": "PASSED",
    "TestViewDeriver.test_predicate_mismatch_view_has_name": "PASSED",
    "TestViewDeriver.test_predicate_mismatch_view_has_no_name": "PASSED",
    "TestViewDeriver.test_requestonly_function": "PASSED",
    "TestViewDeriver.test_requestonly_function_with_renderer": "PASSED",
    "TestViewDeriver.test_requestonly_function_with_renderer_request_has_view": "PASSED",
    "TestViewDeriver.test_requestonly_function_with_renderer_request_override": "PASSED",
    "TestViewDeriver.test_secured_view_authn_policy_no_authz_policy": "PASSED",
    "TestViewDeriver.test_secured_view_authz_policy_no_authn_policy": "PASSED",
    "TestViewDeriver.test_secured_view_raises_forbidden_no_name": "PASSED",
    "TestViewDeriver.test_secured_view_raises_forbidden_with_name": "PASSED",
    "TestViewDeriver.test_with_debug_authorization_authn_policy_no_authz_policy": "PASSED",
    "TestViewDeriver.test_with_debug_authorization_authz_policy_no_authn_policy": "PASSED",
    "TestViewDeriver.test_with_debug_authorization_no_authpol": "PASSED",
    "TestViewDeriver.test_with_debug_authorization_no_permission": "PASSED",
    "TestViewDeriver.test_with_predicates_all": "PASSED",
    "TestViewDeriver.test_with_predicates_checker": "PASSED",
    "TestViewDeriver.test_with_predicates_notall": "PASSED",
    "TestViewDeriver.test_with_view_mapper_config_specified": "PASSED",
    "TestViewDeriver.test_with_view_mapper_default_mapper_specified": "PASSED",
    "TestViewDeriver.test_with_view_mapper_view_specified": "PASSED",
    "TestViewDeriver.test_with_wrapper_viewname": "PASSED",
    "TestViewDeriver.test_with_wrapper_viewname_notfound": "PASSED",
    "TestDefaultViewMapper.test__view_as_function_with_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_function_context_and_request": "PASSED",
    "TestDefaultViewMapper.test_view_as_function_requestonly": "PASSED",
    "TestDefaultViewMapper.test_view_as_function_requestonly_with_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_instance_context_and_request": "PASSED",
    "TestDefaultViewMapper.test_view_as_instance_context_and_request_and_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_instance_requestonly": "PASSED",
    "TestDefaultViewMapper.test_view_as_instance_requestonly_with_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_newstyle_class_context_and_request": "PASSED",
    "TestDefaultViewMapper.test_view_as_newstyle_class_context_and_request_with_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_newstyle_class_requestonly": "PASSED",
    "TestDefaultViewMapper.test_view_as_newstyle_class_requestonly_with_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_oldstyle_class_context_and_request": "PASSED",
    "TestDefaultViewMapper.test_view_as_oldstyle_class_context_and_request_with_attr": "PASSED",
    "TestDefaultViewMapper.test_view_as_oldstyle_class_requestonly": "PASSED",
    "TestDefaultViewMapper.test_view_as_oldstyle_class_requestonly_with_attr": "PASSED",
    "Test_preserve_view_attrs.test_it_different": "PASSED",
    "Test_preserve_view_attrs.test_it_different_with_existing_original_view": "PASSED",
    "Test_preserve_view_attrs.test_it_same": "PASSED",
    "Test_preserve_view_attrs.test_it_view_is_None": "PASSED",
    "TestStaticURLInfo.test_add_already_exists": "PASSED",
    "TestStaticURLInfo.test_add_url_noendslash": "PASSED",
    "TestStaticURLInfo.test_add_url_noscheme": "PASSED",
    "TestStaticURLInfo.test_add_url_withendslash": "PASSED",
    "TestStaticURLInfo.test_add_viewname": "PASSED",
    "TestStaticURLInfo.test_add_viewname_with_context": "PASSED",
    "TestStaticURLInfo.test_add_viewname_with_for_": "PASSED",
    "TestStaticURLInfo.test_add_viewname_with_permission": "PASSED",
    "TestStaticURLInfo.test_add_viewname_with_renderer": "PASSED",
    "TestStaticURLInfo.test_add_viewname_with_route_prefix": "PASSED",
    "TestStaticURLInfo.test_generate_missing": "PASSED",
    "TestStaticURLInfo.test_generate_quoting": "PASSED",
    "TestStaticURLInfo.test_generate_registration_miss": "PASSED",
    "TestStaticURLInfo.test_generate_registration_no_registry_on_request": "PASSED",
    "TestStaticURLInfo.test_generate_route_url": "PASSED",
    "TestStaticURLInfo.test_generate_slash_in_name1": "PASSED",
    "TestStaticURLInfo.test_generate_slash_in_name2": "PASSED",
    "TestStaticURLInfo.test_generate_url_quoted_remote": "PASSED",
    "TestStaticURLInfo.test_generate_url_unquoted_local": "PASSED",
    "TestStaticURLInfo.test_generate_url_with_custom_anchor": "PASSED",
    "TestStaticURLInfo.test_generate_url_with_custom_query": "PASSED",
    "TestStaticURLInfo.test_verifyClass": "PASSED",
    "TestStaticURLInfo.test_verifyObject": "PASSED",
    "Test_view_description.test_with_text": "PASSED",
    "Test_logging_file_config.test_it": "PASSED",
    "TestParseVars.test_parse_vars_bad": "PASSED",
    "TestParseVars.test_parse_vars_good": "PASSED",
    "TestPCreateCommand.test_known_scaffold_absolute_path": "PASSED",
    "TestPCreateCommand.test_known_scaffold_multiple_rendered": "PASSED",
    "TestPCreateCommand.test_known_scaffold_single_rendered": "PASSED",
    "TestPCreateCommand.test_known_scaffold_with_path_as_project_target_rendered": "PASSED",
    "TestPCreateCommand.test_no_project_name": "PASSED",
    "TestPCreateCommand.test_run_no_scaffold_name": "PASSED",
    "TestPCreateCommand.test_run_show_scaffolds_exist": "PASSED",
    "TestPCreateCommand.test_run_show_scaffolds_none_exist": "PASSED",
    "TestPCreateCommand.test_scaffold_with_dev_pyramid_long_version": "PASSED",
    "TestPCreateCommand.test_scaffold_with_dev_pyramid_version": "PASSED",
    "TestPCreateCommand.test_scaffold_with_prod_pyramid_long_version": "PASSED",
    "TestPCreateCommand.test_scaffold_with_prod_pyramid_unparsable_version": "PASSED",
    "TestPCreateCommand.test_scaffold_with_prod_pyramid_version": "PASSED",
    "TestPCreateCommand.test_unknown_scaffold_name": "PASSED",
    "Test_main.test_it": "PASSED",
    "TestPDistReportCommand.test_no_dists": "PASSED",
    "TestPDistReportCommand.test_with_dists": "PASSED",
    "TestPRequestCommand.test_command_has_bad_config_header": "PASSED",
    "TestPRequestCommand.test_command_not_enough_args": "PASSED",
    "TestPRequestCommand.test_command_response_has_no_charset": "PASSED",
    "TestPRoutesCommand.test__get_mapper": "PASSED",
    "TestPRoutesCommand.test_bad_args": "PASSED",
    "TestPRoutesCommand.test_good_args": "PASSED",
    "TestPRoutesCommand.test_no_mapper": "PASSED",
    "TestPRoutesCommand.test_no_routes": "PASSED",
    "TestPRoutesCommand.test_route_with_no_slash_prefix": "PASSED",
    "TestPRoutesCommand.test_single_route_no_route_registered": "PASSED",
    "TestPRoutesCommand.test_single_route_no_views_registered": "PASSED",
    "TestPRoutesCommand.test_single_route_one_view_registered": "PASSED",
    "TestPRoutesCommand.test_single_route_one_view_registered_with_factory": "PASSED",
    "TestPServeCommand.test_get_options_no_command": "PASSED",
    "TestPServeCommand.test_get_options_with_command": "PASSED",
    "TestPServeCommand.test_parse_vars_bad": "PASSED",
    "TestPServeCommand.test_parse_vars_good": "PASSED",
    "TestPServeCommand.test_record_pid_not_verbose": "PASSED",
    "TestPServeCommand.test_record_pid_verbose": "PASSED",
    "TestPServeCommand.test_remove_pid_current_pid_is_not_pid_in_file": "PASSED",
    "TestPServeCommand.test_remove_pid_current_pid_is_not_written_pid": "PASSED",
    "TestPServeCommand.test_remove_pid_file_not_verbose": "PASSED",
    "TestPServeCommand.test_remove_pid_file_stale_pid_write_exception": "PASSED",
    "TestPServeCommand.test_remove_pid_file_unlink_exception": "PASSED",
    "TestPServeCommand.test_remove_pid_file_verbose": "PASSED",
    "TestPServeCommand.test_remove_pid_no_pid_file": "PASSED",
    "TestPServeCommand.test_remove_pid_not_a_number": "PASSED",
    "TestPServeCommand.test_run_no_args": "PASSED",
    "TestPServeCommand.test_run_stop_daemon_bad_pid_file": "PASSED",
    "TestPServeCommand.test_run_stop_daemon_invalid_pid_in_file": "PASSED",
    "TestPServeCommand.test_run_stop_daemon_no_such_pid_file": "PASSED",
    "Test_read_pidfile.test_read_pidfile": "PASSED",
    "Test_read_pidfile.test_read_pidfile_no_pid_file": "PASSED",
    "Test_read_pidfile.test_read_pidfile_not_a_number": "PASSED",
    "TestLazyWriter.test_flush": "PASSED",
    "TestLazyWriter.test_open": "PASSED",
    "TestLazyWriter.test_write": "PASSED",
    "TestLazyWriter.test_writeline": "PASSED",
    "Test__methodwrapper.test___call__fail": "PASSED",
    "Test__methodwrapper.test___call__succeed": "PASSED",
    "TestPShellCommand.test_command_custom_section_override": "PASSED",
    "TestPShellCommand.test_command_loads_bpython_shell": "PASSED",
    "TestPShellCommand.test_command_loads_check_variable_override_order": "PASSED",
    "TestPShellCommand.test_command_loads_custom_items": "PASSED",
    "TestPShellCommand.test_command_loads_default_shell": "PASSED",
    "TestPShellCommand.test_command_loads_default_shell_with_unknown_shell": "PASSED",
    "TestPShellCommand.test_command_loads_ipython_v0_10": "PASSED",
    "TestPShellCommand.test_command_loads_ipython_v0_11": "PASSED",
    "TestPShellCommand.test_command_loads_ipython_v1_1": "PASSED",
    "TestPShellCommand.test_command_loads_setup_from_options": "PASSED",
    "TestPShellCommand.test_command_setup": "PASSED",
    "TestPShellCommand.test_make_bpython_shell": "PASSED",
    "TestPShellCommand.test_make_default_shell": "PASSED",
    "TestPShellCommand.test_make_ipython_v0_10_shell": "PASSED",
    "TestPShellCommand.test_make_ipython_v0_11_shell": "PASSED",
    "TestPShellCommand.test_make_ipython_v1_1_shell": "PASSED",
    "TestPShellCommand.test_shell_ipython_ordering": "PASSED",
    "TestPShellCommand.test_shell_ordering": "PASSED",
    "TestPTweensCommand.test__get_tweens": "PASSED",
    "TestPTweensCommand.test_command_implicit_and_explicit_tweens": "PASSED",
    "TestPTweensCommand.test_command_implicit_tweens_only": "PASSED",
    "TestPTweensCommand.test_command_no_tweens": "PASSED",
    "TestPViewsCommand.test__find_multi_routes_all_match": "PASSED",
    "TestPViewsCommand.test__find_multi_routes_none_match": "PASSED",
    "TestPViewsCommand.test__find_multi_routes_some_match": "PASSED",
    "TestPViewsCommand.test__find_view_no_match": "PASSED",
    "TestPViewsCommand.test__find_view_no_match_multiview_registered": "PASSED",
    "TestPViewsCommand.test__find_view_route_multiview": "PASSED",
    "TestPViewsCommand.test__find_view_route_multiview_no_view_registered": "PASSED",
    "TestPViewsCommand.test__find_view_route_no_multiview": "PASSED",
    "TestPViewsCommand.test__find_view_traversal": "PASSED",
    "TestPViewsCommand.test__find_view_traversal_multiview": "PASSED",
    "TestPViewsCommand.test_views_command_multi_view_nested": "PASSED",
    "TestPViewsCommand.test_views_command_multiview": "PASSED",
    "TestPViewsCommand.test_views_command_multiview_with_permission": "PASSED",
    "TestPViewsCommand.test_views_command_multiview_with_predicates": "PASSED",
    "TestPViewsCommand.test_views_command_not_found": "PASSED",
    "TestPViewsCommand.test_views_command_not_found_url_starts_without_slash": "PASSED",
    "TestPViewsCommand.test_views_command_single_view_route": "PASSED",
    "TestPViewsCommand.test_views_command_single_view_route_with_route_predicates": "PASSED",
    "TestPViewsCommand.test_views_command_single_view_traversal": "PASSED",
    "TestPViewsCommand.test_views_command_single_view_traversal_with_permission": "PASSED",
    "TestPViewsCommand.test_views_command_single_view_traversal_with_predicates": "PASSED",
    "AdaptersConfiguratorMixinTests.test_add_resource_url_adapter_dotted_names": "FAILED",
    "AdaptersConfiguratorMixinTests.test_add_resource_url_adapter_introspectables": "FAILED",
    "AdaptersConfiguratorMixinTests.test_add_traverser_dotted_names": "FAILED",
    "TestOverrideProvider.test_get_resource_filename_no_overrides": "FAILED",
    "TestOverrideProvider.test_get_resource_filename_override_returns_None": "FAILED",
    "TestPackageOverrides.test_get_filename": "FAILED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_abspath": "FAILED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_asset_spec": "FAILED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_asset_spec_existing_translation_dirs": "FAILED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_multiple_specs": "FAILED",
    "TestI18NConfiguratorMixin.test_add_translation_dirs_multiple_specs_multiple_calls": "FAILED",
    "ConfiguratorTests.test_ctor_no_registry": "FAILED",
    "ConfiguratorTests.test_ctor_noreg_debug_logger_None_default": "FAILED",
    "ConfiguratorTests.test_scan_integration_conflict": "FAILED",
    "ConfiguratorTests.test_setup_registry_debug_logger_None_default": "FAILED",
    "TestConfigurator_add_directive.test_add_directive_with_custom_callable": "FAILED",
    "TestConfigurator_add_directive.test_add_directive_with_partial": "FAILED",
    "TestConfigurator_add_directive.test_extend_with_dotted_name": "FAILED",
    "TestConfigurator_add_directive.test_extend_with_python_callable": "FAILED",
    "TestConfigurator__add_predicate.test_factory_as_dotted_name": "FAILED",
    "TestViewsConfigurationMixin.test_add_static_view_package_here_relative": "FAILED",
    "TestViewsConfigurationMixin.test_add_view_custom_predicate_bests_standard_predicate": "FAILED",
    "TestViewsConfigurationMixin.test_add_view_with_custom_predicates_match": "FAILED",
    "TestViewsConfigurationMixin.test_add_view_with_custom_predicates_nomatch": "FAILED",
    "TestViewsConfigurationMixin.test_add_view_with_template_renderer": "FAILED",
    "TestViewsConfigurationMixin.test_add_view_with_template_renderer_no_callable": "FAILED",
    "TestViewDeriver.test_function_returns_non_adaptable": "FAILED",
    "TestViewDeriver.test_function_returns_non_adaptable_dict": "FAILED",
    "TestViewDeriver.test_instance_returns_non_adaptable": "FAILED",
    "TestViewDeriver.test_requestonly_default_method_returns_non_adaptable": "FAILED",
    "TestViewDeriver.test_requestonly_nondefault_method_returns_non_adaptable": "FAILED",
    "Test_view_description.test_without_text": "FAILED",
    "TestPRequestCommand.test_command_display_headers": "FAILED",
    "TestPRequestCommand.test_command_has_content_type_header_var": "FAILED",
    "TestPRequestCommand.test_command_has_good_header_var": "FAILED",
    "TestPRequestCommand.test_command_has_multiple_header_vars": "FAILED",
    "TestPRequestCommand.test_command_method_get": "FAILED",
    "TestPRequestCommand.test_command_method_options": "FAILED",
    "TestPRequestCommand.test_command_method_patch": "FAILED",
    "TestPRequestCommand.test_command_method_post": "FAILED",
    "TestPRequestCommand.test_command_method_propfind": "FAILED",
    "TestPRequestCommand.test_command_method_put": "FAILED",
    "TestPRequestCommand.test_command_path_doesnt_start_with_slash": "FAILED",
    "TestPRequestCommand.test_command_two_args": "FAILED",
    "TestPRequestCommand.test_command_w_basic_auth": "FAILED",
    "TestPRequestCommand.test_command_with_query_string": "FAILED",
    "TestPViewsCommand.test_views_command_single_view_function_traversal": "FAILED"
}
diff --git a/pyramid/config/routes.py b/pyramid/config/routes.py
index f1463b50b..971e3fc95 100644
--- a/pyramid/config/routes.py
+++ b/pyramid/config/routes.py
@@ -333,7 +333,10 @@ class RoutesConfiguratorMixin(object):
             static = True
 
         elif self.route_prefix:
-            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')
+            if pattern == '':
+                pattern = self.route_prefix.rstrip('/')
+            else:
+                pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')
 
         mapper = self.get_routes_mapper()
 

{"pyramid/config/routes.py": "import warnings\n\nfrom pyramid.compat import urlparse\nfrom pyramid.interfaces import (\n    IRequest,\n    IRouteRequest,\n    IRoutesMapper,\n    PHASE2_CONFIG,\n    )\n\nfrom pyramid.exceptions import ConfigurationError\nfrom pyramid.registry import predvalseq\nfrom pyramid.request import route_request_iface\nfrom pyramid.urldispatch import RoutesMapper\n\nfrom pyramid.config.util import (\n    action_method,\n    as_sorted_tuple,\n    )\n\nimport pyramid.config.predicates\n\nclass RoutesConfiguratorMixin(object):\n    @action_method\n    def add_route(self,\n                  name,\n                  pattern=None,\n                  permission=None,\n                  factory=None,\n                  for_=None,\n                  header=None,\n                  xhr=None,\n                  accept=None,\n                  path_info=None,\n                  request_method=None,\n                  request_param=None,\n                  traverse=None,\n                  custom_predicates=(),\n                  use_global_views=False,\n                  path=None,\n                  pregenerator=None,\n                  static=False,\n                  **predicates):\n        \"\"\" Add a :term:`route configuration` to the current\n        configuration state, as well as possibly a :term:`view\n        configuration` to be used to specify a :term:`view callable`\n        that will be invoked when this route matches.  The arguments\n        to this method are divided into *predicate*, *non-predicate*,\n        and *view-related* types.  :term:`Route predicate` arguments\n        narrow the circumstances in which a route will be match a\n        request; non-predicate arguments are informational.\n\n        Non-Predicate Arguments\n\n        name\n\n          The name of the route, e.g. ``myroute``.  This attribute is\n          required.  It must be unique among all defined routes in a given\n          application.\n\n        factory\n\n          A Python object (often a function or a class) or a :term:`dotted\n          Python name` which refers to the same object that will generate a\n          :app:`Pyramid` root resource object when this route matches. For\n          example, ``mypackage.resources.MyFactory``.  If this argument is\n          not specified, a default root factory will be used.  See\n          :ref:`the_resource_tree` for more information about root factories.\n\n        traverse\n\n          If you would like to cause the :term:`context` to be\n          something other than the :term:`root` object when this route\n          matches, you can spell a traversal pattern as the\n          ``traverse`` argument.  This traversal pattern will be used\n          as the traversal path: traversal will begin at the root\n          object implied by this route (either the global root, or the\n          object returned by the ``factory`` associated with this\n          route).\n\n          The syntax of the ``traverse`` argument is the same as it is\n          for ``pattern``. For example, if the ``pattern`` provided to\n          ``add_route`` is ``articles/{article}/edit``, and the\n          ``traverse`` argument provided to ``add_route`` is\n          ``/{article}``, when a request comes in that causes the route\n          to match in such a way that the ``article`` match value is\n          ``'1'`` (when the request URI is ``/articles/1/edit``), the\n          traversal path will be generated as ``/1``.  This means that\n          the root object's ``__getitem__`` will be called with the\n          name ``'1'`` during the traversal phase.  If the ``'1'`` object\n          exists, it will become the :term:`context` of the request.\n          :ref:`traversal_chapter` has more information about\n          traversal.\n\n          If the traversal path contains segment marker names which\n          are not present in the ``pattern`` argument, a runtime error\n          will occur.  The ``traverse`` pattern should not contain\n          segment markers that do not exist in the ``pattern``\n          argument.\n\n          A similar combining of routing and traversal is available\n          when a route is matched which contains a ``*traverse``\n          remainder marker in its pattern (see\n          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``\n          argument to add_route allows you to associate route patterns\n          with an arbitrary traversal path without using a\n          ``*traverse`` remainder marker; instead you can use other\n          match information.\n\n          Note that the ``traverse`` argument to ``add_route`` is\n          ignored when attached to a route that has a ``*traverse``\n          remainder marker in its pattern.\n\n        pregenerator\n\n           This option should be a callable object that implements the\n           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A\n           :term:`pregenerator` is a callable called by the\n           :meth:`pyramid.request.Request.route_url` function to augment or\n           replace the arguments it is passed when generating a URL for the\n           route.  This is a feature not often used directly by applications,\n           it is meant to be hooked by frameworks that use :app:`Pyramid` as\n           a base.\n\n        use_global_views\n\n          When a request matches this route, and view lookup cannot\n          find a view which has a ``route_name`` predicate argument\n          that matches the route, try to fall back to using a view\n          that otherwise matches the context, request, and view name\n          (but which does not match the route_name predicate).\n\n        static\n\n          If ``static`` is ``True``, this route will never match an incoming\n          request; it will only be useful for URL generation.  By default,\n          ``static`` is ``False``.  See :ref:`static_route_narr`.\n\n          .. versionadded:: 1.1\n\n        Predicate Arguments\n\n        pattern\n\n          The pattern of the route e.g. ``ideas/{idea}``.  This\n          argument is required.  See :ref:`route_pattern_syntax`\n          for information about the syntax of route patterns.  If the\n          pattern doesn't match the current URL, route matching\n          continues.\n\n          .. note::\n\n             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a\n             ``path`` keyword argument passed to this function will be used to\n             represent the pattern value if the ``pattern`` argument is\n             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``\n             wins.\n\n        xhr\n\n          This value should be either ``True`` or ``False``.  If this\n          value is specified and is ``True``, the :term:`request` must\n          possess an ``HTTP_X_REQUESTED_WITH`` (aka\n          ``X-Requested-With``) header for this route to match.  This\n          is useful for detecting AJAX requests issued from jQuery,\n          Prototype and other Javascript libraries.  If this predicate\n          returns ``False``, route matching continues.\n\n        request_method\n\n          A string representing an HTTP method name, e.g. ``GET``, ``POST``,\n          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing\n          HTTP method names.  If this argument is not specified, this route\n          will match if the request has *any* request method.  If this\n          predicate returns ``False``, route matching continues.\n\n          .. versionchanged:: 1.2\n             The ability to pass a tuple of items as ``request_method``.\n             Previous versions allowed only a string.\n\n        path_info\n\n          This value represents a regular expression pattern that will\n          be tested against the ``PATH_INFO`` WSGI environment\n          variable.  If the regex matches, this predicate will return\n          ``True``.  If this predicate returns ``False``, route\n          matching continues.\n\n        request_param\n\n          This value can be any string.  A view declaration with this\n          argument ensures that the associated route will only match\n          when the request has a key in the ``request.params``\n          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a\n          name which matches the supplied value.  If the value\n          supplied as the argument has a ``=`` sign in it,\n          e.g. ``request_param=\"foo=123\"``, then the key\n          (``foo``) must both exist in the ``request.params`` dictionary, and\n          the value must match the right hand side of the expression (``123``)\n          for the route to \"match\" the current request.  If this predicate\n          returns ``False``, route matching continues.\n\n        header\n\n          This argument represents an HTTP header name or a header\n          name/value pair.  If the argument contains a ``:`` (colon),\n          it will be considered a name/value pair\n          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If\n          the value contains a colon, the value portion should be a\n          regular expression.  If the value does not contain a colon,\n          the entire value will be considered to be the header name\n          (e.g. ``If-Modified-Since``).  If the value evaluates to a\n          header name only without a value, the header specified by\n          the name must be present in the request for this predicate\n          to be true.  If the value evaluates to a header name/value\n          pair, the header specified by the name must be present in\n          the request *and* the regular expression specified as the\n          value must match the header value.  Whether or not the value\n          represents a header name or a header name/value pair, the\n          case of the header name is not significant.  If this\n          predicate returns ``False``, route matching continues.\n\n        accept\n\n          This value represents a match query for one or more\n          mimetypes in the ``Accept`` HTTP request header.  If this\n          value is specified, it must be in one of the following\n          forms: a mimetype match token in the form ``text/plain``, a\n          wildcard mimetype match token in the form ``text/*`` or a\n          match-all wildcard mimetype match token in the form ``*/*``.\n          If any of the forms matches the ``Accept`` header of the\n          request, or if the ``Accept`` header isn't set at all in the\n          request, this predicate will be true. If this predicate\n          returns ``False``, route matching continues.\n\n        effective_principals\n\n          If specified, this value should be a :term:`principal` identifier or\n          a sequence of principal identifiers.  If the\n          :attr:`pyramid.request.Request.effective_principals` property\n          indicates that every principal named in the argument list is present\n          in the current request, this predicate will return True; otherwise it\n          will return False.  For example:\n          ``effective_principals=pyramid.security.Authenticated`` or\n          ``effective_principals=('fred', 'group:admins')``.\n\n          .. versionadded:: 1.4a4\n\n        custom_predicates\n\n          .. deprecated:: 1.5\n              This value should be a sequence of references to custom\n              predicate callables.  Use custom predicates when no set of\n              predefined predicates does what you need.  Custom predicates\n              can be combined with predefined predicates as necessary.\n              Each custom predicate callable should accept two arguments:\n              ``info`` and ``request`` and should return either ``True``\n              or ``False`` after doing arbitrary evaluation of the info\n              and/or the request.  If all custom and non-custom predicate\n              callables return ``True`` the associated route will be\n              considered viable for a given request.  If any predicate\n              callable returns ``False``, route matching continues.  Note\n              that the value ``info`` passed to a custom route predicate\n              is a dictionary containing matching information; see\n              :ref:`custom_route_predicates` for more information about\n              ``info``.\n\n        predicates\n\n          Pass a key/value pair here to use a third-party predicate\n          registered via\n          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than\n          one key/value pair can be used at the same time.  See\n          :ref:`view_and_route_predicates` for more information about\n          third-party predicates.\n\n          .. versionadded:: 1.4\n\n        \"\"\"\n        if custom_predicates:\n            warnings.warn(\n                ('The \"custom_predicates\" argument to Configurator.add_route '\n                 'is deprecated as of Pyramid 1.5.  Use '\n                 '\"config.add_route_predicate\" and use the registered '\n                 'route predicate as a predicate argument to add_route '\n                 'instead. See \"Adding A Third Party View, Route, or '\n                 'Subscriber Predicate\" in the \"Hooks\" chapter of the '\n                 'documentation for more information.'),\n                DeprecationWarning,\n                stacklevel=3\n                )\n        # these are route predicates; if they do not match, the next route\n        # in the routelist will be tried\n        if request_method is not None:\n            request_method = as_sorted_tuple(request_method)\n\n        factory = self.maybe_dotted(factory)\n        if pattern is None:\n            pattern = path\n        if pattern is None:\n            raise ConfigurationError('\"pattern\" argument may not be None')\n\n        # check for an external route; an external route is one which is\n        # is a full url (e.g. 'http://example.com/{id}')\n        parsed = urlparse.urlparse(pattern)\n        if parsed.hostname:\n            pattern = parsed.path\n\n            original_pregenerator = pregenerator\n            def external_url_pregenerator(request, elements, kw):\n                if '_app_url' in kw:\n                    raise ValueError(\n                        'You cannot generate a path to an external route '\n                        'pattern via request.route_path nor pass an _app_url '\n                        'to request.route_url when generating a URL for an '\n                        'external route pattern (pattern was \"%s\") ' %\n                        (pattern,)\n                        )\n                if '_scheme' in kw:\n                    scheme = kw['_scheme']\n                elif parsed.scheme:\n                    scheme = parsed.scheme\n                else:\n                    scheme = request.scheme\n                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)\n\n                if original_pregenerator:\n                    elements, kw = original_pregenerator(\n                        request, elements, kw)\n                return elements, kw\n\n            pregenerator = external_url_pregenerator\n            static = True\n\n        elif self.route_prefix:\n            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')\n\n        mapper = self.get_routes_mapper()\n\n        introspectables = []\n\n        intr = self.introspectable('routes',\n                                   name,\n                                   '%s (pattern: %r)' % (name, pattern),\n                                   'route')\n        intr['name'] = name\n        intr['pattern'] = pattern\n        intr['factory'] = factory\n        intr['xhr'] = xhr\n        intr['request_methods'] = request_method\n        intr['path_info'] = path_info\n        intr['request_param'] = request_param\n        intr['header'] = header\n        intr['accept'] = accept\n        intr['traverse'] = traverse\n        intr['custom_predicates'] = custom_predicates\n        intr['pregenerator'] = pregenerator\n        intr['static'] = static\n        intr['use_global_views'] = use_global_views\n        introspectables.append(intr)\n\n        if factory:\n            factory_intr = self.introspectable('root factories',\n                                               name,\n                                               self.object_description(factory),\n                                               'root factory')\n            factory_intr['factory'] = factory\n            factory_intr['route_name'] = name\n            factory_intr.relate('routes', name)\n            introspectables.append(factory_intr)\n\n        def register_route_request_iface():\n            request_iface = self.registry.queryUtility(IRouteRequest, name=name)\n            if request_iface is None:\n                if use_global_views:\n                    bases = (IRequest,)\n                else:\n                    bases = ()\n                request_iface = route_request_iface(name, bases)\n                self.registry.registerUtility(\n                    request_iface, IRouteRequest, name=name)\n\n        def register_connect():\n            pvals = predicates.copy()\n            pvals.update(\n                dict(\n                    xhr=xhr,\n                    request_method=request_method,\n                    path_info=path_info,\n                    request_param=request_param,\n                    header=header,\n                    accept=accept,\n                    traverse=traverse,\n                    custom=predvalseq(custom_predicates),\n                    )\n                )\n\n            predlist = self.get_predlist('route')\n            _, preds, _ = predlist.make(self, **pvals)\n            route = mapper.connect(\n                name, pattern, factory, predicates=preds,\n                pregenerator=pregenerator, static=static\n                )\n            intr['object'] = route\n            return route\n\n        # We have to connect routes in the order they were provided;\n        # we can't use a phase to do that, because when the actions are\n        # sorted, actions in the same phase lose relative ordering\n        self.action(('route-connect', name), register_connect)\n\n        # But IRouteRequest interfaces must be registered before we begin to\n        # process view registrations (in phase 3)\n        self.action(('route', name), register_route_request_iface,\n                    order=PHASE2_CONFIG, introspectables=introspectables)\n\n    @action_method\n    def add_route_predicate(self, name, factory, weighs_more_than=None,\n                           weighs_less_than=None):\n        \"\"\" Adds a route predicate factory.  The view predicate can later be\n        named as a keyword argument to\n        :meth:`pyramid.config.Configurator.add_route`.\n\n        ``name`` should be the name of the predicate.  It must be a valid\n        Python identifier (it will be used as a keyword argument to\n        ``add_view``).\n\n        ``factory`` should be a :term:`predicate factory` or :term:`dotted\n        Python name` which refers to a predicate factory.\n\n        See :ref:`view_and_route_predicates` for more information.\n\n        .. versionadded:: 1.4\n        \"\"\"\n        self._add_predicate(\n            'route',\n            name,\n            factory,\n            weighs_more_than=weighs_more_than,\n            weighs_less_than=weighs_less_than\n            )\n\n    def add_default_route_predicates(self):\n        p = pyramid.config.predicates\n        for (name, factory) in (\n            ('xhr', p.XHRPredicate),\n            ('request_method', p.RequestMethodPredicate),\n            ('path_info', p.PathInfoPredicate),\n            ('request_param', p.RequestParamPredicate),\n            ('header', p.HeaderPredicate),\n            ('accept', p.AcceptPredicate),\n            ('effective_principals', p.EffectivePrincipalsPredicate),\n            ('custom', p.CustomPredicate),\n            ('traverse', p.TraversePredicate),\n            ):\n            self.add_route_predicate(name, factory)\n\n    def get_routes_mapper(self):\n        \"\"\" Return the :term:`routes mapper` object associated with\n        this configurator's :term:`registry`.\"\"\"\n        mapper = self.registry.queryUtility(IRoutesMapper)\n        if mapper is None:\n            mapper = RoutesMapper()\n            self.registry.registerUtility(mapper, IRoutesMapper)\n        return mapper\n\n"}
A user will ask you to solve a task. You should first draft your thinking process (inner monologue). Then, generate the solution.

Your response format must follow the template below:
<think>
Your thoughts or/and draft, like working through an exercise on scratch paper. Be as casual and as long as you want until you are confident to generate a correct solution.
</think>
<solution>
Final solution presented to the user.
</solution>
system
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
### Route Path Includes Unwanted Trailing Slash When Adding Route with Empty Path and Prefix

**Description**

When adding a route with an empty string as the path while a `route_prefix` is set, the resulting route path incorrectly includes a trailing slash. This leads to inconsistencies in URL routing, where the base URL unexpectedly ends with a slash.

**Buggy Code Example**

```python
from pyramid.config import Configurator

config = Configurator(autocommit=True)
config.route_prefix = 'root'
config.add_route('home', '')
mapper = config.get_routes_mapper()
route = mapper.get_routes()[0]
print(route.path)  # Outputs: 'root/'
```

**Expected Behavior**

The route path should be `'root'` without a trailing slash when an empty string is provided as the path.

**Actual Behavior**

The route path is `'root/'` with a trailing slash, which is not the intended behavior and can cause routing issues.

[/ISSUE]
--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.

--- BEGIN FILE ---
```
### pyramid/config/routes.py
import warnings

from pyramid.compat import urlparse
from pyramid.interfaces import (
    IRequest,
    IRouteRequest,
    IRoutesMapper,
    PHASE2_CONFIG,
    )

from pyramid.exceptions import ConfigurationError
from pyramid.registry import predvalseq
from pyramid.request import route_request_iface
from pyramid.urldispatch import RoutesMapper

from pyramid.config.util import (
    action_method,
    as_sorted_tuple,
    )

import pyramid.config.predicates

class RoutesConfiguratorMixin(object):
    @action_method
    def add_route(self,
                  name,
                  pattern=None,
                  permission=None,
                  factory=None,
                  for_=None,
                  header=None,
                  xhr=None,
                  accept=None,
                  path_info=None,
                  request_method=None,
                  request_param=None,
                  traverse=None,
                  custom_predicates=(),
                  use_global_views=False,
                  path=None,
                  pregenerator=None,
                  static=False,
                  **predicates):
        """ Add a :term:`route configuration` to the current
        configuration state, as well as possibly a :term:`view
        configuration` to be used to specify a :term:`view callable`
        that will be invoked when this route matches.  The arguments
        to this method are divided into *predicate*, *non-predicate*,
        and *view-related* types.  :term:`Route predicate` arguments
        narrow the circumstances in which a route will be match a
        request; non-predicate arguments are informational.

        Non-Predicate Arguments

        name

          The name of the route, e.g. ``myroute``.  This attribute is
          required.  It must be unique among all defined routes in a given
          application.

        factory

          A Python object (often a function or a class) or a :term:`dotted
          Python name` which refers to the same object that will generate a
          :app:`Pyramid` root resource object when this route matches. For
          example, ``mypackage.resources.MyFactory``.  If this argument is
          not specified, a default root factory will be used.  See
          :ref:`the_resource_tree` for more information about root factories.

        traverse

          If you would like to cause the :term:`context` to be
          something other than the :term:`root` object when this route
          matches, you can spell a traversal pattern as the
          ``traverse`` argument.  This traversal pattern will be used
          as the traversal path: traversal will begin at the root
          object implied by this route (either the global root, or the
          object returned by the ``factory`` associated with this
          route).

          The syntax of the ``traverse`` argument is the same as it is
          for ``pattern``. For example, if the ``pattern`` provided to
          ``add_route`` is ``articles/{article}/edit``, and the
          ``traverse`` argument provided to ``add_route`` is
          ``/{article}``, when a request comes in that causes the route
          to match in such a way that the ``article`` match value is
          ``'1'`` (when the request URI is ``/articles/1/edit``), the
          traversal path will be generated as ``/1``.  This means that
          the root object's ``__getitem__`` will be called with the
          name ``'1'`` during the traversal phase.  If the ``'1'`` object
          exists, it will become the :term:`context` of the request.
          :ref:`traversal_chapter` has more information about
          traversal.

          If the traversal path contains segment marker names which
          are not present in the ``pattern`` argument, a runtime error
          will occur.  The ``traverse`` pattern should not contain
          segment markers that do not exist in the ``pattern``
          argument.

          A similar combining of routing and traversal is available
          when a route is matched which contains a ``*traverse``
          remainder marker in its pattern (see
          :ref:`using_traverse_in_a_route_pattern`).  The ``traverse``
          argument to add_route allows you to associate route patterns
          with an arbitrary traversal path without using a
          ``*traverse`` remainder marker; instead you can use other
          match information.

          Note that the ``traverse`` argument to ``add_route`` is
          ignored when attached to a route that has a ``*traverse``
          remainder marker in its pattern.

        pregenerator

           This option should be a callable object that implements the
           :class:`pyramid.interfaces.IRoutePregenerator` interface.  A
           :term:`pregenerator` is a callable called by the
           :meth:`pyramid.request.Request.route_url` function to augment or
           replace the arguments it is passed when generating a URL for the
           route.  This is a feature not often used directly by applications,
           it is meant to be hooked by frameworks that use :app:`Pyramid` as
           a base.

        use_global_views

          When a request matches this route, and view lookup cannot
          find a view which has a ``route_name`` predicate argument
          that matches the route, try to fall back to using a view
          that otherwise matches the context, request, and view name
          (but which does not match the route_name predicate).

        static

          If ``static`` is ``True``, this route will never match an incoming
          request; it will only be useful for URL generation.  By default,
          ``static`` is ``False``.  See :ref:`static_route_narr`.

          .. versionadded:: 1.1

        Predicate Arguments

        pattern

          The pattern of the route e.g. ``ideas/{idea}``.  This
          argument is required.  See :ref:`route_pattern_syntax`
          for information about the syntax of route patterns.  If the
          pattern doesn't match the current URL, route matching
          continues.

          .. note::

             For backwards compatibility purposes (as of :app:`Pyramid` 1.0), a
             ``path`` keyword argument passed to this function will be used to
             represent the pattern value if the ``pattern`` argument is
             ``None``.  If both ``path`` and ``pattern`` are passed, ``pattern``
             wins.

        xhr

          This value should be either ``True`` or ``False``.  If this
          value is specified and is ``True``, the :term:`request` must
          possess an ``HTTP_X_REQUESTED_WITH`` (aka
          ``X-Requested-With``) header for this route to match.  This
          is useful for detecting AJAX requests issued from jQuery,
          Prototype and other Javascript libraries.  If this predicate
          returns ``False``, route matching continues.

        request_method

          A string representing an HTTP method name, e.g. ``GET``, ``POST``,
          ``HEAD``, ``DELETE``, ``PUT`` or a tuple of elements containing
          HTTP method names.  If this argument is not specified, this route
          will match if the request has *any* request method.  If this
          predicate returns ``False``, route matching continues.

          .. versionchanged:: 1.2
             The ability to pass a tuple of items as ``request_method``.
             Previous versions allowed only a string.

        path_info

          This value represents a regular expression pattern that will
          be tested against the ``PATH_INFO`` WSGI environment
          variable.  If the regex matches, this predicate will return
          ``True``.  If this predicate returns ``False``, route
          matching continues.

        request_param

          This value can be any string.  A view declaration with this
          argument ensures that the associated route will only match
          when the request has a key in the ``request.params``
          dictionary (an HTTP ``GET`` or ``POST`` variable) that has a
          name which matches the supplied value.  If the value
          supplied as the argument has a ``=`` sign in it,
          e.g. ``request_param="foo=123"``, then the key
          (``foo``) must both exist in the ``request.params`` dictionary, and
          the value must match the right hand side of the expression (``123``)
          for the route to "match" the current request.  If this predicate
          returns ``False``, route matching continues.

        header

          This argument represents an HTTP header name or a header
          name/value pair.  If the argument contains a ``:`` (colon),
          it will be considered a name/value pair
          (e.g. ``User-Agent:Mozilla/.*`` or ``Host:localhost``).  If
          the value contains a colon, the value portion should be a
          regular expression.  If the value does not contain a colon,
          the entire value will be considered to be the header name
          (e.g. ``If-Modified-Since``).  If the value evaluates to a
          header name only without a value, the header specified by
          the name must be present in the request for this predicate
          to be true.  If the value evaluates to a header name/value
          pair, the header specified by the name must be present in
          the request *and* the regular expression specified as the
          value must match the header value.  Whether or not the value
          represents a header name or a header name/value pair, the
          case of the header name is not significant.  If this
          predicate returns ``False``, route matching continues.

        accept

          This value represents a match query for one or more
          mimetypes in the ``Accept`` HTTP request header.  If this
          value is specified, it must be in one of the following
          forms: a mimetype match token in the form ``text/plain``, a
          wildcard mimetype match token in the form ``text/*`` or a
          match-all wildcard mimetype match token in the form ``*/*``.
          If any of the forms matches the ``Accept`` header of the
          request, or if the ``Accept`` header isn't set at all in the
          request, this predicate will be true. If this predicate
          returns ``False``, route matching continues.

        effective_principals

          If specified, this value should be a :term:`principal` identifier or
          a sequence of principal identifiers.  If the
          :attr:`pyramid.request.Request.effective_principals` property
          indicates that every principal named in the argument list is present
          in the current request, this predicate will return True; otherwise it
          will return False.  For example:
          ``effective_principals=pyramid.security.Authenticated`` or
          ``effective_principals=('fred', 'group:admins')``.

          .. versionadded:: 1.4a4

        custom_predicates

          .. deprecated:: 1.5
              This value should be a sequence of references to custom
              predicate callables.  Use custom predicates when no set of
              predefined predicates does what you need.  Custom predicates
              can be combined with predefined predicates as necessary.
              Each custom predicate callable should accept two arguments:
              ``info`` and ``request`` and should return either ``True``
              or ``False`` after doing arbitrary evaluation of the info
              and/or the request.  If all custom and non-custom predicate
              callables return ``True`` the associated route will be
              considered viable for a given request.  If any predicate
              callable returns ``False``, route matching continues.  Note
              that the value ``info`` passed to a custom route predicate
              is a dictionary containing matching information; see
              :ref:`custom_route_predicates` for more information about
              ``info``.

        predicates

          Pass a key/value pair here to use a third-party predicate
          registered via
          :meth:`pyramid.config.Configurator.add_view_predicate`.  More than
          one key/value pair can be used at the same time.  See
          :ref:`view_and_route_predicates` for more information about
          third-party predicates.

          .. versionadded:: 1.4

        """
        if custom_predicates:
            warnings.warn(
                ('The "custom_predicates" argument to Configurator.add_route '
                 'is deprecated as of Pyramid 1.5.  Use '
                 '"config.add_route_predicate" and use the registered '
                 'route predicate as a predicate argument to add_route '
                 'instead. See "Adding A Third Party View, Route, or '
                 'Subscriber Predicate" in the "Hooks" chapter of the '
                 'documentation for more information.'),
                DeprecationWarning,
                stacklevel=3
                )
        # these are route predicates; if they do not match, the next route
        # in the routelist will be tried
        if request_method is not None:
            request_method = as_sorted_tuple(request_method)

        factory = self.maybe_dotted(factory)
        if pattern is None:
            pattern = path
        if pattern is None:
            raise ConfigurationError('"pattern" argument may not be None')

        # check for an external route; an external route is one which is
        # is a full url (e.g. 'http://example.com/{id}')
        parsed = urlparse.urlparse(pattern)
        if parsed.hostname:
            pattern = parsed.path

            original_pregenerator = pregenerator
            def external_url_pregenerator(request, elements, kw):
                if '_app_url' in kw:
                    raise ValueError(
                        'You cannot generate a path to an external route '
                        'pattern via request.route_path nor pass an _app_url '
                        'to request.route_url when generating a URL for an '
                        'external route pattern (pattern was "%s") ' %
                        (pattern,)
                        )
                if '_scheme' in kw:
                    scheme = kw['_scheme']
                elif parsed.scheme:
                    scheme = parsed.scheme
                else:
                    scheme = request.scheme
                kw['_app_url'] = '{0}://{1}'.format(scheme, parsed.netloc)

                if original_pregenerator:
                    elements, kw = original_pregenerator(
                        request, elements, kw)
                return elements, kw

            pregenerator = external_url_pregenerator
            static = True

        elif self.route_prefix:
            pattern = self.route_prefix.rstrip('/') + '/' + pattern.lstrip('/')

        mapper = self.get_routes_mapper()

        introspectables = []

        intr = self.introspectable('routes',
                                   name,
                                   '%s (pattern: %r)' % (name, pattern),
                                   'route')
        intr['name'] = name
        intr['pattern'] = pattern
        intr['factory'] = factory
        intr['xhr'] = xhr
        intr['request_methods'] = request_method
        intr['path_info'] = path_info
        intr['request_param'] = request_param
        intr['header'] = header
        intr['accept'] = accept
        intr['traverse'] = traverse
        intr['custom_predicates'] = custom_predicates
        intr['pregenerator'] = pregenerator
        intr['static'] = static
        intr['use_global_views'] = use_global_views
        introspectables.append(intr)

        if factory:
            factory_intr = self.introspectable('root factories',
                                               name,
                                               self.object_description(factory),
                                               'root factory')
            factory_intr['factory'] = factory
            factory_intr['route_name'] = name
            factory_intr.relate('routes', name)
            introspectables.append(factory_intr)

        def register_route_request_iface():
            request_iface = self.registry.queryUtility(IRouteRequest, name=name)
            if request_iface is None:
                if use_global_views:
                    bases = (IRequest,)
                else:
                    bases = ()
                request_iface = route_request_iface(name, bases)
                self.registry.registerUtility(
                    request_iface, IRouteRequest, name=name)

        def register_connect():
            pvals = predicates.copy()
            pvals.update(
                dict(
                    xhr=xhr,
                    request_method=request_method,
                    path_info=path_info,
                    request_param=request_param,
                    header=header,
                    accept=accept,
                    traverse=traverse,
                    custom=predvalseq(custom_predicates),
                    )
                )

            predlist = self.get_predlist('route')
            _, preds, _ = predlist.make(self, **pvals)
            route = mapper.connect(
                name, pattern, factory, predicates=preds,
                pregenerator=pregenerator, static=static
                )
            intr['object'] = route
            return route

        # We have to connect routes in the order they were provided;
        # we can't use a phase to do that, because when the actions are
        # sorted, actions in the same phase lose relative ordering
        self.action(('route-connect', name), register_connect)

        # But IRouteRequest interfaces must be registered before we begin to
        # process view registrations (in phase 3)
        self.action(('route', name), register_route_request_iface,
                    order=PHASE2_CONFIG, introspectables=introspectables)

    @action_method
    def add_route_predicate(self, name, factory, weighs_more_than=None,
                           weighs_less_than=None):
        """ Adds a route predicate factory.  The view predicate can later be
        named as a keyword argument to
        :meth:`pyramid.config.Configurator.add_route`.

        ``name`` should be the name of the predicate.  It must be a valid
        Python identifier (it will be used as a keyword argument to
        ``add_view``).

        ``factory`` should be a :term:`predicate factory` or :term:`dotted
        Python name` which refers to a predicate factory.

        See :ref:`view_and_route_predicates` for more information.

        .. versionadded:: 1.4
        """
        self._add_predicate(
            'route',
            name,
            factory,
            weighs_more_than=weighs_more_than,
            weighs_less_than=weighs_less_than
            )

    def add_default_route_predicates(self):
        p = pyramid.config.predicates
        for (name, factory) in (
            ('xhr', p.XHRPredicate),
            ('request_method', p.RequestMethodPredicate),
            ('path_info', p.PathInfoPredicate),
            ('request_param', p.RequestParamPredicate),
            ('header', p.HeaderPredicate),
            ('accept', p.AcceptPredicate),
            ('effective_principals', p.EffectivePrincipalsPredicate),
            ('custom', p.CustomPredicate),
            ('traverse', p.TraversePredicate),
            ):
            self.add_route_predicate(name, factory)

    def get_routes_mapper(self):
        """ Return the :term:`routes mapper` object associated with
        this configurator's :term:`registry`."""
        mapper = self.registry.queryUtility(IRoutesMapper)
        if mapper is None:
            mapper = RoutesMapper()
            self.registry.registerUtility(mapper, IRoutesMapper)
        return mapper


```
--- END FILE ---

Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.

Every *SEARCH/REPLACE* edit must use this format:
1. The file path
2. The start of search block: <<<<<<< SEARCH
3. A contiguous chunk of lines to search for in the existing source code
4. The dividing line: =======
5. The lines to replace into the source code
6. The end of the replace block: >>>>>>> REPLACE

Here is an example:

```python
### mathweb/flask/app.py
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
</solution>

Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
Wrap each *SEARCH/REPLACE* edit in a code block as shown in the example above. If you have multiple *SEARCH/REPLACE* edits, use a separate code block for each one.
user