{
    "file_diffs": [
        {
            "old_file_content": "Next Release\n============\n\nFeatures\n--------\n\n- Users can now provide dotted Python names to as the ``factory`` argument\n  the Configurator methods named ``add_{view,route,subscriber}_predicate`` \n  (instead of passing the predicate factory directly, you can pass a \n  dotted name which refers to the factory).\n\nBug Fixes\n---------\n\n- Fix an exception in ``pyramid.path.package_name`` when resolving the package\n  name for namespace packages that had no ``__file__`` attribute.\n\nBackwards Incompatibilities\n---------------------------\n\n- Pyramid has dropped native support for the Mako and Chameleon renderers. To\n  re-add support for these renderers into existing projects there are 3 steps:\n\n  - Add `pyramid_mako` and/or `pyramid_chameleon` as dependencies by\n    adding them to the `install_requires` section of the package's `setup.py`::\n\n        setup(\n            #...\n            install_requires=[\n                'pyramid_mako',         # new dependency\n                'pyramid_chameleon',    # new dependency\n                'pyramid',\n                #...\n            ],\n        )\n\n  - Update instances of the ``pyramid.config.Configurator`` to include the\n    required addons::\n\n        config.include('pyramid_chameleon')\n        config.include('pyramid_mako')\n\n  - If any unit tests are invoking either ``pyramid.renderers.render()`` or\n    ``pyramid.renderers.render_to_response()`` with either Mako or Chameleon\n    templates then the ``pyramid.config.Configurator`` instance at the root of\n    the unit test should be also be updated to include the addons, as shown\n    above. For example::\n\n        config = pyramid.testing.setUp()\n        config.include('pyramid_mako')\n\n        result = pyramid.renderers.render('mypkg:templates/home.mako', {})\n\n- Removed the ``request.response_*`` varying attributes. These attributes\n  have been deprecated since Pyramid 1.1, and as per the deprecation policy,\n  have now been removed.\n\n- ``request.response`` will no longer be mutated when using the \n  ``pyramid.renderers.render()`` API.  Almost all renderers mutate the \n  ``request.response`` response object (for example, the JSON renderer sets\n  ``request.response.content_type`` to ``application/json``), but this is\n  only necessary when the renderer is generating a response; it was a bug\n  when it was done as a side effect of calling ``pyramid.renderers.render()``.\n\n- The Mako and Chameleon renderers have been removed from Pyramid.  Their \n  functionality has been moved to  the ``pyramid_mako`` and \n  ``pyramid_chameleon`` distributions respectively.\n\n- Removed the ``bfg2pyramid`` fixer script.\n\n- The ``pyramid.events.NewResponse`` event is now sent **after** response \n  callbacks are executed.  It previously executed before response callbacks\n  were executed.  Rationale: it's more useful to be able to inspect the response\n  after response callbacks have done their jobs instead of before.\n\n- Removed the class named ``pyramid.view.static`` that had been deprecated\n  since Pyramid 1.1.  Instead use ``pyramid.static.static_view`` with\n  ``use_subpath=True`` argument.\n\n- Removed the ``pyramid.view.is_response`` function that had been deprecated\n  since Pyramid 1.1.  Use the ``pyramid.request.Request.is_response`` method\n  instead.\n\n- Removed the ability to pass the following arguments to\n  ``pyramid.config.Configurator.add_route``: `view``, ``view_context``.\n  ``view_for``, ``view_permission``, ``view_renderer``, and ``view_attr``.\n  Using these arguments had been deprecated since Pyramid 1.1.  Instead of\n  passing view-related arguments to ``add_route``, use a separate call to\n  ``pyramid.config.Configurator.add_view`` to associate a view with a route\n  using its ``route_name`` argument.  Note that this impacts the\n  ``pyramid.config.Configurator.add_static_view`` function too, because it\n  delegates to ``add_route``.\n\n- Removed the ability to influence and query a ``pyramid.request.Request``\n  object as if it were a dictionary.  Previously it was possible to use methods\n  like ``__getitem__``, ``get``, ``items``, and other dictlike methods to\n  access values in the WSGI environment.  This behavior had been deprecated\n  since Pyramid 1.1.  Use methods of ``request.environ`` (a real dictionary)\n  instead.\n\n1.5a1 (2013-08-30)\n==================\n\nFeatures\n--------\n\n- A new http exception subclass named ``pyramid.httpexceptions.HTTPSuccessful``\n  was added.  You can use this class as the ``context`` of an exception\n  view to catch all 200-series \"exceptions\" (e.g. \"raise HTTPOk\").  This \n  also allows you to catch *only* the ``HTTPOk`` exception itself; previously\n  this was impossible because a number of other exceptions \n  (such as ``HTTPNoContent``) inherited from ``HTTPOk``, but now they do not.\n\n- You can now generate \"hybrid\" urldispatch/traversal URLs more easily\n  by using the new ``route_name``, ``route_kw`` and ``route_remainder_name`` \n  arguments to  ``request.resource_url`` and ``request.resource_path``.  See\n  the new section of the \"Combining Traversal and URL Dispatch\" documentation \n  chapter entitled  \"Hybrid URL Generation\".\n\n- It is now possible to escape double braces in Pyramid scaffolds (unescaped, \n  these represent replacement values).  You can use ``\\{\\{a\\}\\}`` to\n  represent a \"bare\" ``{{a}}``.  See \n  https://github.com/Pylons/pyramid/pull/862\n\n- Add ``localizer`` and ``locale_name`` properties (reified) to the request.\n  See https://github.com/Pylons/pyramid/issues/508.  Note that the \n  ``pyramid.i18n.get_localizer`` and ``pyramid.i18n.get_locale_name`` functions\n  now simply look up these properties on the request.\n\n- Add ``pdistreport`` script, which prints the Python version in use, the\n  Pyramid version in use, and the version number and location of all Python\n  distributions currently installed.\n\n- Add the ability to invert the result of any view, route, or subscriber\n  predicate using the ``not_`` class.  For example::\n\n     from pyramid.config import not_\n\n     @view_config(route_name='myroute', request_method=not_('POST'))\n     def myview(request): ...\n\n  The above example will ensure that the view is called if the request method\n  is not POST (at least if no other view is more specific).\n\n  The :class:`pyramid.config.not_` class can be used against any value that is\n  a predicate value passed in any of these contexts:\n\n  - ``pyramid.config.Configurator.add_view``\n\n  - ``pyramid.config.Configurator.add_route``\n\n  - ``pyramid.config.Configurator.add_subscriber``\n\n  - ``pyramid.view.view_config``\n\n  - ``pyramid.events.subscriber``\n\n- ``scripts/prequest.py``: add support for submitting ``PUT`` and ``PATCH``\n  requests.  See https://github.com/Pylons/pyramid/pull/1033.  add support for\n  submitting ``OPTIONS`` and ``PROPFIND`` requests, and  allow users to specify\n  basic authentication credentials in the request via a ``--login`` argument to\n  the script.  See https://github.com/Pylons/pyramid/pull/1039.\n\n- ``ACLAuthorizationPolicy`` supports ``__acl__`` as a callable. This\n  removes the ambiguity between the potential ``AttributeError`` that would\n  be raised on the ``context`` when the property was not defined and the\n  ``AttributeError`` that could be raised from any user-defined code within\n  a dynamic property. It is recommended to define a dynamic ACL as a callable\n  to avoid this ambiguity. See https://github.com/Pylons/pyramid/issues/735.\n\n- Allow a protocol-relative URL (e.g. ``//example.com/images``) to be passed to\n  ``pyramid.config.Configurator.add_static_view``. This allows\n  externally-hosted static URLs to be generated based on the current protocol.\n\n- The ``AuthTktAuthenticationPolicy`` has two new options to configure its\n  domain usage: \n\n  * ``parent_domain``: if set the authentication cookie is set on\n    the parent domain. This is useful if you have multiple sites sharing the\n    same domain.\n  * ``domain``: if provided the cookie is always set for this domain, bypassing\n    all usual logic.\n\n  See https://github.com/Pylons/pyramid/pull/1028,\n  https://github.com/Pylons/pyramid/pull/1072 and\n  https://github.com/Pylons/pyramid/pull/1078.\n\n- The ``AuthTktAuthenticationPolicy`` now supports IPv6 addresses when using\n  the ``include_ip=True`` option. This is possibly incompatible with\n  alternative ``auth_tkt`` implementations, as the specification does not\n  define how to properly handle IPv6. See\n  https://github.com/Pylons/pyramid/issues/831.\n\n- Make it possible to use variable arguments via\n  ``pyramid.paster.get_appsettings``. This also allowed the generated\n  ``initialize_db`` script from the ``alchemy`` scaffold to grow support\n  for options in the form ``a=1 b=2`` so you can fill in\n  values in a parameterized ``.ini`` file, e.g.\n  ``initialize_myapp_db etc/development.ini a=1 b=2``.\n  See https://github.com/Pylons/pyramid/pull/911\n\n- The ``request.session.check_csrf_token()`` method and the ``check_csrf`` view\n  predicate now take into account the value of the HTTP header named\n  ``X-CSRF-Token`` (as well as the ``csrf_token`` form parameter, which they\n  always did).  The header is tried when the form parameter does not exist.\n\n- View lookup will now search for valid views based on the inheritance\n  hierarchy of the context. It tries to find views based on the most\n  specific context first, and upon predicate failure, will move up the\n  inheritance chain to test views found by the super-type of the context.\n  In the past, only the most specific type containing views would be checked\n  and if no matching view could be found then a PredicateMismatch would be\n  raised. Now predicate mismatches don't hide valid views registered on\n  super-types. Here's an example that now works:\n\n  .. code-block:: python\n\n     class IResource(Interface):\n\n         ...\n\n     @view_config(context=IResource)\n     def get(context, request):\n\n         ...\n\n     @view_config(context=IResource, request_method='POST')\n     def post(context, request):\n\n         ...\n\n     @view_config(context=IResource, request_method='DELETE')\n     def delete(context, request):\n\n         ...\n\n     @implementer(IResource)\n     class MyResource:\n\n         ...\n\n     @view_config(context=MyResource, request_method='POST')\n     def override_post(context, request):\n\n         ...\n\n  Previously the override_post view registration would hide the get\n  and delete views in the context of MyResource -- leading to a\n  predicate mismatch error when trying to use GET or DELETE\n  methods. Now the views are found and no predicate mismatch is\n  raised.\n  See https://github.com/Pylons/pyramid/pull/786 and\n  https://github.com/Pylons/pyramid/pull/1004 and\n  https://github.com/Pylons/pyramid/pull/1046\n\n- The ``pserve`` command now takes a ``-v`` (or ``--verbose``) flag and a\n  ``-q`` (or ``--quiet``) flag.  Output from running ``pserve`` can be\n  controlled using these flags.  ``-v`` can be specified multiple times to\n  increase verbosity.  ``-q`` sets verbosity to ``0`` unconditionally.  The\n  default verbosity level is ``1``.\n\n- The ``alchemy`` scaffold tests now provide better coverage.  See\n  https://github.com/Pylons/pyramid/pull/1029\n\n- The ``pyramid.config.Configurator.add_route`` method now supports being\n  called with an external URL as pattern. See\n  https://github.com/Pylons/pyramid/issues/611 and the documentation section \n  in the \"URL Dispatch\" chapter entitled \"External Routes\" for more information.\n\nBug Fixes\n---------\n\n- It was not possible to use ``pyramid.httpexceptions.HTTPException`` as\n  the ``context`` of an exception view as very general catchall for\n  http-related exceptions when you wanted that exception view to override the \n  default exception view.  See https://github.com/Pylons/pyramid/issues/985\n\n- When the ``pyramid.reload_templates`` setting was true, and a Chameleon \n  template was reloaded, and the renderer specification named a macro \n  (e.g. ``foo#macroname.pt``), renderings of the template after the template\n  was reloaded due to a file change would produce the entire template body \n  instead of just a rendering of the macro.  See \n  https://github.com/Pylons/pyramid/issues/1013.\n\n- Fix an obscure problem when combining a virtual root with a route with a \n  ``*traverse`` in its pattern.  Now the traversal path generated in\n  such a configuration will be correct, instead of an element missing\n  a leading slash.\n\n- Fixed a Mako renderer bug returning a tuple with a previous defname value\n  in some circumstances. See https://github.com/Pylons/pyramid/issues/1037\n  for more information.\n\n- Make the ``pyramid.config.assets.PackageOverrides`` object implement the API\n  for ``__loader__`` objects specified in PEP 302.  Proxies to the\n  ``__loader__`` set by the importer, if present; otherwise, raises\n  ``NotImplementedError``.  This makes Pyramid static view overrides work\n  properly under Python 3.3 (previously they would not).  See\n  https://github.com/Pylons/pyramid/pull/1015 for more information.\n\n- ``mako_templating``: added defensive workaround for non-importability of\n  ``mako`` due to upstream ``markupsafe`` dropping Python 3.2 support.  Mako\n  templating will no longer work under the combination of MarkupSafe 0.17 and\n  Python 3.2 (although the combination of MarkupSafe 0.17 and Python 3.3 or any\n  supported Python 2 version will work OK).\n\n- Spaces and dots may now be in mako renderer template paths. This was\n  broken when support for the new makodef syntax was added in 1.4a1.\n  See https://github.com/Pylons/pyramid/issues/950\n\n- ``pyramid.debug_authorization=true`` will now correctly print out\n  ``Allowed`` for views registered with ``NO_PERMISSION_REQUIRED`` instead\n  of invoking the ``permits`` method of the authorization policy.\n  See https://github.com/Pylons/pyramid/issues/954\n\n- Pyramid failed to install on some systems due to being packaged with\n  some test files containing higher order characters in their names. These\n  files have now been removed. See\n  https://github.com/Pylons/pyramid/issues/981\n\n- ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under\n  Python 3 would use ``__len__`` to find truthiness; this usually caused an\n  instance of DummyResource to be \"falsy\" instead of \"truthy\".  See\n  https://github.com/Pylons/pyramid/pull/1032\n\n- The ``alchemy`` scaffold would break when the database was MySQL during\n  tables creation.  See https://github.com/Pylons/pyramid/pull/1049\n\n- The ``current_route_url`` method now attaches the query string to the URL by\n  default. See\n  https://github.com/Pylons/pyramid/issues/1040\n\n- Make ``pserve.cherrypy_server_runner`` Python 3 compatible. See\n  https://github.com/Pylons/pyramid/issues/718\n\nBackwards Incompatibilities\n---------------------------\n\n- Modified the ``current_route_url`` method in pyramid.Request. The method\n  previously returned the URL without the query string by default, it now does\n  attach the query string unless it is overriden.\n\n- The ``route_url`` and ``route_path`` APIs no longer quote ``/`` \n  to ``%2F`` when a replacement value contains a ``/``.  This was pointless,\n  as WSGI servers always unquote the slash anyway, and Pyramid never sees the \n  quoted value.\n\n- It is no longer possible to set a ``locale_name`` attribute of the request, \n  nor is it possible to set a ``localizer`` attribute of the request.  These\n  are now \"reified\" properties that look up a locale name and localizer\n  respectively using the machinery described in the \"Internationalization\"\n  chapter of the documentation.\n\n- If you send an ``X-Vhm-Root`` header with a value that ends with a slash (or\n  any number of slashes), the trailing slash(es) will be removed before a URL\n  is generated when you use use ``request.resource_url`` or\n  ``request.resource_path``.  Previously the virtual root path would not have\n  trailing slashes stripped, which would influence URL generation.\n\n- The ``pyramid.interfaces.IResourceURL`` interface has now grown two new\n  attributes: ``virtual_path_tuple`` and ``physical_path_tuple``.  These should\n  be the tuple form of the resource's path (physical and virtual).\n\n",
            "new_file_content": "Next Release\n============\n\nFeatures\n--------\n\n- Users can now provide dotted Python names to as the ``factory`` argument\n  the Configurator methods named ``add_{view,route,subscriber}_predicate`` \n  (instead of passing the predicate factory directly, you can pass a \n  dotted name which refers to the factory).\n\nBug Fixes\n---------\n\n- Fix an exception in ``pyramid.path.package_name`` when resolving the package\n  name for namespace packages that had no ``__file__`` attribute.\n\nBackwards Incompatibilities\n---------------------------\n\n- Pyramid has dropped native support for the Mako and Chameleon renderers. To\n  re-add support for these renderers into existing projects there are 3 steps:\n\n  - Add `pyramid_mako` and/or `pyramid_chameleon` as dependencies by\n    adding them to the `install_requires` section of the package's `setup.py`::\n\n        setup(\n            #...\n            install_requires=[\n                'pyramid_mako',         # new dependency\n                'pyramid_chameleon',    # new dependency\n                'pyramid',\n                #...\n            ],\n        )\n\n  - Update instances of the ``pyramid.config.Configurator`` to include the\n    required addons::\n\n        config.include('pyramid_chameleon')\n        config.include('pyramid_mako')\n\n  - If any unit tests are invoking either ``pyramid.renderers.render()`` or\n    ``pyramid.renderers.render_to_response()`` with either Mako or Chameleon\n    templates then the ``pyramid.config.Configurator`` instance at the root of\n    the unit test should be also be updated to include the addons, as shown\n    above. For example::\n\n        config = pyramid.testing.setUp()\n        config.include('pyramid_mako')\n\n        result = pyramid.renderers.render('mypkg:templates/home.mako', {})\n\n- Removed the ``request.response_*`` varying attributes. These attributes\n  have been deprecated since Pyramid 1.1, and as per the deprecation policy,\n  have now been removed.\n\n- ``request.response`` will no longer be mutated when using the \n  ``pyramid.renderers.render()`` API.  Almost all renderers mutate the \n  ``request.response`` response object (for example, the JSON renderer sets\n  ``request.response.content_type`` to ``application/json``), but this is\n  only necessary when the renderer is generating a response; it was a bug\n  when it was done as a side effect of calling ``pyramid.renderers.render()``.\n\n- The Mako and Chameleon renderers have been removed from Pyramid.  Their \n  functionality has been moved to  the ``pyramid_mako`` and \n  ``pyramid_chameleon`` distributions respectively.\n\n- Removed the ``bfg2pyramid`` fixer script.\n\n- The ``pyramid.events.NewResponse`` event is now sent **after** response \n  callbacks are executed.  It previously executed before response callbacks\n  were executed.  Rationale: it's more useful to be able to inspect the response\n  after response callbacks have done their jobs instead of before.\n\n- Removed the class named ``pyramid.view.static`` that had been deprecated\n  since Pyramid 1.1.  Instead use ``pyramid.static.static_view`` with\n  ``use_subpath=True`` argument.\n\n- Removed the ``pyramid.view.is_response`` function that had been deprecated\n  since Pyramid 1.1.  Use the ``pyramid.request.Request.is_response`` method\n  instead.\n\n- Removed the ability to pass the following arguments to\n  ``pyramid.config.Configurator.add_route``: `view``, ``view_context``.\n  ``view_for``, ``view_permission``, ``view_renderer``, and ``view_attr``.\n  Using these arguments had been deprecated since Pyramid 1.1.  Instead of\n  passing view-related arguments to ``add_route``, use a separate call to\n  ``pyramid.config.Configurator.add_view`` to associate a view with a route\n  using its ``route_name`` argument.  Note that this impacts the\n  ``pyramid.config.Configurator.add_static_view`` function too, because it\n  delegates to ``add_route``.\n\n- Removed the ability to influence and query a ``pyramid.request.Request``\n  object as if it were a dictionary.  Previously it was possible to use methods\n  like ``__getitem__``, ``get``, ``items``, and other dictlike methods to\n  access values in the WSGI environment.  This behavior had been deprecated\n  since Pyramid 1.1.  Use methods of ``request.environ`` (a real dictionary)\n  instead.\n\n- Removed ancient backwards compatibily hack in\n  ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of\n  the factory with the matchdict values for compatibility with BFG 0.9.\n\n1.5a1 (2013-08-30)\n==================\n\nFeatures\n--------\n\n- A new http exception subclass named ``pyramid.httpexceptions.HTTPSuccessful``\n  was added.  You can use this class as the ``context`` of an exception\n  view to catch all 200-series \"exceptions\" (e.g. \"raise HTTPOk\").  This \n  also allows you to catch *only* the ``HTTPOk`` exception itself; previously\n  this was impossible because a number of other exceptions \n  (such as ``HTTPNoContent``) inherited from ``HTTPOk``, but now they do not.\n\n- You can now generate \"hybrid\" urldispatch/traversal URLs more easily\n  by using the new ``route_name``, ``route_kw`` and ``route_remainder_name`` \n  arguments to  ``request.resource_url`` and ``request.resource_path``.  See\n  the new section of the \"Combining Traversal and URL Dispatch\" documentation \n  chapter entitled  \"Hybrid URL Generation\".\n\n- It is now possible to escape double braces in Pyramid scaffolds (unescaped, \n  these represent replacement values).  You can use ``\\{\\{a\\}\\}`` to\n  represent a \"bare\" ``{{a}}``.  See \n  https://github.com/Pylons/pyramid/pull/862\n\n- Add ``localizer`` and ``locale_name`` properties (reified) to the request.\n  See https://github.com/Pylons/pyramid/issues/508.  Note that the \n  ``pyramid.i18n.get_localizer`` and ``pyramid.i18n.get_locale_name`` functions\n  now simply look up these properties on the request.\n\n- Add ``pdistreport`` script, which prints the Python version in use, the\n  Pyramid version in use, and the version number and location of all Python\n  distributions currently installed.\n\n- Add the ability to invert the result of any view, route, or subscriber\n  predicate using the ``not_`` class.  For example::\n\n     from pyramid.config import not_\n\n     @view_config(route_name='myroute', request_method=not_('POST'))\n     def myview(request): ...\n\n  The above example will ensure that the view is called if the request method\n  is not POST (at least if no other view is more specific).\n\n  The :class:`pyramid.config.not_` class can be used against any value that is\n  a predicate value passed in any of these contexts:\n\n  - ``pyramid.config.Configurator.add_view``\n\n  - ``pyramid.config.Configurator.add_route``\n\n  - ``pyramid.config.Configurator.add_subscriber``\n\n  - ``pyramid.view.view_config``\n\n  - ``pyramid.events.subscriber``\n\n- ``scripts/prequest.py``: add support for submitting ``PUT`` and ``PATCH``\n  requests.  See https://github.com/Pylons/pyramid/pull/1033.  add support for\n  submitting ``OPTIONS`` and ``PROPFIND`` requests, and  allow users to specify\n  basic authentication credentials in the request via a ``--login`` argument to\n  the script.  See https://github.com/Pylons/pyramid/pull/1039.\n\n- ``ACLAuthorizationPolicy`` supports ``__acl__`` as a callable. This\n  removes the ambiguity between the potential ``AttributeError`` that would\n  be raised on the ``context`` when the property was not defined and the\n  ``AttributeError`` that could be raised from any user-defined code within\n  a dynamic property. It is recommended to define a dynamic ACL as a callable\n  to avoid this ambiguity. See https://github.com/Pylons/pyramid/issues/735.\n\n- Allow a protocol-relative URL (e.g. ``//example.com/images``) to be passed to\n  ``pyramid.config.Configurator.add_static_view``. This allows\n  externally-hosted static URLs to be generated based on the current protocol.\n\n- The ``AuthTktAuthenticationPolicy`` has two new options to configure its\n  domain usage: \n\n  * ``parent_domain``: if set the authentication cookie is set on\n    the parent domain. This is useful if you have multiple sites sharing the\n    same domain.\n  * ``domain``: if provided the cookie is always set for this domain, bypassing\n    all usual logic.\n\n  See https://github.com/Pylons/pyramid/pull/1028,\n  https://github.com/Pylons/pyramid/pull/1072 and\n  https://github.com/Pylons/pyramid/pull/1078.\n\n- The ``AuthTktAuthenticationPolicy`` now supports IPv6 addresses when using\n  the ``include_ip=True`` option. This is possibly incompatible with\n  alternative ``auth_tkt`` implementations, as the specification does not\n  define how to properly handle IPv6. See\n  https://github.com/Pylons/pyramid/issues/831.\n\n- Make it possible to use variable arguments via\n  ``pyramid.paster.get_appsettings``. This also allowed the generated\n  ``initialize_db`` script from the ``alchemy`` scaffold to grow support\n  for options in the form ``a=1 b=2`` so you can fill in\n  values in a parameterized ``.ini`` file, e.g.\n  ``initialize_myapp_db etc/development.ini a=1 b=2``.\n  See https://github.com/Pylons/pyramid/pull/911\n\n- The ``request.session.check_csrf_token()`` method and the ``check_csrf`` view\n  predicate now take into account the value of the HTTP header named\n  ``X-CSRF-Token`` (as well as the ``csrf_token`` form parameter, which they\n  always did).  The header is tried when the form parameter does not exist.\n\n- View lookup will now search for valid views based on the inheritance\n  hierarchy of the context. It tries to find views based on the most\n  specific context first, and upon predicate failure, will move up the\n  inheritance chain to test views found by the super-type of the context.\n  In the past, only the most specific type containing views would be checked\n  and if no matching view could be found then a PredicateMismatch would be\n  raised. Now predicate mismatches don't hide valid views registered on\n  super-types. Here's an example that now works:\n\n  .. code-block:: python\n\n     class IResource(Interface):\n\n         ...\n\n     @view_config(context=IResource)\n     def get(context, request):\n\n         ...\n\n     @view_config(context=IResource, request_method='POST')\n     def post(context, request):\n\n         ...\n\n     @view_config(context=IResource, request_method='DELETE')\n     def delete(context, request):\n\n         ...\n\n     @implementer(IResource)\n     class MyResource:\n\n         ...\n\n     @view_config(context=MyResource, request_method='POST')\n     def override_post(context, request):\n\n         ...\n\n  Previously the override_post view registration would hide the get\n  and delete views in the context of MyResource -- leading to a\n  predicate mismatch error when trying to use GET or DELETE\n  methods. Now the views are found and no predicate mismatch is\n  raised.\n  See https://github.com/Pylons/pyramid/pull/786 and\n  https://github.com/Pylons/pyramid/pull/1004 and\n  https://github.com/Pylons/pyramid/pull/1046\n\n- The ``pserve`` command now takes a ``-v`` (or ``--verbose``) flag and a\n  ``-q`` (or ``--quiet``) flag.  Output from running ``pserve`` can be\n  controlled using these flags.  ``-v`` can be specified multiple times to\n  increase verbosity.  ``-q`` sets verbosity to ``0`` unconditionally.  The\n  default verbosity level is ``1``.\n\n- The ``alchemy`` scaffold tests now provide better coverage.  See\n  https://github.com/Pylons/pyramid/pull/1029\n\n- The ``pyramid.config.Configurator.add_route`` method now supports being\n  called with an external URL as pattern. See\n  https://github.com/Pylons/pyramid/issues/611 and the documentation section \n  in the \"URL Dispatch\" chapter entitled \"External Routes\" for more information.\n\nBug Fixes\n---------\n\n- It was not possible to use ``pyramid.httpexceptions.HTTPException`` as\n  the ``context`` of an exception view as very general catchall for\n  http-related exceptions when you wanted that exception view to override the \n  default exception view.  See https://github.com/Pylons/pyramid/issues/985\n\n- When the ``pyramid.reload_templates`` setting was true, and a Chameleon \n  template was reloaded, and the renderer specification named a macro \n  (e.g. ``foo#macroname.pt``), renderings of the template after the template\n  was reloaded due to a file change would produce the entire template body \n  instead of just a rendering of the macro.  See \n  https://github.com/Pylons/pyramid/issues/1013.\n\n- Fix an obscure problem when combining a virtual root with a route with a \n  ``*traverse`` in its pattern.  Now the traversal path generated in\n  such a configuration will be correct, instead of an element missing\n  a leading slash.\n\n- Fixed a Mako renderer bug returning a tuple with a previous defname value\n  in some circumstances. See https://github.com/Pylons/pyramid/issues/1037\n  for more information.\n\n- Make the ``pyramid.config.assets.PackageOverrides`` object implement the API\n  for ``__loader__`` objects specified in PEP 302.  Proxies to the\n  ``__loader__`` set by the importer, if present; otherwise, raises\n  ``NotImplementedError``.  This makes Pyramid static view overrides work\n  properly under Python 3.3 (previously they would not).  See\n  https://github.com/Pylons/pyramid/pull/1015 for more information.\n\n- ``mako_templating``: added defensive workaround for non-importability of\n  ``mako`` due to upstream ``markupsafe`` dropping Python 3.2 support.  Mako\n  templating will no longer work under the combination of MarkupSafe 0.17 and\n  Python 3.2 (although the combination of MarkupSafe 0.17 and Python 3.3 or any\n  supported Python 2 version will work OK).\n\n- Spaces and dots may now be in mako renderer template paths. This was\n  broken when support for the new makodef syntax was added in 1.4a1.\n  See https://github.com/Pylons/pyramid/issues/950\n\n- ``pyramid.debug_authorization=true`` will now correctly print out\n  ``Allowed`` for views registered with ``NO_PERMISSION_REQUIRED`` instead\n  of invoking the ``permits`` method of the authorization policy.\n  See https://github.com/Pylons/pyramid/issues/954\n\n- Pyramid failed to install on some systems due to being packaged with\n  some test files containing higher order characters in their names. These\n  files have now been removed. See\n  https://github.com/Pylons/pyramid/issues/981\n\n- ``pyramid.testing.DummyResource`` didn't define ``__bool__``, so code under\n  Python 3 would use ``__len__`` to find truthiness; this usually caused an\n  instance of DummyResource to be \"falsy\" instead of \"truthy\".  See\n  https://github.com/Pylons/pyramid/pull/1032\n\n- The ``alchemy`` scaffold would break when the database was MySQL during\n  tables creation.  See https://github.com/Pylons/pyramid/pull/1049\n\n- The ``current_route_url`` method now attaches the query string to the URL by\n  default. See\n  https://github.com/Pylons/pyramid/issues/1040\n\n- Make ``pserve.cherrypy_server_runner`` Python 3 compatible. See\n  https://github.com/Pylons/pyramid/issues/718\n\nBackwards Incompatibilities\n---------------------------\n\n- Modified the ``current_route_url`` method in pyramid.Request. The method\n  previously returned the URL without the query string by default, it now does\n  attach the query string unless it is overriden.\n\n- The ``route_url`` and ``route_path`` APIs no longer quote ``/`` \n  to ``%2F`` when a replacement value contains a ``/``.  This was pointless,\n  as WSGI servers always unquote the slash anyway, and Pyramid never sees the \n  quoted value.\n\n- It is no longer possible to set a ``locale_name`` attribute of the request, \n  nor is it possible to set a ``localizer`` attribute of the request.  These\n  are now \"reified\" properties that look up a locale name and localizer\n  respectively using the machinery described in the \"Internationalization\"\n  chapter of the documentation.\n\n- If you send an ``X-Vhm-Root`` header with a value that ends with a slash (or\n  any number of slashes), the trailing slash(es) will be removed before a URL\n  is generated when you use use ``request.resource_url`` or\n  ``request.resource_path``.  Previously the virtual root path would not have\n  trailing slashes stripped, which would influence URL generation.\n\n- The ``pyramid.interfaces.IResourceURL`` interface has now grown two new\n  attributes: ``virtual_path_tuple`` and ``physical_path_tuple``.  These should\n  be the tuple form of the resource's path (physical and virtual).\n\n",
            "header": {
                "file": {
                    "path": "CHANGES.txt"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "641219a8b",
                "new_commit_hash": "6abef1e6b",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/CHANGES.txt"
            },
            "plus_file": {
                "path": "b/CHANGES.txt"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 98,
                            "length": 6
                        },
                        "new_range": {
                            "start": 98,
                            "length": 10
                        },
                        "section": "Backwards Incompatibilities"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "  since Pyramid 1.1.  Use methods of ``request.environ`` (a real dictionary)",
                                "type": "context"
                            },
                            {
                                "content": "  instead.",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "- Removed ancient backwards compatibily hack in",
                                "type": "added"
                            },
                            {
                                "content": "  ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of",
                                "type": "added"
                            },
                            {
                                "content": "  the factory with the matchdict values for compatibility with BFG 0.9.",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "added"
                            },
                            {
                                "content": "1.5a1 (2013-08-30)",
                                "type": "context"
                            },
                            {
                                "content": "==================",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        },
        {
            "old_file_content": "import unittest\nimport warnings\n\nfrom pyramid.testing import cleanUp\n\nfrom pyramid.compat import (\n    text_,\n    native_,\n    text_type,\n    url_quote,\n    PY3,\n    )\n\nwith warnings.catch_warnings(record=True) as w:\n    warnings.filterwarnings('always')\n    from pyramid.interfaces import IContextURL\n    assert(len(w) == 1)\n\nclass TraversalPathTests(unittest.TestCase):\n    def _callFUT(self, path):\n        from pyramid.traversal import traversal_path\n        return traversal_path(path)\n\n    def test_utf8(self):\n        la = b'La Pe\\xc3\\xb1a'\n        encoded = url_quote(la)\n        decoded = text_(la, 'utf-8')\n        path = '/'.join([encoded, encoded])\n        result = self._callFUT(path)\n        self.assertEqual(result, (decoded, decoded))\n\n    def test_utf16(self):\n        from pyramid.exceptions import URLDecodeError\n        la = text_(b'La Pe\\xc3\\xb1a', 'utf-8').encode('utf-16')\n        encoded = url_quote(la)\n        path = '/'.join([encoded, encoded])\n        self.assertRaises(URLDecodeError, self._callFUT, path)\n\n    def test_unicode_highorder_chars(self):\n        path = text_('/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF')\n        self.assertEqual(self._callFUT(path),\n                         (text_('\\u6d41\\u884c\\u8d8b\\u52bf', 'unicode_escape'),))\n\n    def test_element_urllquoted(self):\n        self.assertEqual(self._callFUT('/foo/space%20thing/bar'),\n                         (text_('foo'), text_('space thing'), text_('bar')))\n\n    def test_unicode_undecodeable_to_ascii(self):\n        path = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertRaises(UnicodeEncodeError, self._callFUT, path)\n\nclass TraversalPathInfoTests(unittest.TestCase):\n    def _callFUT(self, path):\n        from pyramid.traversal import traversal_path_info\n        return traversal_path_info(path)\n\n    def test_path_startswith_endswith(self):\n        self.assertEqual(self._callFUT('/foo/'), (text_('foo'),))\n\n    def test_empty_elements(self):\n        self.assertEqual(self._callFUT('foo///'), (text_('foo'),))\n\n    def test_onedot(self):\n        self.assertEqual(self._callFUT('foo/./bar'),\n                         (text_('foo'), text_('bar')))\n\n    def test_twodots(self):\n        self.assertEqual(self._callFUT('foo/../bar'), (text_('bar'),))\n\n    def test_twodots_at_start(self):\n        self.assertEqual(self._callFUT('../../bar'), (text_('bar'),))\n\n    def test_segments_are_unicode(self):\n        result = self._callFUT('/foo/bar')\n        self.assertEqual(type(result[0]), text_type)\n        self.assertEqual(type(result[1]), text_type)\n\n    def test_same_value_returned_if_cached(self):\n        result1 = self._callFUT('/foo/bar')\n        result2 = self._callFUT('/foo/bar')\n        self.assertEqual(result1, (text_('foo'), text_('bar')))\n        self.assertEqual(result2, (text_('foo'), text_('bar')))\n\n    def test_unicode_simple(self):\n        path = text_('/abc')\n        self.assertEqual(self._callFUT(path), (text_('abc'),))\n\n    def test_highorder(self):\n        la = b'La Pe\\xc3\\xb1a'\n        latin1 = native_(la)\n        result = self._callFUT(latin1)\n        self.assertEqual(result, (text_(la, 'utf-8'),))\n\n    def test_highorder_undecodeable(self):\n        from pyramid.exceptions import URLDecodeError\n        la = text_(b'La Pe\\xc3\\xb1a', 'utf-8')\n        notlatin1 = native_(la)\n        self.assertRaises(URLDecodeError, self._callFUT, notlatin1)\n\nclass ResourceTreeTraverserTests(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _getTargetClass(self):\n        from pyramid.traversal import ResourceTreeTraverser\n        return ResourceTreeTraverser\n\n    def _makeOne(self, *arg, **kw):\n        klass = self._getTargetClass()\n        return klass(*arg, **kw)\n\n    def _getEnviron(self, **kw):\n        environ = {}\n        environ.update(kw)\n        return environ\n\n    def test_class_conforms_to_ITraverser(self):\n        from zope.interface.verify import verifyClass\n        from pyramid.interfaces import ITraverser\n        verifyClass(ITraverser, self._getTargetClass())\n\n    def test_instance_conforms_to_ITraverser(self):\n        from zope.interface.verify import verifyObject\n        from pyramid.interfaces import ITraverser\n        context = DummyContext()\n        verifyObject(ITraverser, self._makeOne(context))\n\n    def test_call_with_empty_pathinfo(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info='')\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_pathinfo_KeyError(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, toraise=KeyError)\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_pathinfo_highorder(self):\n        path = text_(b'/Qu\\xc3\\xa9bec', 'utf-8')\n        foo = DummyContext(None, path)\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=path)\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], (path[1:],))\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_pathel_with_no_getitem(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_emptypath_nosubpath(self):\n        root = DummyContext()\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_(''))\n        result = policy(request)\n        self.assertEqual(result['context'], root)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_withpath_nosubpath(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], 'bar')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], (text_('foo'),))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_withpath_withsubpath(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar/baz/buz'))\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], 'bar')\n        self.assertEqual(result['subpath'], ('baz', 'buz'))\n        self.assertEqual(result['traversed'], (text_('foo'),))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_explicit_viewname(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/@@foo'))\n        result = policy(request)\n        self.assertEqual(result['context'], root)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo/bar')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], bar)\n        self.assertEqual(result['virtual_root_path'],\n                         (text_('foo'), text_('bar')))\n\n    def test_call_with_vh_root2(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/bar/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], foo)\n        self.assertEqual(result['virtual_root_path'], (text_('foo'),))\n\n    def test_call_with_vh_root3(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/')\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/foo/bar/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root4(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo/bar/baz')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], baz)\n        self.assertEqual(result['virtual_root_path'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n\n    def test_call_with_vh_root_path_root(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/')\n        request = DummyRequest(environ, path_info=text_('/'))\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root_highorder(self):\n        path = text_(b'Qu\\xc3\\xa9bec', 'utf-8')\n        bar = DummyContext(None, 'bar')\n        foo = DummyContext(bar, path)\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        if PY3: # pragma: no cover\n            vhm_root = b'/Qu\\xc3\\xa9bec'.decode('latin-1')\n        else:\n            vhm_root = b'/Qu\\xc3\\xa9bec'\n        environ = self._getEnviron(HTTP_X_VHM_ROOT=vhm_root)\n        request = DummyRequest(environ, path_info=text_('/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], bar)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(\n            result['traversed'],\n            (path, text_('bar'))\n            )\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], foo)\n        self.assertEqual(\n            result['virtual_root_path'],\n            (path,)\n            )\n\n    def test_path_info_raises_unicodedecodeerror(self):\n        from pyramid.exceptions import URLDecodeError\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        toraise = UnicodeDecodeError('ascii', b'a', 2, 3, '5')\n        request = DummyRequest(environ, toraise=toraise)\n        request.matchdict = None\n        self.assertRaises(URLDecodeError, policy, request)\n\n    def test_withroute_nothingfancy(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        request = DummyRequest({})\n        request.matchdict = {}\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_with_subpath_string(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'subpath':'/a/b/c'}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ('a', 'b','c'))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_with_subpath_tuple(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'subpath':('a', 'b', 'c')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ('a', 'b','c'))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_string(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict =  {'traverse':text_('foo/bar')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_tuple(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'traverse':('foo', 'bar')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_empty(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'traverse':''}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_and_vroot(self):\n        abc = DummyContext()\n        resource = DummyContext(next=abc)\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/abc')\n        request = DummyRequest(environ)\n        traverser = self._makeOne(resource)\n        matchdict =  {'traverse':text_('/foo/bar')}\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], abc)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ('abc', 'foo'))\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], abc)\n        self.assertEqual(result['virtual_root_path'], ('abc',))\n        \nclass FindInterfaceTests(unittest.TestCase):\n    def _callFUT(self, context, iface):\n        from pyramid.traversal import find_interface\n        return find_interface(context, iface)\n\n    def test_it_interface(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = 'root'\n        foo.__parent__ = root\n        foo.__name__ = 'foo'\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        from zope.interface import directlyProvides\n        from zope.interface import Interface\n        class IFoo(Interface):\n            pass\n        directlyProvides(root, IFoo)\n        result = self._callFUT(baz, IFoo)\n        self.assertEqual(result.__name__, 'root')\n\n    def test_it_class(self):\n        class DummyRoot(object):\n            def __init__(self, child):\n                self.child = child\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyRoot(foo)\n        root.__parent__ = None\n        root.__name__ = 'root'\n        foo.__parent__ = root\n        foo.__name__ = 'foo'\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, DummyRoot)\n        self.assertEqual(result.__name__, 'root')\n\nclass FindRootTests(unittest.TestCase):\n    def _callFUT(self, context):\n        from pyramid.traversal import find_root\n        return find_root(context)\n\n    def test_it(self):\n        dummy = DummyContext()\n        baz = DummyContext()\n        baz.__parent__ = dummy\n        baz.__name__ = 'baz'\n        dummy.__parent__ = None\n        dummy.__name__ = None\n        result = self._callFUT(baz)\n        self.assertEqual(result, dummy)\n\nclass FindResourceTests(unittest.TestCase):\n    def _callFUT(self, context, name):\n        from pyramid.traversal import find_resource\n        return find_resource(context, name)\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_list(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, [''])\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_generator(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        def foo():\n            yield ''\n        result = self._callFUT(resource, foo())\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_self_string_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, '')\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_tuple_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ())\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_relative_string_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, 'baz')\n        self.assertEqual(result, baz)\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ('baz',))\n        self.assertEqual(result, baz)\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_string_notfound(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':'bar'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, 'baz')\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_notfound(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':'bar'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, ('baz',))\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_absolute_string_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, '/')\n        self.assertEqual(result, root)\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ('',))\n        self.assertEqual(result, root)\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_string_notfound(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':'fuz'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, '/')\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_notfound(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':'fuz'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, ('',))\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_unicode_found(self):\n        # test for bug wiggy found in wild, traceback stack:\n        # root = u'/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF'\n        # wiggy's code: section=find_resource(page, root)\n        # find_resource L76: D = traverse(resource, path)\n        # traverse L291: return traverser(request)\n        # __call__ line 568: vpath_tuple = traversal_path(vpath)\n        # lru_cached line 91: f(*arg)\n        # traversal_path line 443: path.encode('ascii')\n        # UnicodeEncodeError: 'ascii' codec can't encode characters in\n        #     position 1-12: ordinal not in range(128)\n        #\n        # solution: encode string to ascii in pyramid.traversal.traverse\n        # before passing it along to webob as path_info\n        from pyramid.traversal import ResourceTreeTraverser\n        unprintable = DummyContext()\n        root = DummyContext(unprintable)\n        unprintable.__parent__ = root\n        unprintable.__name__ = text_(\n            b'/\\xe6\\xb5\\x81\\xe8\\xa1\\x8c\\xe8\\xb6\\x8b\\xe5\\x8a\\xbf', 'utf-8')\n        root.__parent__ = None\n        root.__name__ = None\n        traverser = ResourceTreeTraverser\n        self._registerTraverser(traverser)\n        result = self._callFUT(\n            root,\n            text_(b'/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF')\n            )\n        self.assertEqual(result, unprintable)\n\nclass ResourcePathTests(unittest.TestCase):\n    def _callFUT(self, resource, *elements):\n        from pyramid.traversal import resource_path\n        return resource_path(resource, *elements)\n\n    def test_it(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, 'this/theotherthing', 'that')\n        self.assertEqual(result, '/foo%20/bar/baz/this%2Ftheotherthing/that')\n\n    def test_root_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        result = self._callFUT(root)\n        self.assertEqual(result, '/')\n\n    def test_root_default_emptystring(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = ''\n        result = self._callFUT(root)\n        self.assertEqual(result, '/')\n\n    def test_root_object_nonnull_name_direct(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = 'flubadub'\n        result = self._callFUT(root)\n        self.assertEqual(result, 'flubadub') # insane case\n\n    def test_root_object_nonnull_name_indirect(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = 'flubadub'\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'barker'\n        result = self._callFUT(other)\n        self.assertEqual(result, 'flubadub/barker') # insane case\n\n    def test_nonroot_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, '/other')\n\n    def test_path_with_None_itermediate_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = None\n        other2 = DummyContext()\n        other2.__parent__ = other\n        other2.__name__ = 'other2'\n        result = self._callFUT(other2)\n        self.assertEqual(result, '//other2')\n\nclass ResourcePathTupleTests(unittest.TestCase):\n    def _callFUT(self, resource, *elements):\n        from pyramid.traversal import resource_path_tuple\n        return resource_path_tuple(resource, *elements)\n\n    def test_it(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, 'this/theotherthing', 'that')\n        self.assertEqual(result, ('','foo ', 'bar', 'baz', 'this/theotherthing',\n                                  'that'))\n\n    def test_root_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        result = self._callFUT(root)\n        self.assertEqual(result, ('',))\n\n    def test_root_default_emptystring_name(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = ''\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, ('', 'other',))\n\n    def test_nonroot_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, ('', 'other'))\n\n    def test_path_with_None_itermediate_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = None\n        other2 = DummyContext()\n        other2.__parent__ = other\n        other2.__name__ = 'other2'\n        result = self._callFUT(other2)\n        self.assertEqual(result, ('', '', 'other2'))\n\nclass QuotePathSegmentTests(unittest.TestCase):\n    def _callFUT(self, s):\n        from pyramid.traversal import quote_path_segment\n        return quote_path_segment(s)\n\n    def test_unicode(self):\n        la = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        result = self._callFUT(la)\n        self.assertEqual(result, '%2FLa%20Pe%C3%B1a')\n\n    def test_string(self):\n        s = '/ hello!'\n        result = self._callFUT(s)\n        self.assertEqual(result, '%2F%20hello%21')\n\n    def test_int(self):\n        s = 12345\n        result = self._callFUT(s)\n        self.assertEqual(result, '12345')\n        \n    def test_long(self):\n        from pyramid.compat import long\n        import sys\n        s = long(sys.maxsize + 1)\n        result = self._callFUT(s)\n        expected = str(s)\n        self.assertEqual(result, expected)\n\n    def test_other(self):\n        class Foo(object):\n            def __str__(self):\n                return 'abc'\n        s = Foo()\n        result = self._callFUT(s)\n        self.assertEqual(result, 'abc')\n\nclass ResourceURLTests(unittest.TestCase):\n    def _makeOne(self, context, url):\n        return self._getTargetClass()(context, url)\n\n    def _getTargetClass(self):\n        from pyramid.traversal import ResourceURL\n        return ResourceURL\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_class_conforms_to_IContextURL(self):\n        # bw compat\n        from zope.interface.verify import verifyClass\n        verifyClass(IContextURL, self._getTargetClass())\n\n    def test_instance_conforms_to_IContextURL(self):\n        from zope.interface.verify import verifyObject\n        context = DummyContext()\n        request = DummyRequest()\n        verifyObject(IContextURL, self._makeOne(context, request))\n\n    def test_instance_conforms_to_IResourceURL(self):\n        from pyramid.interfaces import IResourceURL\n        from zope.interface.verify import verifyObject\n        context = DummyContext()\n        request = DummyRequest()\n        verifyObject(IResourceURL, self._makeOne(context, request))\n        \n    def test_call_withlineage(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        request = DummyRequest()\n        context_url = self._makeOne(baz, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/foo%20/bar/baz/')\n\n    def test_call_nolineage(self):\n        context = DummyContext()\n        context.__name__ = ''\n        context.__parent__ = None\n        request = DummyRequest()\n        context_url = self._makeOne(context, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n\n    def test_call_unicode_mixed_with_bytes_in_resource_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = text_(b'La Pe\\xc3\\xb1a', 'utf-8')\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = b'La Pe\\xc3\\xb1a'\n        request = DummyRequest()\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(\n            result,\n            'http://example.com:5432/La%20Pe%C3%B1a/La%20Pe%C3%B1a/')\n\n    def test_call_with_virtual_root_path(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        request = DummyRequest({VH_ROOT_KEY:'/one'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/two/')\n\n        request = DummyRequest({VH_ROOT_KEY:'/one/two'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n\n    def test_call_with_virtual_root_path_physical_not_startwith_vroot(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        request = DummyRequest({VH_ROOT_KEY:'/wrong'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/one/two/')\n\n    def test_call_empty_names_not_ignored(self):\n        bar = DummyContext()\n        empty = DummyContext(bar)\n        root = DummyContext(empty)\n        root.__parent__ = None\n        root.__name__ = None\n        empty.__parent__ = root\n        empty.__name__ = ''\n        bar.__parent__ = empty\n        bar.__name__ = 'bar'\n        request = DummyRequest()\n        context_url = self._makeOne(bar, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432//bar/')\n\n    def test_call_local_url_returns_None(self):\n        resource = DummyContext()\n        def resource_url(request, info):\n            self.assertEqual(info['virtual_path'], '/')\n            self.assertEqual(info['physical_path'], '/')\n            return None\n        resource.__resource_url__ = resource_url\n        request = DummyRequest()\n        context_url = self._makeOne(resource, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n        \n    def test_call_local_url_returns_url(self):\n        resource = DummyContext()\n        def resource_url(request, info):\n            self.assertEqual(info['virtual_path'], '/')\n            self.assertEqual(info['physical_path'], '/')\n            return 'abc'\n        resource.__resource_url__ = resource_url\n        request = DummyRequest()\n        context_url = self._makeOne(resource, request)\n        result = context_url()\n        self.assertEqual(result, 'abc')\n\n    def test_virtual_root_no_virtual_root_path(self):\n        root = DummyContext()\n        root.__name__ = None\n        root.__parent__ = None\n        one = DummyContext()\n        one.__name__ = 'one'\n        one.__parent__ = root\n        request = DummyRequest()\n        context_url = self._makeOne(one, request)\n        self.assertEqual(context_url.virtual_root(), root)\n\n    def test_virtual_root_no_virtual_root_path_with_root_on_request(self):\n        context = DummyContext()\n        context.__parent__ = None\n        request = DummyRequest()\n        request.root = DummyContext()\n        context_url = self._makeOne(context, request)\n        self.assertEqual(context_url.virtual_root(), request.root)\n\n    def test_virtual_root_with_virtual_root_path(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        context = DummyContext()\n        context.__parent__ = None\n        traversed_to = DummyContext()\n        environ = {VH_ROOT_KEY:'/one'}\n        request = DummyRequest(environ)\n        traverser = make_traverser({'context':traversed_to, 'view_name':''})\n        self._registerTraverser(traverser)\n        context_url = self._makeOne(context, request)\n        self.assertEqual(context_url.virtual_root(), traversed_to)\n        self.assertEqual(context.request.environ['PATH_INFO'], '/one')\n\n    def test_IResourceURL_attributes_with_vroot(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {VH_ROOT_KEY:'/one'}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'two', ''))\n        \n    def test_IResourceURL_attributes_vroot_ends_with_slash(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {VH_ROOT_KEY:'/one/'}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'two', ''))\n        \n    def test_IResourceURL_attributes_no_vroot(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/one/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'one', 'two', ''))\n\nclass TestVirtualRoot(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _callFUT(self, resource, request):\n        from pyramid.traversal import virtual_root\n        return virtual_root(resource, request)\n\n    def test_registered(self):\n        from zope.interface import Interface\n        request = _makeRequest()\n        request.registry.registerAdapter(DummyContextURL, (Interface,Interface),\n                                         IContextURL)\n        context = DummyContext()\n        result = self._callFUT(context, request)\n        self.assertEqual(result, '123')\n\n    def test_default(self):\n        context = DummyContext()\n        request = _makeRequest()\n        request.environ['PATH_INFO'] = '/'\n        result = self._callFUT(context, request)\n        self.assertEqual(result, context)\n\n    def test_default_no_registry_on_request(self):\n        context = DummyContext()\n        request = _makeRequest()\n        del request.registry\n        request.environ['PATH_INFO'] = '/'\n        result = self._callFUT(context, request)\n        self.assertEqual(result, context)\n\nclass TraverseTests(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _callFUT(self, context, name):\n        from pyramid.traversal import traverse\n        return traverse(context, name)\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_request_has_registry(self):\n        from pyramid.threadlocal import get_current_registry\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.registry, get_current_registry())\n\n    def test_list(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_generator(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        def foo():\n            yield ''\n        self._callFUT(resource, foo())\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_self_string_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, '')\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_unicode_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, text_(''))\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_tuple_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ())\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_relative_string_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, 'baz')\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ('baz',))\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_absolute_string_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, '/')\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ('',))\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_empty_sequence(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [])\n        self.assertEqual(resource.wascontext, True)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_default_traverser(self):\n        resource = DummyContext()\n        result = self._callFUT(resource, '')\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['context'], resource)\n\n    def test_requestfactory_overridden(self):\n        from pyramid.interfaces import IRequestFactory\n        from pyramid.request import Request\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        class MyRequest(Request):\n            pass\n        reg.registerUtility(MyRequest, IRequestFactory)\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.__class__, MyRequest)\n\nclass TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_no_matchdict(self):\n        class DummyRequest:\n            matchdict = None\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\n    def test_matchdict(self):\n        class DummyRequest:\n            pass\n        request = DummyRequest()\n        request.matchdict = {'a':1, 'b':2}\n        root = self._makeOne(request)\n        self.assertEqual(root.a, 1)\n        self.assertEqual(root.b, 2)\n\nclass Test__join_path_tuple(unittest.TestCase):\n    def _callFUT(self, tup):\n        from pyramid.traversal import _join_path_tuple\n        return _join_path_tuple(tup)\n\n    def test_empty_tuple(self):\n        # tests \"or '/'\" case\n        result = self._callFUT(())\n        self.assertEqual(result, '/')\n\n    def test_nonempty_tuple(self):\n        result = self._callFUT(('x',))\n        self.assertEqual(result, 'x')\n\ndef make_traverser(result):\n    class DummyTraverser(object):\n        def __init__(self, context):\n            self.context = context\n            context.wascontext = True\n        def __call__(self, request):\n            self.context.request = request\n            return result\n    return DummyTraverser\n\nclass DummyContext(object):\n    __parent__ = None\n    def __init__(self, next=None, name=None):\n        self.next = next\n        self.__name__ = name\n\n    def __getitem__(self, name):\n        if self.next is None:\n            raise KeyError(name)\n        return self.next\n\n    def __repr__(self):\n        return '<DummyContext with name %s at id %s>'%(self.__name__, id(self))\n\nclass DummyRequest:\n\n    application_url = 'http://example.com:5432' # app_url never ends with slash\n    matchdict = None\n    matched_route = None\n\n    def __init__(self, environ=None, path_info=text_('/'), toraise=None):\n        if environ is None:\n            environ = {}\n        self.environ = environ\n        self._set_path_info(path_info)\n        self.toraise = toraise\n\n    def _get_path_info(self):\n        if self.toraise:\n            raise self.toraise\n        return self._path_info\n\n    def _set_path_info(self, v):\n        self._path_info = v\n\n    path_info = property(_get_path_info, _set_path_info)\n        \n\nclass DummyContextURL:\n    def __init__(self, context, request):\n        pass\n\n    def virtual_root(self):\n        return '123'\n\ndef _makeRequest(environ=None):\n    from pyramid.registry import Registry\n    request = DummyRequest()\n    request.registry = Registry()\n    return request\n",
            "new_file_content": "import unittest\nimport warnings\n\nfrom pyramid.testing import cleanUp\n\nfrom pyramid.compat import (\n    text_,\n    native_,\n    text_type,\n    url_quote,\n    PY3,\n    )\n\nwith warnings.catch_warnings(record=True) as w:\n    warnings.filterwarnings('always')\n    from pyramid.interfaces import IContextURL\n    assert(len(w) == 1)\n\nclass TraversalPathTests(unittest.TestCase):\n    def _callFUT(self, path):\n        from pyramid.traversal import traversal_path\n        return traversal_path(path)\n\n    def test_utf8(self):\n        la = b'La Pe\\xc3\\xb1a'\n        encoded = url_quote(la)\n        decoded = text_(la, 'utf-8')\n        path = '/'.join([encoded, encoded])\n        result = self._callFUT(path)\n        self.assertEqual(result, (decoded, decoded))\n\n    def test_utf16(self):\n        from pyramid.exceptions import URLDecodeError\n        la = text_(b'La Pe\\xc3\\xb1a', 'utf-8').encode('utf-16')\n        encoded = url_quote(la)\n        path = '/'.join([encoded, encoded])\n        self.assertRaises(URLDecodeError, self._callFUT, path)\n\n    def test_unicode_highorder_chars(self):\n        path = text_('/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF')\n        self.assertEqual(self._callFUT(path),\n                         (text_('\\u6d41\\u884c\\u8d8b\\u52bf', 'unicode_escape'),))\n\n    def test_element_urllquoted(self):\n        self.assertEqual(self._callFUT('/foo/space%20thing/bar'),\n                         (text_('foo'), text_('space thing'), text_('bar')))\n\n    def test_unicode_undecodeable_to_ascii(self):\n        path = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertRaises(UnicodeEncodeError, self._callFUT, path)\n\nclass TraversalPathInfoTests(unittest.TestCase):\n    def _callFUT(self, path):\n        from pyramid.traversal import traversal_path_info\n        return traversal_path_info(path)\n\n    def test_path_startswith_endswith(self):\n        self.assertEqual(self._callFUT('/foo/'), (text_('foo'),))\n\n    def test_empty_elements(self):\n        self.assertEqual(self._callFUT('foo///'), (text_('foo'),))\n\n    def test_onedot(self):\n        self.assertEqual(self._callFUT('foo/./bar'),\n                         (text_('foo'), text_('bar')))\n\n    def test_twodots(self):\n        self.assertEqual(self._callFUT('foo/../bar'), (text_('bar'),))\n\n    def test_twodots_at_start(self):\n        self.assertEqual(self._callFUT('../../bar'), (text_('bar'),))\n\n    def test_segments_are_unicode(self):\n        result = self._callFUT('/foo/bar')\n        self.assertEqual(type(result[0]), text_type)\n        self.assertEqual(type(result[1]), text_type)\n\n    def test_same_value_returned_if_cached(self):\n        result1 = self._callFUT('/foo/bar')\n        result2 = self._callFUT('/foo/bar')\n        self.assertEqual(result1, (text_('foo'), text_('bar')))\n        self.assertEqual(result2, (text_('foo'), text_('bar')))\n\n    def test_unicode_simple(self):\n        path = text_('/abc')\n        self.assertEqual(self._callFUT(path), (text_('abc'),))\n\n    def test_highorder(self):\n        la = b'La Pe\\xc3\\xb1a'\n        latin1 = native_(la)\n        result = self._callFUT(latin1)\n        self.assertEqual(result, (text_(la, 'utf-8'),))\n\n    def test_highorder_undecodeable(self):\n        from pyramid.exceptions import URLDecodeError\n        la = text_(b'La Pe\\xc3\\xb1a', 'utf-8')\n        notlatin1 = native_(la)\n        self.assertRaises(URLDecodeError, self._callFUT, notlatin1)\n\nclass ResourceTreeTraverserTests(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _getTargetClass(self):\n        from pyramid.traversal import ResourceTreeTraverser\n        return ResourceTreeTraverser\n\n    def _makeOne(self, *arg, **kw):\n        klass = self._getTargetClass()\n        return klass(*arg, **kw)\n\n    def _getEnviron(self, **kw):\n        environ = {}\n        environ.update(kw)\n        return environ\n\n    def test_class_conforms_to_ITraverser(self):\n        from zope.interface.verify import verifyClass\n        from pyramid.interfaces import ITraverser\n        verifyClass(ITraverser, self._getTargetClass())\n\n    def test_instance_conforms_to_ITraverser(self):\n        from zope.interface.verify import verifyObject\n        from pyramid.interfaces import ITraverser\n        context = DummyContext()\n        verifyObject(ITraverser, self._makeOne(context))\n\n    def test_call_with_empty_pathinfo(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info='')\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_pathinfo_KeyError(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, toraise=KeyError)\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_pathinfo_highorder(self):\n        path = text_(b'/Qu\\xc3\\xa9bec', 'utf-8')\n        foo = DummyContext(None, path)\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=path)\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], (path[1:],))\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_pathel_with_no_getitem(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_emptypath_nosubpath(self):\n        root = DummyContext()\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_(''))\n        result = policy(request)\n        self.assertEqual(result['context'], root)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_withpath_nosubpath(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], 'bar')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], (text_('foo'),))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_withpath_withsubpath(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar/baz/buz'))\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], 'bar')\n        self.assertEqual(result['subpath'], ('baz', 'buz'))\n        self.assertEqual(result['traversed'], (text_('foo'),))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_explicit_viewname(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/@@foo'))\n        result = policy(request)\n        self.assertEqual(result['context'], root)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo/bar')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], bar)\n        self.assertEqual(result['virtual_root_path'],\n                         (text_('foo'), text_('bar')))\n\n    def test_call_with_vh_root2(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/bar/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], foo)\n        self.assertEqual(result['virtual_root_path'], (text_('foo'),))\n\n    def test_call_with_vh_root3(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/')\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/foo/bar/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root4(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo/bar/baz')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], baz)\n        self.assertEqual(result['virtual_root_path'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n\n    def test_call_with_vh_root_path_root(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/')\n        request = DummyRequest(environ, path_info=text_('/'))\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root_highorder(self):\n        path = text_(b'Qu\\xc3\\xa9bec', 'utf-8')\n        bar = DummyContext(None, 'bar')\n        foo = DummyContext(bar, path)\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        if PY3: # pragma: no cover\n            vhm_root = b'/Qu\\xc3\\xa9bec'.decode('latin-1')\n        else:\n            vhm_root = b'/Qu\\xc3\\xa9bec'\n        environ = self._getEnviron(HTTP_X_VHM_ROOT=vhm_root)\n        request = DummyRequest(environ, path_info=text_('/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], bar)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(\n            result['traversed'],\n            (path, text_('bar'))\n            )\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], foo)\n        self.assertEqual(\n            result['virtual_root_path'],\n            (path,)\n            )\n\n    def test_path_info_raises_unicodedecodeerror(self):\n        from pyramid.exceptions import URLDecodeError\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        toraise = UnicodeDecodeError('ascii', b'a', 2, 3, '5')\n        request = DummyRequest(environ, toraise=toraise)\n        request.matchdict = None\n        self.assertRaises(URLDecodeError, policy, request)\n\n    def test_withroute_nothingfancy(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        request = DummyRequest({})\n        request.matchdict = {}\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_with_subpath_string(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'subpath':'/a/b/c'}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ('a', 'b','c'))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_with_subpath_tuple(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'subpath':('a', 'b', 'c')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ('a', 'b','c'))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_string(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict =  {'traverse':text_('foo/bar')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_tuple(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'traverse':('foo', 'bar')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_empty(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'traverse':''}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_and_vroot(self):\n        abc = DummyContext()\n        resource = DummyContext(next=abc)\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/abc')\n        request = DummyRequest(environ)\n        traverser = self._makeOne(resource)\n        matchdict =  {'traverse':text_('/foo/bar')}\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], abc)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ('abc', 'foo'))\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], abc)\n        self.assertEqual(result['virtual_root_path'], ('abc',))\n        \nclass FindInterfaceTests(unittest.TestCase):\n    def _callFUT(self, context, iface):\n        from pyramid.traversal import find_interface\n        return find_interface(context, iface)\n\n    def test_it_interface(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = 'root'\n        foo.__parent__ = root\n        foo.__name__ = 'foo'\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        from zope.interface import directlyProvides\n        from zope.interface import Interface\n        class IFoo(Interface):\n            pass\n        directlyProvides(root, IFoo)\n        result = self._callFUT(baz, IFoo)\n        self.assertEqual(result.__name__, 'root')\n\n    def test_it_class(self):\n        class DummyRoot(object):\n            def __init__(self, child):\n                self.child = child\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyRoot(foo)\n        root.__parent__ = None\n        root.__name__ = 'root'\n        foo.__parent__ = root\n        foo.__name__ = 'foo'\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, DummyRoot)\n        self.assertEqual(result.__name__, 'root')\n\nclass FindRootTests(unittest.TestCase):\n    def _callFUT(self, context):\n        from pyramid.traversal import find_root\n        return find_root(context)\n\n    def test_it(self):\n        dummy = DummyContext()\n        baz = DummyContext()\n        baz.__parent__ = dummy\n        baz.__name__ = 'baz'\n        dummy.__parent__ = None\n        dummy.__name__ = None\n        result = self._callFUT(baz)\n        self.assertEqual(result, dummy)\n\nclass FindResourceTests(unittest.TestCase):\n    def _callFUT(self, context, name):\n        from pyramid.traversal import find_resource\n        return find_resource(context, name)\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_list(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, [''])\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_generator(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        def foo():\n            yield ''\n        result = self._callFUT(resource, foo())\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_self_string_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, '')\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_tuple_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ())\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_relative_string_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, 'baz')\n        self.assertEqual(result, baz)\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ('baz',))\n        self.assertEqual(result, baz)\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_string_notfound(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':'bar'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, 'baz')\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_notfound(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':'bar'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, ('baz',))\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_absolute_string_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, '/')\n        self.assertEqual(result, root)\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ('',))\n        self.assertEqual(result, root)\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_string_notfound(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':'fuz'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, '/')\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_notfound(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':'fuz'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, ('',))\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_unicode_found(self):\n        # test for bug wiggy found in wild, traceback stack:\n        # root = u'/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF'\n        # wiggy's code: section=find_resource(page, root)\n        # find_resource L76: D = traverse(resource, path)\n        # traverse L291: return traverser(request)\n        # __call__ line 568: vpath_tuple = traversal_path(vpath)\n        # lru_cached line 91: f(*arg)\n        # traversal_path line 443: path.encode('ascii')\n        # UnicodeEncodeError: 'ascii' codec can't encode characters in\n        #     position 1-12: ordinal not in range(128)\n        #\n        # solution: encode string to ascii in pyramid.traversal.traverse\n        # before passing it along to webob as path_info\n        from pyramid.traversal import ResourceTreeTraverser\n        unprintable = DummyContext()\n        root = DummyContext(unprintable)\n        unprintable.__parent__ = root\n        unprintable.__name__ = text_(\n            b'/\\xe6\\xb5\\x81\\xe8\\xa1\\x8c\\xe8\\xb6\\x8b\\xe5\\x8a\\xbf', 'utf-8')\n        root.__parent__ = None\n        root.__name__ = None\n        traverser = ResourceTreeTraverser\n        self._registerTraverser(traverser)\n        result = self._callFUT(\n            root,\n            text_(b'/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF')\n            )\n        self.assertEqual(result, unprintable)\n\nclass ResourcePathTests(unittest.TestCase):\n    def _callFUT(self, resource, *elements):\n        from pyramid.traversal import resource_path\n        return resource_path(resource, *elements)\n\n    def test_it(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, 'this/theotherthing', 'that')\n        self.assertEqual(result, '/foo%20/bar/baz/this%2Ftheotherthing/that')\n\n    def test_root_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        result = self._callFUT(root)\n        self.assertEqual(result, '/')\n\n    def test_root_default_emptystring(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = ''\n        result = self._callFUT(root)\n        self.assertEqual(result, '/')\n\n    def test_root_object_nonnull_name_direct(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = 'flubadub'\n        result = self._callFUT(root)\n        self.assertEqual(result, 'flubadub') # insane case\n\n    def test_root_object_nonnull_name_indirect(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = 'flubadub'\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'barker'\n        result = self._callFUT(other)\n        self.assertEqual(result, 'flubadub/barker') # insane case\n\n    def test_nonroot_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, '/other')\n\n    def test_path_with_None_itermediate_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = None\n        other2 = DummyContext()\n        other2.__parent__ = other\n        other2.__name__ = 'other2'\n        result = self._callFUT(other2)\n        self.assertEqual(result, '//other2')\n\nclass ResourcePathTupleTests(unittest.TestCase):\n    def _callFUT(self, resource, *elements):\n        from pyramid.traversal import resource_path_tuple\n        return resource_path_tuple(resource, *elements)\n\n    def test_it(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, 'this/theotherthing', 'that')\n        self.assertEqual(result, ('','foo ', 'bar', 'baz', 'this/theotherthing',\n                                  'that'))\n\n    def test_root_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        result = self._callFUT(root)\n        self.assertEqual(result, ('',))\n\n    def test_root_default_emptystring_name(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = ''\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, ('', 'other',))\n\n    def test_nonroot_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, ('', 'other'))\n\n    def test_path_with_None_itermediate_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = None\n        other2 = DummyContext()\n        other2.__parent__ = other\n        other2.__name__ = 'other2'\n        result = self._callFUT(other2)\n        self.assertEqual(result, ('', '', 'other2'))\n\nclass QuotePathSegmentTests(unittest.TestCase):\n    def _callFUT(self, s):\n        from pyramid.traversal import quote_path_segment\n        return quote_path_segment(s)\n\n    def test_unicode(self):\n        la = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        result = self._callFUT(la)\n        self.assertEqual(result, '%2FLa%20Pe%C3%B1a')\n\n    def test_string(self):\n        s = '/ hello!'\n        result = self._callFUT(s)\n        self.assertEqual(result, '%2F%20hello%21')\n\n    def test_int(self):\n        s = 12345\n        result = self._callFUT(s)\n        self.assertEqual(result, '12345')\n        \n    def test_long(self):\n        from pyramid.compat import long\n        import sys\n        s = long(sys.maxsize + 1)\n        result = self._callFUT(s)\n        expected = str(s)\n        self.assertEqual(result, expected)\n\n    def test_other(self):\n        class Foo(object):\n            def __str__(self):\n                return 'abc'\n        s = Foo()\n        result = self._callFUT(s)\n        self.assertEqual(result, 'abc')\n\nclass ResourceURLTests(unittest.TestCase):\n    def _makeOne(self, context, url):\n        return self._getTargetClass()(context, url)\n\n    def _getTargetClass(self):\n        from pyramid.traversal import ResourceURL\n        return ResourceURL\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_class_conforms_to_IContextURL(self):\n        # bw compat\n        from zope.interface.verify import verifyClass\n        verifyClass(IContextURL, self._getTargetClass())\n\n    def test_instance_conforms_to_IContextURL(self):\n        from zope.interface.verify import verifyObject\n        context = DummyContext()\n        request = DummyRequest()\n        verifyObject(IContextURL, self._makeOne(context, request))\n\n    def test_instance_conforms_to_IResourceURL(self):\n        from pyramid.interfaces import IResourceURL\n        from zope.interface.verify import verifyObject\n        context = DummyContext()\n        request = DummyRequest()\n        verifyObject(IResourceURL, self._makeOne(context, request))\n        \n    def test_call_withlineage(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        request = DummyRequest()\n        context_url = self._makeOne(baz, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/foo%20/bar/baz/')\n\n    def test_call_nolineage(self):\n        context = DummyContext()\n        context.__name__ = ''\n        context.__parent__ = None\n        request = DummyRequest()\n        context_url = self._makeOne(context, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n\n    def test_call_unicode_mixed_with_bytes_in_resource_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = text_(b'La Pe\\xc3\\xb1a', 'utf-8')\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = b'La Pe\\xc3\\xb1a'\n        request = DummyRequest()\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(\n            result,\n            'http://example.com:5432/La%20Pe%C3%B1a/La%20Pe%C3%B1a/')\n\n    def test_call_with_virtual_root_path(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        request = DummyRequest({VH_ROOT_KEY:'/one'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/two/')\n\n        request = DummyRequest({VH_ROOT_KEY:'/one/two'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n\n    def test_call_with_virtual_root_path_physical_not_startwith_vroot(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        request = DummyRequest({VH_ROOT_KEY:'/wrong'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/one/two/')\n\n    def test_call_empty_names_not_ignored(self):\n        bar = DummyContext()\n        empty = DummyContext(bar)\n        root = DummyContext(empty)\n        root.__parent__ = None\n        root.__name__ = None\n        empty.__parent__ = root\n        empty.__name__ = ''\n        bar.__parent__ = empty\n        bar.__name__ = 'bar'\n        request = DummyRequest()\n        context_url = self._makeOne(bar, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432//bar/')\n\n    def test_call_local_url_returns_None(self):\n        resource = DummyContext()\n        def resource_url(request, info):\n            self.assertEqual(info['virtual_path'], '/')\n            self.assertEqual(info['physical_path'], '/')\n            return None\n        resource.__resource_url__ = resource_url\n        request = DummyRequest()\n        context_url = self._makeOne(resource, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n        \n    def test_call_local_url_returns_url(self):\n        resource = DummyContext()\n        def resource_url(request, info):\n            self.assertEqual(info['virtual_path'], '/')\n            self.assertEqual(info['physical_path'], '/')\n            return 'abc'\n        resource.__resource_url__ = resource_url\n        request = DummyRequest()\n        context_url = self._makeOne(resource, request)\n        result = context_url()\n        self.assertEqual(result, 'abc')\n\n    def test_virtual_root_no_virtual_root_path(self):\n        root = DummyContext()\n        root.__name__ = None\n        root.__parent__ = None\n        one = DummyContext()\n        one.__name__ = 'one'\n        one.__parent__ = root\n        request = DummyRequest()\n        context_url = self._makeOne(one, request)\n        self.assertEqual(context_url.virtual_root(), root)\n\n    def test_virtual_root_no_virtual_root_path_with_root_on_request(self):\n        context = DummyContext()\n        context.__parent__ = None\n        request = DummyRequest()\n        request.root = DummyContext()\n        context_url = self._makeOne(context, request)\n        self.assertEqual(context_url.virtual_root(), request.root)\n\n    def test_virtual_root_with_virtual_root_path(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        context = DummyContext()\n        context.__parent__ = None\n        traversed_to = DummyContext()\n        environ = {VH_ROOT_KEY:'/one'}\n        request = DummyRequest(environ)\n        traverser = make_traverser({'context':traversed_to, 'view_name':''})\n        self._registerTraverser(traverser)\n        context_url = self._makeOne(context, request)\n        self.assertEqual(context_url.virtual_root(), traversed_to)\n        self.assertEqual(context.request.environ['PATH_INFO'], '/one')\n\n    def test_IResourceURL_attributes_with_vroot(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {VH_ROOT_KEY:'/one'}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'two', ''))\n        \n    def test_IResourceURL_attributes_vroot_ends_with_slash(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {VH_ROOT_KEY:'/one/'}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'two', ''))\n        \n    def test_IResourceURL_attributes_no_vroot(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/one/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'one', 'two', ''))\n\nclass TestVirtualRoot(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _callFUT(self, resource, request):\n        from pyramid.traversal import virtual_root\n        return virtual_root(resource, request)\n\n    def test_registered(self):\n        from zope.interface import Interface\n        request = _makeRequest()\n        request.registry.registerAdapter(DummyContextURL, (Interface,Interface),\n                                         IContextURL)\n        context = DummyContext()\n        result = self._callFUT(context, request)\n        self.assertEqual(result, '123')\n\n    def test_default(self):\n        context = DummyContext()\n        request = _makeRequest()\n        request.environ['PATH_INFO'] = '/'\n        result = self._callFUT(context, request)\n        self.assertEqual(result, context)\n\n    def test_default_no_registry_on_request(self):\n        context = DummyContext()\n        request = _makeRequest()\n        del request.registry\n        request.environ['PATH_INFO'] = '/'\n        result = self._callFUT(context, request)\n        self.assertEqual(result, context)\n\nclass TraverseTests(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _callFUT(self, context, name):\n        from pyramid.traversal import traverse\n        return traverse(context, name)\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_request_has_registry(self):\n        from pyramid.threadlocal import get_current_registry\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.registry, get_current_registry())\n\n    def test_list(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_generator(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        def foo():\n            yield ''\n        self._callFUT(resource, foo())\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_self_string_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, '')\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_unicode_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, text_(''))\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_tuple_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ())\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_relative_string_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, 'baz')\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ('baz',))\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_absolute_string_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, '/')\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ('',))\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_empty_sequence(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [])\n        self.assertEqual(resource.wascontext, True)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_default_traverser(self):\n        resource = DummyContext()\n        result = self._callFUT(resource, '')\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['context'], resource)\n\n    def test_requestfactory_overridden(self):\n        from pyramid.interfaces import IRequestFactory\n        from pyramid.request import Request\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        class MyRequest(Request):\n            pass\n        reg.registerUtility(MyRequest, IRequestFactory)\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.__class__, MyRequest)\n\nclass TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_it(self):\n        class DummyRequest(object):\n            pass\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\nclass Test__join_path_tuple(unittest.TestCase):\n    def _callFUT(self, tup):\n        from pyramid.traversal import _join_path_tuple\n        return _join_path_tuple(tup)\n\n    def test_empty_tuple(self):\n        # tests \"or '/'\" case\n        result = self._callFUT(())\n        self.assertEqual(result, '/')\n\n    def test_nonempty_tuple(self):\n        result = self._callFUT(('x',))\n        self.assertEqual(result, 'x')\n\ndef make_traverser(result):\n    class DummyTraverser(object):\n        def __init__(self, context):\n            self.context = context\n            context.wascontext = True\n        def __call__(self, request):\n            self.context.request = request\n            return result\n    return DummyTraverser\n\nclass DummyContext(object):\n    __parent__ = None\n    def __init__(self, next=None, name=None):\n        self.next = next\n        self.__name__ = name\n\n    def __getitem__(self, name):\n        if self.next is None:\n            raise KeyError(name)\n        return self.next\n\n    def __repr__(self):\n        return '<DummyContext with name %s at id %s>'%(self.__name__, id(self))\n\nclass DummyRequest:\n\n    application_url = 'http://example.com:5432' # app_url never ends with slash\n    matchdict = None\n    matched_route = None\n\n    def __init__(self, environ=None, path_info=text_('/'), toraise=None):\n        if environ is None:\n            environ = {}\n        self.environ = environ\n        self._set_path_info(path_info)\n        self.toraise = toraise\n\n    def _get_path_info(self):\n        if self.toraise:\n            raise self.toraise\n        return self._path_info\n\n    def _set_path_info(self, v):\n        self._path_info = v\n\n    path_info = property(_get_path_info, _set_path_info)\n        \n\nclass DummyContextURL:\n    def __init__(self, context, request):\n        pass\n\n    def virtual_root(self):\n        return '123'\n\ndef _makeRequest(environ=None):\n    from pyramid.registry import Registry\n    request = DummyRequest()\n    request.registry = Registry()\n    return request\n",
            "header": {
                "file": {
                    "path": "pyramid/tests/test_traversal.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "ff5937811",
                "new_commit_hash": "0dcc4a027",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/pyramid/tests/test_traversal.py"
            },
            "plus_file": {
                "path": "b/pyramid/tests/test_traversal.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 1278,
                            "length": 22
                        },
                        "new_range": {
                            "start": 1278,
                            "length": 13
                        },
                        "section": "class TestDefaultRootFactory(unittest.TestCase):"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    def _makeOne(self, environ):",
                                "type": "context"
                            },
                            {
                                "content": "        return self._getTargetClass()(environ)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_no_matchdict(self):",
                                "type": "deleted"
                            },
                            {
                                "content": "        class DummyRequest:",
                                "type": "deleted"
                            },
                            {
                                "content": "            matchdict = None",
                                "type": "deleted"
                            },
                            {
                                "content": "    def test_it(self):",
                                "type": "added"
                            },
                            {
                                "content": "        class DummyRequest(object):",
                                "type": "added"
                            },
                            {
                                "content": "            pass",
                                "type": "added"
                            },
                            {
                                "content": "        root = self._makeOne(DummyRequest())",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(root.__parent__, None)",
                                "type": "context"
                            },
                            {
                                "content": "        self.assertEqual(root.__name__, None)",
                                "type": "context"
                            },
                            {
                                "content": "",
                                "type": "context"
                            },
                            {
                                "content": "    def test_matchdict(self):",
                                "type": "deleted"
                            },
                            {
                                "content": "        class DummyRequest:",
                                "type": "deleted"
                            },
                            {
                                "content": "            pass",
                                "type": "deleted"
                            },
                            {
                                "content": "        request = DummyRequest()",
                                "type": "deleted"
                            },
                            {
                                "content": "        request.matchdict = {'a':1, 'b':2}",
                                "type": "deleted"
                            },
                            {
                                "content": "        root = self._makeOne(request)",
                                "type": "deleted"
                            },
                            {
                                "content": "        self.assertEqual(root.a, 1)",
                                "type": "deleted"
                            },
                            {
                                "content": "        self.assertEqual(root.b, 2)",
                                "type": "deleted"
                            },
                            {
                                "content": "",
                                "type": "deleted"
                            },
                            {
                                "content": "class Test__join_path_tuple(unittest.TestCase):",
                                "type": "context"
                            },
                            {
                                "content": "    def _callFUT(self, tup):",
                                "type": "context"
                            },
                            {
                                "content": "        from pyramid.traversal import _join_path_tuple",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "pyramid/tests/test_traversal.py",
                            "type": "class",
                            "name": "TestDefaultRootFactory",
                            "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_no_matchdict(self):\n        class DummyRequest:\n            matchdict = None\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\n    def test_matchdict(self):\n        class DummyRequest:\n            pass\n        request = DummyRequest()\n        request.matchdict = {'a':1, 'b':2}\n        root = self._makeOne(request)\n        self.assertEqual(root.a, 1)\n        self.assertEqual(root.b, 2)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 1273,
                            "end_lineno": 1295,
                            "parent": null
                        }
                    ],
                    "added_entities": [
                        {
                            "file_name": "pyramid/tests/test_traversal.py",
                            "type": "method",
                            "name": "TestDefaultRootFactory.test_it",
                            "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_it(self):\n        class DummyRequest(object):\n            pass\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 1281,
                            "end_lineno": 1286,
                            "parent": {
                                "file_name": "pyramid/tests/test_traversal.py",
                                "type": "class",
                                "name": "TestDefaultRootFactory",
                                "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_it(self):\n        class DummyRequest(object):\n            pass\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 1273,
                                "end_lineno": 1286,
                                "parent": null
                            }
                        }
                    ],
                    "deleted_entities": [
                        {
                            "file_name": "pyramid/tests/test_traversal.py",
                            "type": "method",
                            "name": "TestDefaultRootFactory.test_no_matchdict",
                            "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_no_matchdict(self):\n        class DummyRequest:\n            matchdict = None\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\n    def test_matchdict(self):\n        class DummyRequest:\n            pass\n        request = DummyRequest()\n        request.matchdict = {'a':1, 'b':2}\n        root = self._makeOne(request)\n        self.assertEqual(root.a, 1)\n        self.assertEqual(root.b, 2)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 1281,
                            "end_lineno": 1286,
                            "parent": {
                                "file_name": "pyramid/tests/test_traversal.py",
                                "type": "class",
                                "name": "TestDefaultRootFactory",
                                "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_no_matchdict(self):\n        class DummyRequest:\n            matchdict = None\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\n    def test_matchdict(self):\n        class DummyRequest:\n            pass\n        request = DummyRequest()\n        request.matchdict = {'a':1, 'b':2}\n        root = self._makeOne(request)\n        self.assertEqual(root.a, 1)\n        self.assertEqual(root.b, 2)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 1273,
                                "end_lineno": 1295,
                                "parent": null
                            }
                        },
                        {
                            "file_name": "pyramid/tests/test_traversal.py",
                            "type": "method",
                            "name": "TestDefaultRootFactory.test_matchdict",
                            "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_no_matchdict(self):\n        class DummyRequest:\n            matchdict = None\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\n    def test_matchdict(self):\n        class DummyRequest:\n            pass\n        request = DummyRequest()\n        request.matchdict = {'a':1, 'b':2}\n        root = self._makeOne(request)\n        self.assertEqual(root.a, 1)\n        self.assertEqual(root.b, 2)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 1288,
                            "end_lineno": 1295,
                            "parent": {
                                "file_name": "pyramid/tests/test_traversal.py",
                                "type": "class",
                                "name": "TestDefaultRootFactory",
                                "content": "class TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_no_matchdict(self):\n        class DummyRequest:\n            matchdict = None\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\n    def test_matchdict(self):\n        class DummyRequest:\n            pass\n        request = DummyRequest()\n        request.matchdict = {'a':1, 'b':2}\n        root = self._makeOne(request)\n        self.assertEqual(root.a, 1)\n        self.assertEqual(root.b, 2)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 1273,
                                "end_lineno": 1295,
                                "parent": null
                            }
                        }
                    ]
                }
            ]
        },
        {
            "old_file_content": "import warnings\n\nfrom zope.deprecation import deprecated\n\nfrom zope.interface import implementer\nfrom zope.interface.interfaces import IInterface\n\nfrom repoze.lru import lru_cache\n\nfrom pyramid.interfaces import (\n    IResourceURL,\n    IRequestFactory,\n    ITraverser,\n    VH_ROOT_KEY,\n    )\n\nwith warnings.catch_warnings():\n    warnings.filterwarnings('ignore')\n    from pyramid.interfaces import IContextURL\n\nfrom pyramid.compat import (\n    PY3,\n    native_,\n    text_,\n    ascii_native_,\n    text_type,\n    binary_type,\n    is_nonstr_iter,\n    decode_path_info,\n    unquote_bytes_to_wsgi,\n    )\n\nfrom pyramid.encode import url_quote\nfrom pyramid.exceptions import URLDecodeError\nfrom pyramid.location import lineage\nfrom pyramid.threadlocal import get_current_registry\n\nempty = text_('')\n\ndef find_root(resource):\n    \"\"\" Find the root node in the resource tree to which ``resource``\n    belongs. Note that ``resource`` should be :term:`location`-aware.\n    Note that the root resource is available in the request object by\n    accessing the ``request.root`` attribute.\n    \"\"\"\n    for location in lineage(resource):\n        if location.__parent__ is None:\n            resource = location\n            break\n    return resource\n\ndef find_resource(resource, path):\n    \"\"\" Given a resource object and a string or tuple representing a path\n    (such as the return value of :func:`pyramid.traversal.resource_path` or\n    :func:`pyramid.traversal.resource_path_tuple`), return a resource in this\n    application's resource tree at the specified path.  The resource passed\n    in *must* be :term:`location`-aware.  If the path cannot be resolved (if\n    the respective node in the resource tree does not exist), a\n    :exc:`KeyError` will be raised.\n\n    This function is the logical inverse of\n    :func:`pyramid.traversal.resource_path` and\n    :func:`pyramid.traversal.resource_path_tuple`; it can resolve any\n    path string or tuple generated by either of those functions.\n\n    Rules for passing a *string* as the ``path`` argument: if the\n    first character in the path string is the ``/``\n    character, the path is considered absolute and the resource tree\n    traversal will start at the root resource.  If the first character\n    of the path string is *not* the ``/`` character, the path is\n    considered relative and resource tree traversal will begin at the resource\n    object supplied to the function as the ``resource`` argument.  If an\n    empty string is passed as ``path``, the ``resource`` passed in will\n    be returned.  Resource path strings must be escaped in the following\n    manner: each Unicode path segment must be encoded as UTF-8 and as\n    each path segment must escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or\n    ``to%20the/La%20Pe%C3%B1a`` (relative).  The\n    :func:`pyramid.traversal.resource_path` function generates strings\n    which follow these rules (albeit only absolute ones).\n\n    Rules for passing *text* (Unicode) as the ``path`` argument are the same\n    as those for a string.  In particular, the text may not have any nonascii\n    characters in it.\n\n    Rules for passing a *tuple* as the ``path`` argument: if the first\n    element in the path tuple is the empty string (for example ``('',\n    'a', 'b', 'c')``, the path is considered absolute and the resource tree\n    traversal will start at the resource tree root object.  If the first\n    element in the path tuple is not the empty string (for example\n    ``('a', 'b', 'c')``), the path is considered relative and resource tree\n    traversal will begin at the resource object supplied to the function\n    as the ``resource`` argument.  If an empty sequence is passed as\n    ``path``, the ``resource`` passed in itself will be returned.  No\n    URL-quoting or UTF-8-encoding of individual path segments within\n    the tuple is required (each segment may be any string or unicode\n    object representing a resource name).  Resource path tuples generated by\n    :func:`pyramid.traversal.resource_path_tuple` can always be\n    resolved by ``find_resource``.\n\n    .. note:: For backwards compatibility purposes, this function can also\n       be imported as :func:`pyramid.traversal.find_model`, although doing so\n       will emit a deprecation warning.\n    \"\"\"\n    if isinstance(path, text_type):\n        path = ascii_native_(path)\n    D = traverse(resource, path)\n    view_name = D['view_name']\n    context = D['context']\n    if view_name:\n        raise KeyError('%r has no subelement %s' % (context, view_name))\n    return context\n\nfind_model = find_resource # b/w compat (forever)\n\ndef find_interface(resource, class_or_interface):\n    \"\"\"\n    Return the first resource found in the :term:`lineage` of ``resource``\n    which, a) if ``class_or_interface`` is a Python class object, is an\n    instance of the class or any subclass of that class or b) if\n    ``class_or_interface`` is a :term:`interface`, provides the specified\n    interface.  Return ``None`` if no resource providing ``interface_or_class``\n    can be found in the lineage.  The ``resource`` passed in *must* be\n    :term:`location`-aware.\n    \"\"\"\n    if IInterface.providedBy(class_or_interface):\n        test = class_or_interface.providedBy\n    else:\n        test = lambda arg: isinstance(arg, class_or_interface)\n    for location in lineage(resource):\n        if test(location):\n            return location\n\ndef resource_path(resource, *elements):\n    \"\"\" Return a string object representing the absolute physical path of the\n    resource object based on its position in the resource tree, e.g\n    ``/foo/bar``.  Any positional arguments passed in as ``elements`` will be\n    appended as path segments to the end of the resource path.  For instance,\n    if the resource's path is ``/foo/bar`` and ``elements`` equals ``('a',\n    'b')``, the returned string will be ``/foo/bar/a/b``.  The first\n    character in the string will always be the ``/`` character (a leading\n    ``/`` character in a path string represents that the path is absolute).\n\n    Resource path strings returned will be escaped in the following\n    manner: each unicode path segment will be encoded as UTF-8 and\n    each path segment will be escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a``.\n\n    This function is a logical inverse of\n    :mod:`pyramid.traversal.find_resource`: it can be used to generate\n    path references that can later be resolved via that function.\n\n    The ``resource`` passed in *must* be :term:`location`-aware.\n\n    .. note::\n\n       Each segment in the path string returned will use the ``__name__``\n       attribute of the resource it represents within the resource tree.  Each\n       of these segments *should* be a unicode or string object (as per the\n       contract of :term:`location`-awareness).  However, no conversion or\n       safety checking of resource names is performed.  For instance, if one of\n       the resources in your tree has a ``__name__`` which (by error) is a\n       dictionary, the :func:`pyramid.traversal.resource_path` function will\n       attempt to append it to a string and it will cause a\n       :exc:`pyramid.exceptions.URLDecodeError`.\n\n    .. note::\n\n       The :term:`root` resource *must* have a ``__name__`` attribute with a\n       value of either ``None`` or the empty string for paths to be generated\n       properly.  If the root resource has a non-null ``__name__`` attribute,\n       its name will be prepended to the generated path rather than a single\n       leading '/' character.\n\n    .. note::\n\n       For backwards compatibility purposes, this function can also\n       be imported as ``model_path``, although doing so will cause\n       a deprecation warning to be emitted.\n    \"\"\"\n    # joining strings is a bit expensive so we delegate to a function\n    # which caches the joined result for us\n    return _join_path_tuple(resource_path_tuple(resource, *elements))\n\nmodel_path = resource_path # b/w compat (forever)\n\ndef traverse(resource, path):\n    \"\"\"Given a resource object as ``resource`` and a string or tuple\n    representing a path as ``path`` (such as the return value of\n    :func:`pyramid.traversal.resource_path` or\n    :func:`pyramid.traversal.resource_path_tuple` or the value of\n    ``request.environ['PATH_INFO']``), return a dictionary with the\n    keys ``context``, ``root``, ``view_name``, ``subpath``,\n    ``traversed``, ``virtual_root``, and ``virtual_root_path``.\n\n    A definition of each value in the returned dictionary:\n\n    - ``context``: The :term:`context` (a :term:`resource` object) found\n      via traversal or url dispatch.  If the ``path`` passed in is the\n      empty string, the value of the ``resource`` argument passed to this\n      function is returned.\n\n    - ``root``: The resource object at which :term:`traversal` begins.\n      If the ``resource`` passed in was found via url dispatch or if the\n      ``path`` passed in was relative (non-absolute), the value of the\n      ``resource`` argument passed to this function is returned.\n\n    - ``view_name``: The :term:`view name` found during\n      :term:`traversal` or :term:`url dispatch`; if the ``resource`` was\n      found via traversal, this is usually a representation of the\n      path segment which directly follows the path to the ``context``\n      in the ``path``.  The ``view_name`` will be a Unicode object or\n      the empty string.  The ``view_name`` will be the empty string if\n      there is no element which follows the ``context`` path.  An\n      example: if the path passed is ``/foo/bar``, and a resource\n      object is found at ``/foo`` (but not at ``/foo/bar``), the 'view\n      name' will be ``u'bar'``.  If the ``resource`` was found via\n      urldispatch, the view_name will be the name the route found was\n      registered with.\n\n    - ``subpath``: For a ``resource`` found via :term:`traversal`, this\n      is a sequence of path segments found in the ``path`` that follow\n      the ``view_name`` (if any).  Each of these items is a Unicode\n      object.  If no path segments follow the ``view_name``, the\n      subpath will be the empty sequence.  An example: if the path\n      passed is ``/foo/bar/baz/buz``, and a resource object is found at\n      ``/foo`` (but not ``/foo/bar``), the 'view name' will be\n      ``u'bar'`` and the :term:`subpath` will be ``[u'baz', u'buz']``.\n      For a ``resource`` found via url dispatch, the subpath will be a\n      sequence of values discerned from ``*subpath`` in the route\n      pattern matched or the empty sequence.\n\n    - ``traversed``: The sequence of path elements traversed from the\n      root to find the ``context`` object during :term:`traversal`.\n      Each of these items is a Unicode object.  If no path segments\n      were traversed to find the ``context`` object (e.g. if the\n      ``path`` provided is the empty string), the ``traversed`` value\n      will be the empty sequence.  If the ``resource`` is a resource found\n      via :term:`url dispatch`, traversed will be None.\n\n    - ``virtual_root``: A resource object representing the 'virtual' root\n      of the resource tree being traversed during :term:`traversal`.\n      See :ref:`vhosting_chapter` for a definition of the virtual root\n      object.  If no virtual hosting is in effect, and the ``path``\n      passed in was absolute, the ``virtual_root`` will be the\n      *physical* root resource object (the object at which :term:`traversal`\n      begins).  If the ``resource`` passed in was found via :term:`URL\n      dispatch` or if the ``path`` passed in was relative, the\n      ``virtual_root`` will always equal the ``root`` object (the\n      resource passed in).\n\n    - ``virtual_root_path`` -- If :term:`traversal` was used to find\n      the ``resource``, this will be the sequence of path elements\n      traversed to find the ``virtual_root`` resource.  Each of these\n      items is a Unicode object.  If no path segments were traversed\n      to find the ``virtual_root`` resource (e.g. if virtual hosting is\n      not in effect), the ``traversed`` value will be the empty list.\n      If url dispatch was used to find the ``resource``, this will be\n      ``None``.\n\n    If the path cannot be resolved, a :exc:`KeyError` will be raised.\n\n    Rules for passing a *string* as the ``path`` argument: if the\n    first character in the path string is the with the ``/``\n    character, the path will considered absolute and the resource tree\n    traversal will start at the root resource.  If the first character\n    of the path string is *not* the ``/`` character, the path is\n    considered relative and resource tree traversal will begin at the resource\n    object supplied to the function as the ``resource`` argument.  If an\n    empty string is passed as ``path``, the ``resource`` passed in will\n    be returned.  Resource path strings must be escaped in the following\n    manner: each Unicode path segment must be encoded as UTF-8 and\n    each path segment must escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or\n    ``to%20the/La%20Pe%C3%B1a`` (relative).  The\n    :func:`pyramid.traversal.resource_path` function generates strings\n    which follow these rules (albeit only absolute ones).\n\n    Rules for passing a *tuple* as the ``path`` argument: if the first\n    element in the path tuple is the empty string (for example ``('',\n    'a', 'b', 'c')``, the path is considered absolute and the resource tree\n    traversal will start at the resource tree root object.  If the first\n    element in the path tuple is not the empty string (for example\n    ``('a', 'b', 'c')``), the path is considered relative and resource tree\n    traversal will begin at the resource object supplied to the function\n    as the ``resource`` argument.  If an empty sequence is passed as\n    ``path``, the ``resource`` passed in itself will be returned.  No\n    URL-quoting or UTF-8-encoding of individual path segments within\n    the tuple is required (each segment may be any string or unicode\n    object representing a resource name).\n\n    Explanation of the conversion of ``path`` segment values to\n    Unicode during traversal: Each segment is URL-unquoted, and\n    decoded into Unicode. Each segment is assumed to be encoded using\n    the UTF-8 encoding (or a subset, such as ASCII); a\n    :exc:`pyramid.exceptions.URLDecodeError` is raised if a segment\n    cannot be decoded.  If a segment name is empty or if it is ``.``,\n    it is ignored.  If a segment name is ``..``, the previous segment\n    is deleted, and the ``..`` is ignored.  As a result of this\n    process, the return values ``view_name``, each element in the\n    ``subpath``, each element in ``traversed``, and each element in\n    the ``virtual_root_path`` will be Unicode as opposed to a string,\n    and will be URL-decoded.\n    \"\"\"\n\n    if is_nonstr_iter(path):\n        # the traverser factory expects PATH_INFO to be a string, not\n        # unicode and it expects path segments to be utf-8 and\n        # urlencoded (it's the same traverser which accepts PATH_INFO\n        # from user agents; user agents always send strings).\n        if path:\n            path = _join_path_tuple(tuple(path))\n        else:\n            path = ''\n\n    # The user is supposed to pass us a string object, never Unicode.  In\n    # practice, however, users indeed pass Unicode to this API.  If they do\n    # pass a Unicode object, its data *must* be entirely encodeable to ASCII,\n    # so we encode it here as a convenience to the user and to prevent\n    # second-order failures from cropping up (all failures will occur at this\n    # step rather than later down the line as the result of calling\n    # ``traversal_path``).\n\n    path = ascii_native_(path)\n\n    if path and path[0] == '/':\n        resource = find_root(resource)\n\n    reg = get_current_registry()\n\n    request_factory = reg.queryUtility(IRequestFactory)\n    if request_factory is None:\n        from pyramid.request import Request # avoid circdep\n        request_factory = Request\n\n    request = request_factory.blank(path)\n    request.registry = reg\n    traverser = reg.queryAdapter(resource, ITraverser)\n    if traverser is None:\n        traverser = ResourceTreeTraverser(resource)\n\n    return traverser(request)\n\ndef resource_path_tuple(resource, *elements):\n    \"\"\"\n    Return a tuple representing the absolute physical path of the\n    ``resource`` object based on its position in a resource tree, e.g\n    ``('', 'foo', 'bar')``.  Any positional arguments passed in as\n    ``elements`` will be appended as elements in the tuple\n    representing the resource path.  For instance, if the resource's\n    path is ``('', 'foo', 'bar')`` and elements equals ``('a', 'b')``,\n    the returned tuple will be ``('', 'foo', 'bar', 'a', 'b')``.  The\n    first element of this tuple will always be the empty string (a\n    leading empty string element in a path tuple represents that the\n    path is absolute).\n\n    This function is a logical inverse of\n    :func:`pyramid.traversal.find_resource`: it can be used to\n    generate path references that can later be resolved by that function.\n\n    The ``resource`` passed in *must* be :term:`location`-aware.\n\n    .. note::\n\n       Each segment in the path tuple returned will equal the ``__name__``\n       attribute of the resource it represents within the resource tree.  Each\n       of these segments *should* be a unicode or string object (as per the\n       contract of :term:`location`-awareness).  However, no conversion or\n       safety checking of resource names is performed.  For instance, if one of\n       the resources in your tree has a ``__name__`` which (by error) is a\n       dictionary, that dictionary will be placed in the path tuple; no warning\n       or error will be given.\n\n    .. note::\n\n       The :term:`root` resource *must* have a ``__name__`` attribute with a\n       value of either ``None`` or the empty string for path tuples to be\n       generated properly.  If the root resource has a non-null ``__name__``\n       attribute, its name will be the first element in the generated path tuple\n       rather than the empty string.\n\n    .. note::\n\n       For backwards compatibility purposes, this function can also be imported\n       as ``model_path_tuple``, although doing so will cause a deprecation\n       warning to be emitted.\n    \"\"\"\n    return tuple(_resource_path_list(resource, *elements))\n\nmodel_path_tuple = resource_path_tuple  # b/w compat (forever)\n\ndef _resource_path_list(resource, *elements):\n    \"\"\" Implementation detail shared by resource_path and resource_path_tuple\"\"\"\n    path = [loc.__name__ or '' for loc in lineage(resource)]\n    path.reverse()\n    path.extend(elements)\n    return path\n\n_model_path_list = _resource_path_list # b/w compat, not an API\n\ndef virtual_root(resource, request):\n    \"\"\"\n    Provided any :term:`resource` and a :term:`request` object, return\n    the resource object representing the :term:`virtual root` of the\n    current :term:`request`.  Using a virtual root in a\n    :term:`traversal` -based :app:`Pyramid` application permits\n    rooting, for example, the resource at the traversal path ``/cms`` at\n    ``http://example.com/`` instead of rooting it at\n    ``http://example.com/cms/``.\n\n    If the ``resource`` passed in is a context obtained via\n    :term:`traversal`, and if the ``HTTP_X_VHM_ROOT`` key is in the\n    WSGI environment, the value of this key will be treated as a\n    'virtual root path': the :func:`pyramid.traversal.find_resource`\n    API will be used to find the virtual root resource using this path;\n    if the resource is found, it will be returned.  If the\n    ``HTTP_X_VHM_ROOT`` key is not present in the WSGI environment,\n    the physical :term:`root` of the resource tree will be returned instead.\n\n    Virtual roots are not useful at all in applications that use\n    :term:`URL dispatch`. Contexts obtained via URL dispatch don't\n    really support being virtually rooted (each URL dispatch context\n    is both its own physical and virtual root).  However if this API\n    is called with a ``resource`` argument which is a context obtained\n    via URL dispatch, the resource passed in will be returned\n    unconditionally.\"\"\"\n    try:\n        reg = request.registry\n    except AttributeError:\n        reg = get_current_registry() # b/c\n    urlgenerator = reg.queryMultiAdapter((resource, request), IContextURL)\n    if urlgenerator is None:\n        urlgenerator = TraversalContextURL(resource, request)\n    return urlgenerator.virtual_root()\n\ndef traversal_path(path):\n    \"\"\" Variant of :func:`pyramid.traversal.traversal_path_info` suitable for\n    decoding paths that are URL-encoded.\n\n    If this function is passed a Unicode object instead of a sequence of\n    bytes as ``path``, that Unicode object *must* directly encodeable to\n    ASCII.  For example, u'/foo' will work but u'/<unprintable unicode>' (a\n    Unicode object with characters that cannot be encoded to ascii) will\n    not. A :exc:`UnicodeEncodeError` will be raised if the Unicode cannot be\n    encoded directly to ASCII.\n    \"\"\"\n    if isinstance(path, text_type):\n        # must not possess characters outside ascii\n        path = path.encode('ascii')\n    # we unquote this path exactly like a PEP 3333 server would\n    path = unquote_bytes_to_wsgi(path) # result will be a native string\n    return traversal_path_info(path) # result will be a tuple of unicode\n\n@lru_cache(1000)\ndef traversal_path_info(path):\n    \"\"\" Given``path``, return a tuple representing that path which can be\n    used to traverse a resource tree.  ``path`` is assumed to be an\n    already-URL-decoded ``str`` type as if it had come to us from an upstream\n    WSGI server as the ``PATH_INFO`` environ variable.\n\n    The ``path`` is first decoded to from its WSGI representation to Unicode;\n    it is decoded differently depending on platform:\n\n    - On Python 2, ``path`` is decoded to Unicode from bytes using the UTF-8\n      decoding directly; a :exc:`pyramid.exc.URLDecodeError` is raised if a the\n      URL cannot be decoded.\n\n    - On Python 3, as per the PEP 3333 spec, ``path`` is first encoded to\n      bytes using the Latin-1 encoding; the resulting set of bytes is\n      subsequently decoded to text using the UTF-8 encoding; a\n      :exc:`pyramid.exc.URLDecodeError` is raised if a the URL cannot be\n      decoded.\n\n    The ``path`` is split on slashes, creating a list of segments.  If a\n    segment name is empty or if it is ``.``, it is ignored.  If a segment\n    name is ``..``, the previous segment is deleted, and the ``..`` is\n    ignored.\n\n    Examples:\n\n    ``/``\n\n        ()\n\n    ``/foo/bar/baz``\n\n        (u'foo', u'bar', u'baz')\n\n    ``foo/bar/baz``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo/bar/baz/``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo//bar//baz/``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo/bar/baz/..``\n\n        (u'foo', u'bar')\n\n    ``/my%20archives/hello``\n\n        (u'my archives', u'hello')\n\n    ``/archives/La%20Pe%C3%B1a``\n\n        (u'archives', u'<unprintable unicode>')\n\n    .. note::\n\n      This function does not generate the same type of tuples that\n      :func:`pyramid.traversal.resource_path_tuple` does.  In particular, the\n      leading empty string is not present in the tuple it returns, unlike tuples\n      returned by :func:`pyramid.traversal.resource_path_tuple`.  As a result,\n      tuples generated by ``traversal_path`` are not resolveable by the\n      :func:`pyramid.traversal.find_resource` API.  ``traversal_path`` is a\n      function mostly used by the internals of :app:`Pyramid` and by people\n      writing their own traversal machinery, as opposed to users writing\n      applications in :app:`Pyramid`.\n    \"\"\"\n    try:\n        path = decode_path_info(path) # result will be Unicode\n    except UnicodeDecodeError as e:\n        raise URLDecodeError(e.encoding, e.object, e.start, e.end, e.reason)\n    return split_path_info(path) # result will be tuple of Unicode\n\n@lru_cache(1000)\ndef split_path_info(path):\n    # suitable for splitting an already-unquoted-already-decoded (unicode)\n    # path value\n    path = path.strip('/')\n    clean = []\n    for segment in path.split('/'):\n        if not segment or segment == '.':\n            continue\n        elif segment == '..':\n            if clean:\n                del clean[-1]\n        else:\n            clean.append(segment)\n    return tuple(clean)\n\n_segment_cache = {}\n\nquote_path_segment_doc = \"\"\" \\\nReturn a quoted representation of a 'path segment' (such as\nthe string ``__name__`` attribute of a resource) as a string.  If the\n``segment`` passed in is a unicode object, it is converted to a\nUTF-8 string, then it is URL-quoted using Python's\n``urllib.quote``.  If the ``segment`` passed in is a string, it is\nURL-quoted using Python's :mod:`urllib.quote`.  If the segment\npassed in is not a string or unicode object, an error will be\nraised.  The return value of ``quote_path_segment`` is always a\nstring, never Unicode.\n\nYou may pass a string of characters that need not be encoded as\nthe ``safe`` argument to this function.  This corresponds to the\n``safe`` argument to :mod:`urllib.quote`.\n\n.. note::\n\n   The return value for each segment passed to this\n   function is cached in a module-scope dictionary for\n   speed: the cached version is returned when possible\n   rather than recomputing the quoted version.  No cache\n   emptying is ever done for the lifetime of an\n   application, however.  If you pass arbitrary\n   user-supplied strings to this function (as opposed to\n   some bounded set of values from a 'working set' known to\n   your application), it may become a memory leak.\n\"\"\"\n\n\nif PY3: # pragma: no cover\n    # special-case on Python 2 for speed?  unchecked\n    def quote_path_segment(segment, safe=''):\n        \"\"\" %s \"\"\" % quote_path_segment_doc\n        # The bit of this code that deals with ``_segment_cache`` is an\n        # optimization: we cache all the computation of URL path segments\n        # in this module-scope dictionary with the original string (or\n        # unicode value) as the key, so we can look it up later without\n        # needing to reencode or re-url-quote it\n        try:\n            return _segment_cache[(segment, safe)]\n        except KeyError:\n            if segment.__class__ not in (text_type, binary_type):\n                segment = str(segment)\n            result = url_quote(native_(segment, 'utf-8'), safe)\n            # we don't need a lock to mutate _segment_cache, as the below\n            # will generate exactly one Python bytecode (STORE_SUBSCR)\n            _segment_cache[(segment, safe)] = result\n            return result\nelse:\n    def quote_path_segment(segment, safe=''):\n        \"\"\" %s \"\"\" % quote_path_segment_doc\n        # The bit of this code that deals with ``_segment_cache`` is an\n        # optimization: we cache all the computation of URL path segments\n        # in this module-scope dictionary with the original string (or\n        # unicode value) as the key, so we can look it up later without\n        # needing to reencode or re-url-quote it\n        try:\n            return _segment_cache[(segment, safe)]\n        except KeyError:\n            if segment.__class__ is text_type: #isinstance slighly slower (~15%)\n                result = url_quote(segment.encode('utf-8'), safe)\n            else:\n                result = url_quote(str(segment), safe)\n            # we don't need a lock to mutate _segment_cache, as the below\n            # will generate exactly one Python bytecode (STORE_SUBSCR)\n            _segment_cache[(segment, safe)] = result\n            return result\n    \nslash = text_('/')\n\n@implementer(ITraverser)\nclass ResourceTreeTraverser(object):\n    \"\"\" A resource tree traverser that should be used (for speed) when\n    every resource in the tree supplies a ``__name__`` and\n    ``__parent__`` attribute (ie. every resource in the tree is\n    :term:`location` aware) .\"\"\"\n\n\n    VIEW_SELECTOR = '@@'\n\n    def __init__(self, root):\n        self.root = root\n\n    def __call__(self, request):\n        environ = request.environ\n        matchdict = request.matchdict\n\n        if matchdict is not None:\n\n            path = matchdict.get('traverse', slash) or slash\n            if is_nonstr_iter(path):\n                # this is a *traverse stararg (not a {traverse})\n                # routing has already decoded these elements, so we just\n                # need to join them\n                path = '/' + slash.join(path) or slash\n\n            subpath = matchdict.get('subpath', ())\n            if not is_nonstr_iter(subpath):\n                # this is not a *subpath stararg (just a {subpath})\n                # routing has already decoded this string, so we just need\n                # to split it\n                subpath = split_path_info(subpath)\n\n        else:\n            # this request did not match a route\n            subpath = ()\n            try:\n                # empty if mounted under a path in mod_wsgi, for example\n                path = request.path_info or slash\n            except KeyError:\n                # if environ['PATH_INFO'] is just not there\n                path = slash\n            except UnicodeDecodeError as e:\n                raise URLDecodeError(e.encoding, e.object, e.start, e.end,\n                                     e.reason)\n\n        if VH_ROOT_KEY in environ:\n            # HTTP_X_VHM_ROOT\n            vroot_path = decode_path_info(environ[VH_ROOT_KEY]) \n            vroot_tuple = split_path_info(vroot_path)\n            vpath = vroot_path + path # both will (must) be unicode or asciistr\n            vroot_idx = len(vroot_tuple) -1\n        else:\n            vroot_tuple = ()\n            vpath = path\n            vroot_idx = -1\n\n        root = self.root\n        ob = vroot = root\n\n        if vpath == slash: # invariant: vpath must not be empty\n            # prevent a call to traversal_path if we know it's going\n            # to return the empty tuple\n            vpath_tuple = ()\n        else:\n            # we do dead reckoning here via tuple slicing instead of\n            # pushing and popping temporary lists for speed purposes\n            # and this hurts readability; apologies\n            i = 0\n            view_selector = self.VIEW_SELECTOR\n            vpath_tuple = split_path_info(vpath)\n            for segment in vpath_tuple:\n                if segment[:2] == view_selector:\n                    return {'context':ob,\n                            'view_name':segment[2:],\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n                try:\n                    getitem = ob.__getitem__\n                except AttributeError:\n                    return {'context':ob,\n                            'view_name':segment,\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n\n                try:\n                    next = getitem(segment)\n                except KeyError:\n                    return {'context':ob,\n                            'view_name':segment,\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n                if i == vroot_idx:\n                    vroot = next\n                ob = next\n                i += 1\n\n        return {'context':ob, 'view_name':empty, 'subpath':subpath,\n                'traversed':vpath_tuple, 'virtual_root':vroot,\n                'virtual_root_path':vroot_tuple, 'root':root}\n\nModelGraphTraverser = ResourceTreeTraverser # b/w compat, not API, used in wild\n\n@implementer(IResourceURL, IContextURL)\nclass ResourceURL(object):\n    vroot_varname = VH_ROOT_KEY\n\n    def __init__(self, resource, request):\n        physical_path_tuple = resource_path_tuple(resource)\n        physical_path = _join_path_tuple(physical_path_tuple)\n\n        if physical_path_tuple != ('',):\n            physical_path_tuple = physical_path_tuple + ('',)\n            physical_path = physical_path + '/'\n\n        virtual_path = physical_path\n        virtual_path_tuple = physical_path_tuple\n\n        environ = request.environ\n        vroot_path = environ.get(self.vroot_varname)\n\n        # if the physical path starts with the virtual root path, trim it out\n        # of the virtual path\n        if vroot_path is not None:\n            vroot_path = vroot_path.rstrip('/')\n            if vroot_path and physical_path.startswith(vroot_path):\n                vroot_path_tuple = tuple(vroot_path.split('/'))\n                numels = len(vroot_path_tuple)\n                virtual_path_tuple = ('',) + physical_path_tuple[numels:]\n                virtual_path = physical_path[len(vroot_path):]\n\n        self.virtual_path = virtual_path    # IResourceURL attr\n        self.physical_path = physical_path  # IResourceURL attr\n        self.virtual_path_tuple = virtual_path_tuple # IResourceURL attr (1.5)\n        self.physical_path_tuple = physical_path_tuple # IResourceURL attr (1.5)\n\n        # bw compat for IContextURL methods\n        self.resource = resource\n        self.context = resource\n        self.request = request\n\n    # IContextURL method (deprecated in 1.3)\n    def virtual_root(self):\n        environ = self.request.environ\n        vroot_varname = self.vroot_varname\n        if vroot_varname in environ:\n            return find_resource(self.context, environ[vroot_varname])\n        # shortcut instead of using find_root; we probably already\n        # have it on the request\n        try:\n            return self.request.root\n        except AttributeError:\n            return find_root(self.context)\n\n    # IContextURL method (deprecated in 1.3)\n    def __call__(self):\n        \"\"\" Generate a URL based on the :term:`lineage` of a :term:`resource`\n        object that is ``self.context``.  If any resource in the context\n        lineage has a Unicode name, it will be converted to a UTF-8 string\n        before being attached to the URL.  If a ``HTTP_X_VHM_ROOT`` key is\n        present in the WSGI environment, its value will be treated as a\n        'virtual root path': the path of the URL generated by this will be\n        left-stripped of this virtual root path value.\n        \"\"\"\n        local_url = getattr(self.context, '__resource_url__', None)\n        if local_url is not None:\n            result = local_url(\n                self.request,\n                {'virtual_path':self.virtual_path,\n                 'physical_path':self.physical_path},\n                )\n            if result is not None:\n                # allow it to punt by returning ``None``\n                return result\n\n        app_url = self.request.application_url # never ends in a slash\n        return app_url + self.virtual_path\n\nTraversalContextURL = ResourceURL # deprecated as of 1.3\n\ndeprecated(\n    'TraversalContextURL',\n    'As of Pyramid 1.3 the, \"pyramid.traversal.TraversalContextURL\" class is '\n    'scheduled to be removed.   Use the '\n    '\"pyramid.config.Configurator.add_resource_url_adapter\" method to register '\n    'a class that implements \"pyramid.interfaces.IResourceURL\" instead. '\n    'See the \"What\\'s new In Pyramid 1.3\" document for a further description.'\n    )\n\n@lru_cache(1000)\ndef _join_path_tuple(tuple):\n    return tuple and '/'.join([quote_path_segment(x) for x in tuple]) or '/'\n\nclass DefaultRootFactory:\n    __parent__ = None\n    __name__ = None\n    def __init__(self, request):\n        matchdict = request.matchdict\n        # provide backwards compatibility for applications which\n        # used routes (at least apps without any custom \"context\n        # factory\") in BFG 0.9.X and before\n        if matchdict is not None:\n            self.__dict__.update(matchdict)\n",
            "new_file_content": "import warnings\n\nfrom zope.deprecation import deprecated\n\nfrom zope.interface import implementer\nfrom zope.interface.interfaces import IInterface\n\nfrom repoze.lru import lru_cache\n\nfrom pyramid.interfaces import (\n    IResourceURL,\n    IRequestFactory,\n    ITraverser,\n    VH_ROOT_KEY,\n    )\n\nwith warnings.catch_warnings():\n    warnings.filterwarnings('ignore')\n    from pyramid.interfaces import IContextURL\n\nfrom pyramid.compat import (\n    PY3,\n    native_,\n    text_,\n    ascii_native_,\n    text_type,\n    binary_type,\n    is_nonstr_iter,\n    decode_path_info,\n    unquote_bytes_to_wsgi,\n    )\n\nfrom pyramid.encode import url_quote\nfrom pyramid.exceptions import URLDecodeError\nfrom pyramid.location import lineage\nfrom pyramid.threadlocal import get_current_registry\n\nempty = text_('')\n\ndef find_root(resource):\n    \"\"\" Find the root node in the resource tree to which ``resource``\n    belongs. Note that ``resource`` should be :term:`location`-aware.\n    Note that the root resource is available in the request object by\n    accessing the ``request.root`` attribute.\n    \"\"\"\n    for location in lineage(resource):\n        if location.__parent__ is None:\n            resource = location\n            break\n    return resource\n\ndef find_resource(resource, path):\n    \"\"\" Given a resource object and a string or tuple representing a path\n    (such as the return value of :func:`pyramid.traversal.resource_path` or\n    :func:`pyramid.traversal.resource_path_tuple`), return a resource in this\n    application's resource tree at the specified path.  The resource passed\n    in *must* be :term:`location`-aware.  If the path cannot be resolved (if\n    the respective node in the resource tree does not exist), a\n    :exc:`KeyError` will be raised.\n\n    This function is the logical inverse of\n    :func:`pyramid.traversal.resource_path` and\n    :func:`pyramid.traversal.resource_path_tuple`; it can resolve any\n    path string or tuple generated by either of those functions.\n\n    Rules for passing a *string* as the ``path`` argument: if the\n    first character in the path string is the ``/``\n    character, the path is considered absolute and the resource tree\n    traversal will start at the root resource.  If the first character\n    of the path string is *not* the ``/`` character, the path is\n    considered relative and resource tree traversal will begin at the resource\n    object supplied to the function as the ``resource`` argument.  If an\n    empty string is passed as ``path``, the ``resource`` passed in will\n    be returned.  Resource path strings must be escaped in the following\n    manner: each Unicode path segment must be encoded as UTF-8 and as\n    each path segment must escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or\n    ``to%20the/La%20Pe%C3%B1a`` (relative).  The\n    :func:`pyramid.traversal.resource_path` function generates strings\n    which follow these rules (albeit only absolute ones).\n\n    Rules for passing *text* (Unicode) as the ``path`` argument are the same\n    as those for a string.  In particular, the text may not have any nonascii\n    characters in it.\n\n    Rules for passing a *tuple* as the ``path`` argument: if the first\n    element in the path tuple is the empty string (for example ``('',\n    'a', 'b', 'c')``, the path is considered absolute and the resource tree\n    traversal will start at the resource tree root object.  If the first\n    element in the path tuple is not the empty string (for example\n    ``('a', 'b', 'c')``), the path is considered relative and resource tree\n    traversal will begin at the resource object supplied to the function\n    as the ``resource`` argument.  If an empty sequence is passed as\n    ``path``, the ``resource`` passed in itself will be returned.  No\n    URL-quoting or UTF-8-encoding of individual path segments within\n    the tuple is required (each segment may be any string or unicode\n    object representing a resource name).  Resource path tuples generated by\n    :func:`pyramid.traversal.resource_path_tuple` can always be\n    resolved by ``find_resource``.\n\n    .. note:: For backwards compatibility purposes, this function can also\n       be imported as :func:`pyramid.traversal.find_model`, although doing so\n       will emit a deprecation warning.\n    \"\"\"\n    if isinstance(path, text_type):\n        path = ascii_native_(path)\n    D = traverse(resource, path)\n    view_name = D['view_name']\n    context = D['context']\n    if view_name:\n        raise KeyError('%r has no subelement %s' % (context, view_name))\n    return context\n\nfind_model = find_resource # b/w compat (forever)\n\ndef find_interface(resource, class_or_interface):\n    \"\"\"\n    Return the first resource found in the :term:`lineage` of ``resource``\n    which, a) if ``class_or_interface`` is a Python class object, is an\n    instance of the class or any subclass of that class or b) if\n    ``class_or_interface`` is a :term:`interface`, provides the specified\n    interface.  Return ``None`` if no resource providing ``interface_or_class``\n    can be found in the lineage.  The ``resource`` passed in *must* be\n    :term:`location`-aware.\n    \"\"\"\n    if IInterface.providedBy(class_or_interface):\n        test = class_or_interface.providedBy\n    else:\n        test = lambda arg: isinstance(arg, class_or_interface)\n    for location in lineage(resource):\n        if test(location):\n            return location\n\ndef resource_path(resource, *elements):\n    \"\"\" Return a string object representing the absolute physical path of the\n    resource object based on its position in the resource tree, e.g\n    ``/foo/bar``.  Any positional arguments passed in as ``elements`` will be\n    appended as path segments to the end of the resource path.  For instance,\n    if the resource's path is ``/foo/bar`` and ``elements`` equals ``('a',\n    'b')``, the returned string will be ``/foo/bar/a/b``.  The first\n    character in the string will always be the ``/`` character (a leading\n    ``/`` character in a path string represents that the path is absolute).\n\n    Resource path strings returned will be escaped in the following\n    manner: each unicode path segment will be encoded as UTF-8 and\n    each path segment will be escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a``.\n\n    This function is a logical inverse of\n    :mod:`pyramid.traversal.find_resource`: it can be used to generate\n    path references that can later be resolved via that function.\n\n    The ``resource`` passed in *must* be :term:`location`-aware.\n\n    .. note::\n\n       Each segment in the path string returned will use the ``__name__``\n       attribute of the resource it represents within the resource tree.  Each\n       of these segments *should* be a unicode or string object (as per the\n       contract of :term:`location`-awareness).  However, no conversion or\n       safety checking of resource names is performed.  For instance, if one of\n       the resources in your tree has a ``__name__`` which (by error) is a\n       dictionary, the :func:`pyramid.traversal.resource_path` function will\n       attempt to append it to a string and it will cause a\n       :exc:`pyramid.exceptions.URLDecodeError`.\n\n    .. note::\n\n       The :term:`root` resource *must* have a ``__name__`` attribute with a\n       value of either ``None`` or the empty string for paths to be generated\n       properly.  If the root resource has a non-null ``__name__`` attribute,\n       its name will be prepended to the generated path rather than a single\n       leading '/' character.\n\n    .. note::\n\n       For backwards compatibility purposes, this function can also\n       be imported as ``model_path``, although doing so will cause\n       a deprecation warning to be emitted.\n    \"\"\"\n    # joining strings is a bit expensive so we delegate to a function\n    # which caches the joined result for us\n    return _join_path_tuple(resource_path_tuple(resource, *elements))\n\nmodel_path = resource_path # b/w compat (forever)\n\ndef traverse(resource, path):\n    \"\"\"Given a resource object as ``resource`` and a string or tuple\n    representing a path as ``path`` (such as the return value of\n    :func:`pyramid.traversal.resource_path` or\n    :func:`pyramid.traversal.resource_path_tuple` or the value of\n    ``request.environ['PATH_INFO']``), return a dictionary with the\n    keys ``context``, ``root``, ``view_name``, ``subpath``,\n    ``traversed``, ``virtual_root``, and ``virtual_root_path``.\n\n    A definition of each value in the returned dictionary:\n\n    - ``context``: The :term:`context` (a :term:`resource` object) found\n      via traversal or url dispatch.  If the ``path`` passed in is the\n      empty string, the value of the ``resource`` argument passed to this\n      function is returned.\n\n    - ``root``: The resource object at which :term:`traversal` begins.\n      If the ``resource`` passed in was found via url dispatch or if the\n      ``path`` passed in was relative (non-absolute), the value of the\n      ``resource`` argument passed to this function is returned.\n\n    - ``view_name``: The :term:`view name` found during\n      :term:`traversal` or :term:`url dispatch`; if the ``resource`` was\n      found via traversal, this is usually a representation of the\n      path segment which directly follows the path to the ``context``\n      in the ``path``.  The ``view_name`` will be a Unicode object or\n      the empty string.  The ``view_name`` will be the empty string if\n      there is no element which follows the ``context`` path.  An\n      example: if the path passed is ``/foo/bar``, and a resource\n      object is found at ``/foo`` (but not at ``/foo/bar``), the 'view\n      name' will be ``u'bar'``.  If the ``resource`` was found via\n      urldispatch, the view_name will be the name the route found was\n      registered with.\n\n    - ``subpath``: For a ``resource`` found via :term:`traversal`, this\n      is a sequence of path segments found in the ``path`` that follow\n      the ``view_name`` (if any).  Each of these items is a Unicode\n      object.  If no path segments follow the ``view_name``, the\n      subpath will be the empty sequence.  An example: if the path\n      passed is ``/foo/bar/baz/buz``, and a resource object is found at\n      ``/foo`` (but not ``/foo/bar``), the 'view name' will be\n      ``u'bar'`` and the :term:`subpath` will be ``[u'baz', u'buz']``.\n      For a ``resource`` found via url dispatch, the subpath will be a\n      sequence of values discerned from ``*subpath`` in the route\n      pattern matched or the empty sequence.\n\n    - ``traversed``: The sequence of path elements traversed from the\n      root to find the ``context`` object during :term:`traversal`.\n      Each of these items is a Unicode object.  If no path segments\n      were traversed to find the ``context`` object (e.g. if the\n      ``path`` provided is the empty string), the ``traversed`` value\n      will be the empty sequence.  If the ``resource`` is a resource found\n      via :term:`url dispatch`, traversed will be None.\n\n    - ``virtual_root``: A resource object representing the 'virtual' root\n      of the resource tree being traversed during :term:`traversal`.\n      See :ref:`vhosting_chapter` for a definition of the virtual root\n      object.  If no virtual hosting is in effect, and the ``path``\n      passed in was absolute, the ``virtual_root`` will be the\n      *physical* root resource object (the object at which :term:`traversal`\n      begins).  If the ``resource`` passed in was found via :term:`URL\n      dispatch` or if the ``path`` passed in was relative, the\n      ``virtual_root`` will always equal the ``root`` object (the\n      resource passed in).\n\n    - ``virtual_root_path`` -- If :term:`traversal` was used to find\n      the ``resource``, this will be the sequence of path elements\n      traversed to find the ``virtual_root`` resource.  Each of these\n      items is a Unicode object.  If no path segments were traversed\n      to find the ``virtual_root`` resource (e.g. if virtual hosting is\n      not in effect), the ``traversed`` value will be the empty list.\n      If url dispatch was used to find the ``resource``, this will be\n      ``None``.\n\n    If the path cannot be resolved, a :exc:`KeyError` will be raised.\n\n    Rules for passing a *string* as the ``path`` argument: if the\n    first character in the path string is the with the ``/``\n    character, the path will considered absolute and the resource tree\n    traversal will start at the root resource.  If the first character\n    of the path string is *not* the ``/`` character, the path is\n    considered relative and resource tree traversal will begin at the resource\n    object supplied to the function as the ``resource`` argument.  If an\n    empty string is passed as ``path``, the ``resource`` passed in will\n    be returned.  Resource path strings must be escaped in the following\n    manner: each Unicode path segment must be encoded as UTF-8 and\n    each path segment must escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or\n    ``to%20the/La%20Pe%C3%B1a`` (relative).  The\n    :func:`pyramid.traversal.resource_path` function generates strings\n    which follow these rules (albeit only absolute ones).\n\n    Rules for passing a *tuple* as the ``path`` argument: if the first\n    element in the path tuple is the empty string (for example ``('',\n    'a', 'b', 'c')``, the path is considered absolute and the resource tree\n    traversal will start at the resource tree root object.  If the first\n    element in the path tuple is not the empty string (for example\n    ``('a', 'b', 'c')``), the path is considered relative and resource tree\n    traversal will begin at the resource object supplied to the function\n    as the ``resource`` argument.  If an empty sequence is passed as\n    ``path``, the ``resource`` passed in itself will be returned.  No\n    URL-quoting or UTF-8-encoding of individual path segments within\n    the tuple is required (each segment may be any string or unicode\n    object representing a resource name).\n\n    Explanation of the conversion of ``path`` segment values to\n    Unicode during traversal: Each segment is URL-unquoted, and\n    decoded into Unicode. Each segment is assumed to be encoded using\n    the UTF-8 encoding (or a subset, such as ASCII); a\n    :exc:`pyramid.exceptions.URLDecodeError` is raised if a segment\n    cannot be decoded.  If a segment name is empty or if it is ``.``,\n    it is ignored.  If a segment name is ``..``, the previous segment\n    is deleted, and the ``..`` is ignored.  As a result of this\n    process, the return values ``view_name``, each element in the\n    ``subpath``, each element in ``traversed``, and each element in\n    the ``virtual_root_path`` will be Unicode as opposed to a string,\n    and will be URL-decoded.\n    \"\"\"\n\n    if is_nonstr_iter(path):\n        # the traverser factory expects PATH_INFO to be a string, not\n        # unicode and it expects path segments to be utf-8 and\n        # urlencoded (it's the same traverser which accepts PATH_INFO\n        # from user agents; user agents always send strings).\n        if path:\n            path = _join_path_tuple(tuple(path))\n        else:\n            path = ''\n\n    # The user is supposed to pass us a string object, never Unicode.  In\n    # practice, however, users indeed pass Unicode to this API.  If they do\n    # pass a Unicode object, its data *must* be entirely encodeable to ASCII,\n    # so we encode it here as a convenience to the user and to prevent\n    # second-order failures from cropping up (all failures will occur at this\n    # step rather than later down the line as the result of calling\n    # ``traversal_path``).\n\n    path = ascii_native_(path)\n\n    if path and path[0] == '/':\n        resource = find_root(resource)\n\n    reg = get_current_registry()\n\n    request_factory = reg.queryUtility(IRequestFactory)\n    if request_factory is None:\n        from pyramid.request import Request # avoid circdep\n        request_factory = Request\n\n    request = request_factory.blank(path)\n    request.registry = reg\n    traverser = reg.queryAdapter(resource, ITraverser)\n    if traverser is None:\n        traverser = ResourceTreeTraverser(resource)\n\n    return traverser(request)\n\ndef resource_path_tuple(resource, *elements):\n    \"\"\"\n    Return a tuple representing the absolute physical path of the\n    ``resource`` object based on its position in a resource tree, e.g\n    ``('', 'foo', 'bar')``.  Any positional arguments passed in as\n    ``elements`` will be appended as elements in the tuple\n    representing the resource path.  For instance, if the resource's\n    path is ``('', 'foo', 'bar')`` and elements equals ``('a', 'b')``,\n    the returned tuple will be ``('', 'foo', 'bar', 'a', 'b')``.  The\n    first element of this tuple will always be the empty string (a\n    leading empty string element in a path tuple represents that the\n    path is absolute).\n\n    This function is a logical inverse of\n    :func:`pyramid.traversal.find_resource`: it can be used to\n    generate path references that can later be resolved by that function.\n\n    The ``resource`` passed in *must* be :term:`location`-aware.\n\n    .. note::\n\n       Each segment in the path tuple returned will equal the ``__name__``\n       attribute of the resource it represents within the resource tree.  Each\n       of these segments *should* be a unicode or string object (as per the\n       contract of :term:`location`-awareness).  However, no conversion or\n       safety checking of resource names is performed.  For instance, if one of\n       the resources in your tree has a ``__name__`` which (by error) is a\n       dictionary, that dictionary will be placed in the path tuple; no warning\n       or error will be given.\n\n    .. note::\n\n       The :term:`root` resource *must* have a ``__name__`` attribute with a\n       value of either ``None`` or the empty string for path tuples to be\n       generated properly.  If the root resource has a non-null ``__name__``\n       attribute, its name will be the first element in the generated path tuple\n       rather than the empty string.\n\n    .. note::\n\n       For backwards compatibility purposes, this function can also be imported\n       as ``model_path_tuple``, although doing so will cause a deprecation\n       warning to be emitted.\n    \"\"\"\n    return tuple(_resource_path_list(resource, *elements))\n\nmodel_path_tuple = resource_path_tuple  # b/w compat (forever)\n\ndef _resource_path_list(resource, *elements):\n    \"\"\" Implementation detail shared by resource_path and resource_path_tuple\"\"\"\n    path = [loc.__name__ or '' for loc in lineage(resource)]\n    path.reverse()\n    path.extend(elements)\n    return path\n\n_model_path_list = _resource_path_list # b/w compat, not an API\n\ndef virtual_root(resource, request):\n    \"\"\"\n    Provided any :term:`resource` and a :term:`request` object, return\n    the resource object representing the :term:`virtual root` of the\n    current :term:`request`.  Using a virtual root in a\n    :term:`traversal` -based :app:`Pyramid` application permits\n    rooting, for example, the resource at the traversal path ``/cms`` at\n    ``http://example.com/`` instead of rooting it at\n    ``http://example.com/cms/``.\n\n    If the ``resource`` passed in is a context obtained via\n    :term:`traversal`, and if the ``HTTP_X_VHM_ROOT`` key is in the\n    WSGI environment, the value of this key will be treated as a\n    'virtual root path': the :func:`pyramid.traversal.find_resource`\n    API will be used to find the virtual root resource using this path;\n    if the resource is found, it will be returned.  If the\n    ``HTTP_X_VHM_ROOT`` key is not present in the WSGI environment,\n    the physical :term:`root` of the resource tree will be returned instead.\n\n    Virtual roots are not useful at all in applications that use\n    :term:`URL dispatch`. Contexts obtained via URL dispatch don't\n    really support being virtually rooted (each URL dispatch context\n    is both its own physical and virtual root).  However if this API\n    is called with a ``resource`` argument which is a context obtained\n    via URL dispatch, the resource passed in will be returned\n    unconditionally.\"\"\"\n    try:\n        reg = request.registry\n    except AttributeError:\n        reg = get_current_registry() # b/c\n    urlgenerator = reg.queryMultiAdapter((resource, request), IContextURL)\n    if urlgenerator is None:\n        urlgenerator = TraversalContextURL(resource, request)\n    return urlgenerator.virtual_root()\n\ndef traversal_path(path):\n    \"\"\" Variant of :func:`pyramid.traversal.traversal_path_info` suitable for\n    decoding paths that are URL-encoded.\n\n    If this function is passed a Unicode object instead of a sequence of\n    bytes as ``path``, that Unicode object *must* directly encodeable to\n    ASCII.  For example, u'/foo' will work but u'/<unprintable unicode>' (a\n    Unicode object with characters that cannot be encoded to ascii) will\n    not. A :exc:`UnicodeEncodeError` will be raised if the Unicode cannot be\n    encoded directly to ASCII.\n    \"\"\"\n    if isinstance(path, text_type):\n        # must not possess characters outside ascii\n        path = path.encode('ascii')\n    # we unquote this path exactly like a PEP 3333 server would\n    path = unquote_bytes_to_wsgi(path) # result will be a native string\n    return traversal_path_info(path) # result will be a tuple of unicode\n\n@lru_cache(1000)\ndef traversal_path_info(path):\n    \"\"\" Given``path``, return a tuple representing that path which can be\n    used to traverse a resource tree.  ``path`` is assumed to be an\n    already-URL-decoded ``str`` type as if it had come to us from an upstream\n    WSGI server as the ``PATH_INFO`` environ variable.\n\n    The ``path`` is first decoded to from its WSGI representation to Unicode;\n    it is decoded differently depending on platform:\n\n    - On Python 2, ``path`` is decoded to Unicode from bytes using the UTF-8\n      decoding directly; a :exc:`pyramid.exc.URLDecodeError` is raised if a the\n      URL cannot be decoded.\n\n    - On Python 3, as per the PEP 3333 spec, ``path`` is first encoded to\n      bytes using the Latin-1 encoding; the resulting set of bytes is\n      subsequently decoded to text using the UTF-8 encoding; a\n      :exc:`pyramid.exc.URLDecodeError` is raised if a the URL cannot be\n      decoded.\n\n    The ``path`` is split on slashes, creating a list of segments.  If a\n    segment name is empty or if it is ``.``, it is ignored.  If a segment\n    name is ``..``, the previous segment is deleted, and the ``..`` is\n    ignored.\n\n    Examples:\n\n    ``/``\n\n        ()\n\n    ``/foo/bar/baz``\n\n        (u'foo', u'bar', u'baz')\n\n    ``foo/bar/baz``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo/bar/baz/``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo//bar//baz/``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo/bar/baz/..``\n\n        (u'foo', u'bar')\n\n    ``/my%20archives/hello``\n\n        (u'my archives', u'hello')\n\n    ``/archives/La%20Pe%C3%B1a``\n\n        (u'archives', u'<unprintable unicode>')\n\n    .. note::\n\n      This function does not generate the same type of tuples that\n      :func:`pyramid.traversal.resource_path_tuple` does.  In particular, the\n      leading empty string is not present in the tuple it returns, unlike tuples\n      returned by :func:`pyramid.traversal.resource_path_tuple`.  As a result,\n      tuples generated by ``traversal_path`` are not resolveable by the\n      :func:`pyramid.traversal.find_resource` API.  ``traversal_path`` is a\n      function mostly used by the internals of :app:`Pyramid` and by people\n      writing their own traversal machinery, as opposed to users writing\n      applications in :app:`Pyramid`.\n    \"\"\"\n    try:\n        path = decode_path_info(path) # result will be Unicode\n    except UnicodeDecodeError as e:\n        raise URLDecodeError(e.encoding, e.object, e.start, e.end, e.reason)\n    return split_path_info(path) # result will be tuple of Unicode\n\n@lru_cache(1000)\ndef split_path_info(path):\n    # suitable for splitting an already-unquoted-already-decoded (unicode)\n    # path value\n    path = path.strip('/')\n    clean = []\n    for segment in path.split('/'):\n        if not segment or segment == '.':\n            continue\n        elif segment == '..':\n            if clean:\n                del clean[-1]\n        else:\n            clean.append(segment)\n    return tuple(clean)\n\n_segment_cache = {}\n\nquote_path_segment_doc = \"\"\" \\\nReturn a quoted representation of a 'path segment' (such as\nthe string ``__name__`` attribute of a resource) as a string.  If the\n``segment`` passed in is a unicode object, it is converted to a\nUTF-8 string, then it is URL-quoted using Python's\n``urllib.quote``.  If the ``segment`` passed in is a string, it is\nURL-quoted using Python's :mod:`urllib.quote`.  If the segment\npassed in is not a string or unicode object, an error will be\nraised.  The return value of ``quote_path_segment`` is always a\nstring, never Unicode.\n\nYou may pass a string of characters that need not be encoded as\nthe ``safe`` argument to this function.  This corresponds to the\n``safe`` argument to :mod:`urllib.quote`.\n\n.. note::\n\n   The return value for each segment passed to this\n   function is cached in a module-scope dictionary for\n   speed: the cached version is returned when possible\n   rather than recomputing the quoted version.  No cache\n   emptying is ever done for the lifetime of an\n   application, however.  If you pass arbitrary\n   user-supplied strings to this function (as opposed to\n   some bounded set of values from a 'working set' known to\n   your application), it may become a memory leak.\n\"\"\"\n\n\nif PY3: # pragma: no cover\n    # special-case on Python 2 for speed?  unchecked\n    def quote_path_segment(segment, safe=''):\n        \"\"\" %s \"\"\" % quote_path_segment_doc\n        # The bit of this code that deals with ``_segment_cache`` is an\n        # optimization: we cache all the computation of URL path segments\n        # in this module-scope dictionary with the original string (or\n        # unicode value) as the key, so we can look it up later without\n        # needing to reencode or re-url-quote it\n        try:\n            return _segment_cache[(segment, safe)]\n        except KeyError:\n            if segment.__class__ not in (text_type, binary_type):\n                segment = str(segment)\n            result = url_quote(native_(segment, 'utf-8'), safe)\n            # we don't need a lock to mutate _segment_cache, as the below\n            # will generate exactly one Python bytecode (STORE_SUBSCR)\n            _segment_cache[(segment, safe)] = result\n            return result\nelse:\n    def quote_path_segment(segment, safe=''):\n        \"\"\" %s \"\"\" % quote_path_segment_doc\n        # The bit of this code that deals with ``_segment_cache`` is an\n        # optimization: we cache all the computation of URL path segments\n        # in this module-scope dictionary with the original string (or\n        # unicode value) as the key, so we can look it up later without\n        # needing to reencode or re-url-quote it\n        try:\n            return _segment_cache[(segment, safe)]\n        except KeyError:\n            if segment.__class__ is text_type: #isinstance slighly slower (~15%)\n                result = url_quote(segment.encode('utf-8'), safe)\n            else:\n                result = url_quote(str(segment), safe)\n            # we don't need a lock to mutate _segment_cache, as the below\n            # will generate exactly one Python bytecode (STORE_SUBSCR)\n            _segment_cache[(segment, safe)] = result\n            return result\n    \nslash = text_('/')\n\n@implementer(ITraverser)\nclass ResourceTreeTraverser(object):\n    \"\"\" A resource tree traverser that should be used (for speed) when\n    every resource in the tree supplies a ``__name__`` and\n    ``__parent__`` attribute (ie. every resource in the tree is\n    :term:`location` aware) .\"\"\"\n\n\n    VIEW_SELECTOR = '@@'\n\n    def __init__(self, root):\n        self.root = root\n\n    def __call__(self, request):\n        environ = request.environ\n        matchdict = request.matchdict\n\n        if matchdict is not None:\n\n            path = matchdict.get('traverse', slash) or slash\n            if is_nonstr_iter(path):\n                # this is a *traverse stararg (not a {traverse})\n                # routing has already decoded these elements, so we just\n                # need to join them\n                path = '/' + slash.join(path) or slash\n\n            subpath = matchdict.get('subpath', ())\n            if not is_nonstr_iter(subpath):\n                # this is not a *subpath stararg (just a {subpath})\n                # routing has already decoded this string, so we just need\n                # to split it\n                subpath = split_path_info(subpath)\n\n        else:\n            # this request did not match a route\n            subpath = ()\n            try:\n                # empty if mounted under a path in mod_wsgi, for example\n                path = request.path_info or slash\n            except KeyError:\n                # if environ['PATH_INFO'] is just not there\n                path = slash\n            except UnicodeDecodeError as e:\n                raise URLDecodeError(e.encoding, e.object, e.start, e.end,\n                                     e.reason)\n\n        if VH_ROOT_KEY in environ:\n            # HTTP_X_VHM_ROOT\n            vroot_path = decode_path_info(environ[VH_ROOT_KEY]) \n            vroot_tuple = split_path_info(vroot_path)\n            vpath = vroot_path + path # both will (must) be unicode or asciistr\n            vroot_idx = len(vroot_tuple) -1\n        else:\n            vroot_tuple = ()\n            vpath = path\n            vroot_idx = -1\n\n        root = self.root\n        ob = vroot = root\n\n        if vpath == slash: # invariant: vpath must not be empty\n            # prevent a call to traversal_path if we know it's going\n            # to return the empty tuple\n            vpath_tuple = ()\n        else:\n            # we do dead reckoning here via tuple slicing instead of\n            # pushing and popping temporary lists for speed purposes\n            # and this hurts readability; apologies\n            i = 0\n            view_selector = self.VIEW_SELECTOR\n            vpath_tuple = split_path_info(vpath)\n            for segment in vpath_tuple:\n                if segment[:2] == view_selector:\n                    return {'context':ob,\n                            'view_name':segment[2:],\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n                try:\n                    getitem = ob.__getitem__\n                except AttributeError:\n                    return {'context':ob,\n                            'view_name':segment,\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n\n                try:\n                    next = getitem(segment)\n                except KeyError:\n                    return {'context':ob,\n                            'view_name':segment,\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n                if i == vroot_idx:\n                    vroot = next\n                ob = next\n                i += 1\n\n        return {'context':ob, 'view_name':empty, 'subpath':subpath,\n                'traversed':vpath_tuple, 'virtual_root':vroot,\n                'virtual_root_path':vroot_tuple, 'root':root}\n\nModelGraphTraverser = ResourceTreeTraverser # b/w compat, not API, used in wild\n\n@implementer(IResourceURL, IContextURL)\nclass ResourceURL(object):\n    vroot_varname = VH_ROOT_KEY\n\n    def __init__(self, resource, request):\n        physical_path_tuple = resource_path_tuple(resource)\n        physical_path = _join_path_tuple(physical_path_tuple)\n\n        if physical_path_tuple != ('',):\n            physical_path_tuple = physical_path_tuple + ('',)\n            physical_path = physical_path + '/'\n\n        virtual_path = physical_path\n        virtual_path_tuple = physical_path_tuple\n\n        environ = request.environ\n        vroot_path = environ.get(self.vroot_varname)\n\n        # if the physical path starts with the virtual root path, trim it out\n        # of the virtual path\n        if vroot_path is not None:\n            vroot_path = vroot_path.rstrip('/')\n            if vroot_path and physical_path.startswith(vroot_path):\n                vroot_path_tuple = tuple(vroot_path.split('/'))\n                numels = len(vroot_path_tuple)\n                virtual_path_tuple = ('',) + physical_path_tuple[numels:]\n                virtual_path = physical_path[len(vroot_path):]\n\n        self.virtual_path = virtual_path    # IResourceURL attr\n        self.physical_path = physical_path  # IResourceURL attr\n        self.virtual_path_tuple = virtual_path_tuple # IResourceURL attr (1.5)\n        self.physical_path_tuple = physical_path_tuple # IResourceURL attr (1.5)\n\n        # bw compat for IContextURL methods\n        self.resource = resource\n        self.context = resource\n        self.request = request\n\n    # IContextURL method (deprecated in 1.3)\n    def virtual_root(self):\n        environ = self.request.environ\n        vroot_varname = self.vroot_varname\n        if vroot_varname in environ:\n            return find_resource(self.context, environ[vroot_varname])\n        # shortcut instead of using find_root; we probably already\n        # have it on the request\n        try:\n            return self.request.root\n        except AttributeError:\n            return find_root(self.context)\n\n    # IContextURL method (deprecated in 1.3)\n    def __call__(self):\n        \"\"\" Generate a URL based on the :term:`lineage` of a :term:`resource`\n        object that is ``self.context``.  If any resource in the context\n        lineage has a Unicode name, it will be converted to a UTF-8 string\n        before being attached to the URL.  If a ``HTTP_X_VHM_ROOT`` key is\n        present in the WSGI environment, its value will be treated as a\n        'virtual root path': the path of the URL generated by this will be\n        left-stripped of this virtual root path value.\n        \"\"\"\n        local_url = getattr(self.context, '__resource_url__', None)\n        if local_url is not None:\n            result = local_url(\n                self.request,\n                {'virtual_path':self.virtual_path,\n                 'physical_path':self.physical_path},\n                )\n            if result is not None:\n                # allow it to punt by returning ``None``\n                return result\n\n        app_url = self.request.application_url # never ends in a slash\n        return app_url + self.virtual_path\n\nTraversalContextURL = ResourceURL # deprecated as of 1.3\n\ndeprecated(\n    'TraversalContextURL',\n    'As of Pyramid 1.3 the, \"pyramid.traversal.TraversalContextURL\" class is '\n    'scheduled to be removed.   Use the '\n    '\"pyramid.config.Configurator.add_resource_url_adapter\" method to register '\n    'a class that implements \"pyramid.interfaces.IResourceURL\" instead. '\n    'See the \"What\\'s new In Pyramid 1.3\" document for a further description.'\n    )\n\n@lru_cache(1000)\ndef _join_path_tuple(tuple):\n    return tuple and '/'.join([quote_path_segment(x) for x in tuple]) or '/'\n\nclass DefaultRootFactory:\n    __parent__ = None\n    __name__ = None\n    def __init__(self, request):\n        pass\n",
            "header": {
                "file": {
                    "path": "pyramid/traversal.py"
                },
                "misc_line": null
            },
            "index_line": {
                "old_commit_hash": "341ed2d75",
                "new_commit_hash": "4c275c4c1",
                "mode": "100644"
            },
            "is_binary_file": false,
            "binary_line": null,
            "minus_file": {
                "path": "a/pyramid/traversal.py"
            },
            "plus_file": {
                "path": "b/pyramid/traversal.py"
            },
            "hunks": [
                {
                    "descriptor": {
                        "old_range": {
                            "start": 822,
                            "length": 9
                        },
                        "new_range": {
                            "start": 822,
                            "length": 4
                        },
                        "section": "class DefaultRootFactory:"
                    },
                    "line_group": {
                        "all_lines": [
                            {
                                "content": "    __parent__ = None",
                                "type": "context"
                            },
                            {
                                "content": "    __name__ = None",
                                "type": "context"
                            },
                            {
                                "content": "    def __init__(self, request):",
                                "type": "context"
                            },
                            {
                                "content": "        matchdict = request.matchdict",
                                "type": "deleted"
                            },
                            {
                                "content": "        # provide backwards compatibility for applications which",
                                "type": "deleted"
                            },
                            {
                                "content": "        # used routes (at least apps without any custom \"context",
                                "type": "deleted"
                            },
                            {
                                "content": "        # factory\") in BFG 0.9.X and before",
                                "type": "deleted"
                            },
                            {
                                "content": "        if matchdict is not None:",
                                "type": "deleted"
                            },
                            {
                                "content": "            self.__dict__.update(matchdict)",
                                "type": "deleted"
                            },
                            {
                                "content": "        pass",
                                "type": "added"
                            },
                            {
                                "content": "",
                                "type": "context"
                            }
                        ]
                    },
                    "modified_entities": [
                        {
                            "file_name": "pyramid/traversal.py",
                            "type": "class",
                            "name": "DefaultRootFactory",
                            "content": "class DefaultRootFactory:\n    __parent__ = None\n    __name__ = None\n    def __init__(self, request):\n        matchdict = request.matchdict\n        # provide backwards compatibility for applications which\n        # used routes (at least apps without any custom \"context\n        # factory\") in BFG 0.9.X and before\n        if matchdict is not None:\n            self.__dict__.update(matchdict)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 821,
                            "end_lineno": 830,
                            "parent": null
                        },
                        {
                            "file_name": "pyramid/traversal.py",
                            "type": "method",
                            "name": "DefaultRootFactory.__init__",
                            "content": "class DefaultRootFactory:\n    __parent__ = None\n    __name__ = None\n    def __init__(self, request):\n        matchdict = request.matchdict\n        # provide backwards compatibility for applications which\n        # used routes (at least apps without any custom \"context\n        # factory\") in BFG 0.9.X and before\n        if matchdict is not None:\n            self.__dict__.update(matchdict)",
                            "ast_type_str": "ClassDef",
                            "start_lineno": 824,
                            "end_lineno": 830,
                            "parent": {
                                "file_name": "pyramid/traversal.py",
                                "type": "class",
                                "name": "DefaultRootFactory",
                                "content": "class DefaultRootFactory:\n    __parent__ = None\n    __name__ = None\n    def __init__(self, request):\n        matchdict = request.matchdict\n        # provide backwards compatibility for applications which\n        # used routes (at least apps without any custom \"context\n        # factory\") in BFG 0.9.X and before\n        if matchdict is not None:\n            self.__dict__.update(matchdict)",
                                "ast_type_str": "ClassDef",
                                "start_lineno": 821,
                                "end_lineno": 830,
                                "parent": null
                            }
                        }
                    ],
                    "added_entities": [],
                    "deleted_entities": []
                }
            ]
        }
    ],
    "old_commit_hash": "95e97113b3fe108a1dbf908ae6716b89e786c91d^",
    "new_commit_hash": "95e97113b3fe108a1dbf908ae6716b89e786c91d",
    "commit_message": "- Removed ancient backwards compatibily hack in\n  ``pyramid.traversal.DefaultRootFactory`` which populated the ``__dict__`` of\n  the factory with the matchdict values for compatibility with BFG 0.9.",
    "commit_date": "2013-09-08T22:34:08-04:00",
    "metadata": {}
}
{
    "repo_name": "pyramid",
    "new_commit_hash": "95e97113b3fe108a1dbf908ae6716b89e786c91d",
    "test_file_codes": [
        "import unittest\nimport warnings\n\nfrom pyramid.testing import cleanUp\n\nfrom pyramid.compat import (\n    text_,\n    native_,\n    text_type,\n    url_quote,\n    PY3,\n    )\n\nwith warnings.catch_warnings(record=True) as w:\n    warnings.filterwarnings('always')\n    from pyramid.interfaces import IContextURL\n    assert(len(w) == 1)\n\nclass TraversalPathTests(unittest.TestCase):\n    def _callFUT(self, path):\n        from pyramid.traversal import traversal_path\n        return traversal_path(path)\n\n    def test_utf8(self):\n        la = b'La Pe\\xc3\\xb1a'\n        encoded = url_quote(la)\n        decoded = text_(la, 'utf-8')\n        path = '/'.join([encoded, encoded])\n        result = self._callFUT(path)\n        self.assertEqual(result, (decoded, decoded))\n\n    def test_utf16(self):\n        from pyramid.exceptions import URLDecodeError\n        la = text_(b'La Pe\\xc3\\xb1a', 'utf-8').encode('utf-16')\n        encoded = url_quote(la)\n        path = '/'.join([encoded, encoded])\n        self.assertRaises(URLDecodeError, self._callFUT, path)\n\n    def test_unicode_highorder_chars(self):\n        path = text_('/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF')\n        self.assertEqual(self._callFUT(path),\n                         (text_('\\u6d41\\u884c\\u8d8b\\u52bf', 'unicode_escape'),))\n\n    def test_element_urllquoted(self):\n        self.assertEqual(self._callFUT('/foo/space%20thing/bar'),\n                         (text_('foo'), text_('space thing'), text_('bar')))\n\n    def test_unicode_undecodeable_to_ascii(self):\n        path = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        self.assertRaises(UnicodeEncodeError, self._callFUT, path)\n\nclass TraversalPathInfoTests(unittest.TestCase):\n    def _callFUT(self, path):\n        from pyramid.traversal import traversal_path_info\n        return traversal_path_info(path)\n\n    def test_path_startswith_endswith(self):\n        self.assertEqual(self._callFUT('/foo/'), (text_('foo'),))\n\n    def test_empty_elements(self):\n        self.assertEqual(self._callFUT('foo///'), (text_('foo'),))\n\n    def test_onedot(self):\n        self.assertEqual(self._callFUT('foo/./bar'),\n                         (text_('foo'), text_('bar')))\n\n    def test_twodots(self):\n        self.assertEqual(self._callFUT('foo/../bar'), (text_('bar'),))\n\n    def test_twodots_at_start(self):\n        self.assertEqual(self._callFUT('../../bar'), (text_('bar'),))\n\n    def test_segments_are_unicode(self):\n        result = self._callFUT('/foo/bar')\n        self.assertEqual(type(result[0]), text_type)\n        self.assertEqual(type(result[1]), text_type)\n\n    def test_same_value_returned_if_cached(self):\n        result1 = self._callFUT('/foo/bar')\n        result2 = self._callFUT('/foo/bar')\n        self.assertEqual(result1, (text_('foo'), text_('bar')))\n        self.assertEqual(result2, (text_('foo'), text_('bar')))\n\n    def test_unicode_simple(self):\n        path = text_('/abc')\n        self.assertEqual(self._callFUT(path), (text_('abc'),))\n\n    def test_highorder(self):\n        la = b'La Pe\\xc3\\xb1a'\n        latin1 = native_(la)\n        result = self._callFUT(latin1)\n        self.assertEqual(result, (text_(la, 'utf-8'),))\n\n    def test_highorder_undecodeable(self):\n        from pyramid.exceptions import URLDecodeError\n        la = text_(b'La Pe\\xc3\\xb1a', 'utf-8')\n        notlatin1 = native_(la)\n        self.assertRaises(URLDecodeError, self._callFUT, notlatin1)\n\nclass ResourceTreeTraverserTests(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _getTargetClass(self):\n        from pyramid.traversal import ResourceTreeTraverser\n        return ResourceTreeTraverser\n\n    def _makeOne(self, *arg, **kw):\n        klass = self._getTargetClass()\n        return klass(*arg, **kw)\n\n    def _getEnviron(self, **kw):\n        environ = {}\n        environ.update(kw)\n        return environ\n\n    def test_class_conforms_to_ITraverser(self):\n        from zope.interface.verify import verifyClass\n        from pyramid.interfaces import ITraverser\n        verifyClass(ITraverser, self._getTargetClass())\n\n    def test_instance_conforms_to_ITraverser(self):\n        from zope.interface.verify import verifyObject\n        from pyramid.interfaces import ITraverser\n        context = DummyContext()\n        verifyObject(ITraverser, self._makeOne(context))\n\n    def test_call_with_empty_pathinfo(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info='')\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_pathinfo_KeyError(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, toraise=KeyError)\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_pathinfo_highorder(self):\n        path = text_(b'/Qu\\xc3\\xa9bec', 'utf-8')\n        foo = DummyContext(None, path)\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=path)\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], (path[1:],))\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_pathel_with_no_getitem(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_emptypath_nosubpath(self):\n        root = DummyContext()\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_(''))\n        result = policy(request)\n        self.assertEqual(result['context'], root)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_withpath_nosubpath(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], 'bar')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], (text_('foo'),))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_withconn_getitem_withpath_withsubpath(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/foo/bar/baz/buz'))\n        result = policy(request)\n        self.assertEqual(result['context'], foo)\n        self.assertEqual(result['view_name'], 'bar')\n        self.assertEqual(result['subpath'], ('baz', 'buz'))\n        self.assertEqual(result['traversed'], (text_('foo'),))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_explicit_viewname(self):\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        request = DummyRequest(environ, path_info=text_('/@@foo'))\n        result = policy(request)\n        self.assertEqual(result['context'], root)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo/bar')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], bar)\n        self.assertEqual(result['virtual_root_path'],\n                         (text_('foo'), text_('bar')))\n\n    def test_call_with_vh_root2(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/bar/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], foo)\n        self.assertEqual(result['virtual_root_path'], (text_('foo'),))\n\n    def test_call_with_vh_root3(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/')\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/foo/bar/baz'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root4(self):\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/foo/bar/baz')\n        baz = DummyContext(None, 'baz')\n        bar = DummyContext(baz, 'bar')\n        foo = DummyContext(bar, 'foo')\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        request = DummyRequest(environ, path_info=text_('/'))\n        result = policy(request)\n        self.assertEqual(result['context'], baz)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n        self.assertEqual(result['root'], root)\n        self.assertEqual(result['virtual_root'], baz)\n        self.assertEqual(result['virtual_root_path'],\n                         (text_('foo'), text_('bar'), text_('baz')))\n\n    def test_call_with_vh_root_path_root(self):\n        policy = self._makeOne(None)\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/')\n        request = DummyRequest(environ, path_info=text_('/'))\n        result = policy(request)\n        self.assertEqual(result['context'], None)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], policy.root)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_call_with_vh_root_highorder(self):\n        path = text_(b'Qu\\xc3\\xa9bec', 'utf-8')\n        bar = DummyContext(None, 'bar')\n        foo = DummyContext(bar, path)\n        root = DummyContext(foo, 'root')\n        policy = self._makeOne(root)\n        if PY3: # pragma: no cover\n            vhm_root = b'/Qu\\xc3\\xa9bec'.decode('latin-1')\n        else:\n            vhm_root = b'/Qu\\xc3\\xa9bec'\n        environ = self._getEnviron(HTTP_X_VHM_ROOT=vhm_root)\n        request = DummyRequest(environ, path_info=text_('/bar'))\n        result = policy(request)\n        self.assertEqual(result['context'], bar)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(\n            result['traversed'],\n            (path, text_('bar'))\n            )\n        self.assertEqual(result['root'], policy.root)\n        self.assertEqual(result['virtual_root'], foo)\n        self.assertEqual(\n            result['virtual_root_path'],\n            (path,)\n            )\n\n    def test_path_info_raises_unicodedecodeerror(self):\n        from pyramid.exceptions import URLDecodeError\n        foo = DummyContext()\n        root = DummyContext(foo)\n        policy = self._makeOne(root)\n        environ = self._getEnviron()\n        toraise = UnicodeDecodeError('ascii', b'a', 2, 3, '5')\n        request = DummyRequest(environ, toraise=toraise)\n        request.matchdict = None\n        self.assertRaises(URLDecodeError, policy, request)\n\n    def test_withroute_nothingfancy(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        request = DummyRequest({})\n        request.matchdict = {}\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_with_subpath_string(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'subpath':'/a/b/c'}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ('a', 'b','c'))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_with_subpath_tuple(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'subpath':('a', 'b', 'c')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ('a', 'b','c'))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_string(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict =  {'traverse':text_('foo/bar')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_tuple(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'traverse':('foo', 'bar')}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_empty(self):\n        resource = DummyContext()\n        traverser = self._makeOne(resource)\n        matchdict = {'traverse':''}\n        request = DummyRequest({})\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], resource)\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['subpath'], ())\n        self.assertEqual(result['traversed'], ())\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], resource)\n        self.assertEqual(result['virtual_root_path'], ())\n\n    def test_withroute_and_traverse_and_vroot(self):\n        abc = DummyContext()\n        resource = DummyContext(next=abc)\n        environ = self._getEnviron(HTTP_X_VHM_ROOT='/abc')\n        request = DummyRequest(environ)\n        traverser = self._makeOne(resource)\n        matchdict =  {'traverse':text_('/foo/bar')}\n        request.matchdict = matchdict\n        result = traverser(request)\n        self.assertEqual(result['context'], abc)\n        self.assertEqual(result['view_name'], 'foo')\n        self.assertEqual(result['subpath'], ('bar',))\n        self.assertEqual(result['traversed'], ('abc', 'foo'))\n        self.assertEqual(result['root'], resource)\n        self.assertEqual(result['virtual_root'], abc)\n        self.assertEqual(result['virtual_root_path'], ('abc',))\n        \nclass FindInterfaceTests(unittest.TestCase):\n    def _callFUT(self, context, iface):\n        from pyramid.traversal import find_interface\n        return find_interface(context, iface)\n\n    def test_it_interface(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = 'root'\n        foo.__parent__ = root\n        foo.__name__ = 'foo'\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        from zope.interface import directlyProvides\n        from zope.interface import Interface\n        class IFoo(Interface):\n            pass\n        directlyProvides(root, IFoo)\n        result = self._callFUT(baz, IFoo)\n        self.assertEqual(result.__name__, 'root')\n\n    def test_it_class(self):\n        class DummyRoot(object):\n            def __init__(self, child):\n                self.child = child\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyRoot(foo)\n        root.__parent__ = None\n        root.__name__ = 'root'\n        foo.__parent__ = root\n        foo.__name__ = 'foo'\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, DummyRoot)\n        self.assertEqual(result.__name__, 'root')\n\nclass FindRootTests(unittest.TestCase):\n    def _callFUT(self, context):\n        from pyramid.traversal import find_root\n        return find_root(context)\n\n    def test_it(self):\n        dummy = DummyContext()\n        baz = DummyContext()\n        baz.__parent__ = dummy\n        baz.__name__ = 'baz'\n        dummy.__parent__ = None\n        dummy.__name__ = None\n        result = self._callFUT(baz)\n        self.assertEqual(result, dummy)\n\nclass FindResourceTests(unittest.TestCase):\n    def _callFUT(self, context, name):\n        from pyramid.traversal import find_resource\n        return find_resource(context, name)\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_list(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, [''])\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_generator(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        def foo():\n            yield ''\n        result = self._callFUT(resource, foo())\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_self_string_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, '')\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_tuple_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ())\n        self.assertEqual(result, resource)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_relative_string_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, 'baz')\n        self.assertEqual(result, baz)\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ('baz',))\n        self.assertEqual(result, baz)\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_string_notfound(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':'bar'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, 'baz')\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_notfound(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':'bar'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, ('baz',))\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_absolute_string_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, '/')\n        self.assertEqual(result, root)\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        result = self._callFUT(resource, ('',))\n        self.assertEqual(result, root)\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_string_notfound(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':'fuz'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, '/')\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_notfound(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':'fuz'})\n        self._registerTraverser(traverser)\n        self.assertRaises(KeyError, self._callFUT, resource, ('',))\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_unicode_found(self):\n        # test for bug wiggy found in wild, traceback stack:\n        # root = u'/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF'\n        # wiggy's code: section=find_resource(page, root)\n        # find_resource L76: D = traverse(resource, path)\n        # traverse L291: return traverser(request)\n        # __call__ line 568: vpath_tuple = traversal_path(vpath)\n        # lru_cached line 91: f(*arg)\n        # traversal_path line 443: path.encode('ascii')\n        # UnicodeEncodeError: 'ascii' codec can't encode characters in\n        #     position 1-12: ordinal not in range(128)\n        #\n        # solution: encode string to ascii in pyramid.traversal.traverse\n        # before passing it along to webob as path_info\n        from pyramid.traversal import ResourceTreeTraverser\n        unprintable = DummyContext()\n        root = DummyContext(unprintable)\n        unprintable.__parent__ = root\n        unprintable.__name__ = text_(\n            b'/\\xe6\\xb5\\x81\\xe8\\xa1\\x8c\\xe8\\xb6\\x8b\\xe5\\x8a\\xbf', 'utf-8')\n        root.__parent__ = None\n        root.__name__ = None\n        traverser = ResourceTreeTraverser\n        self._registerTraverser(traverser)\n        result = self._callFUT(\n            root,\n            text_(b'/%E6%B5%81%E8%A1%8C%E8%B6%8B%E5%8A%BF')\n            )\n        self.assertEqual(result, unprintable)\n\nclass ResourcePathTests(unittest.TestCase):\n    def _callFUT(self, resource, *elements):\n        from pyramid.traversal import resource_path\n        return resource_path(resource, *elements)\n\n    def test_it(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, 'this/theotherthing', 'that')\n        self.assertEqual(result, '/foo%20/bar/baz/this%2Ftheotherthing/that')\n\n    def test_root_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        result = self._callFUT(root)\n        self.assertEqual(result, '/')\n\n    def test_root_default_emptystring(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = ''\n        result = self._callFUT(root)\n        self.assertEqual(result, '/')\n\n    def test_root_object_nonnull_name_direct(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = 'flubadub'\n        result = self._callFUT(root)\n        self.assertEqual(result, 'flubadub') # insane case\n\n    def test_root_object_nonnull_name_indirect(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = 'flubadub'\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'barker'\n        result = self._callFUT(other)\n        self.assertEqual(result, 'flubadub/barker') # insane case\n\n    def test_nonroot_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, '/other')\n\n    def test_path_with_None_itermediate_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = None\n        other2 = DummyContext()\n        other2.__parent__ = other\n        other2.__name__ = 'other2'\n        result = self._callFUT(other2)\n        self.assertEqual(result, '//other2')\n\nclass ResourcePathTupleTests(unittest.TestCase):\n    def _callFUT(self, resource, *elements):\n        from pyramid.traversal import resource_path_tuple\n        return resource_path_tuple(resource, *elements)\n\n    def test_it(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        result = self._callFUT(baz, 'this/theotherthing', 'that')\n        self.assertEqual(result, ('','foo ', 'bar', 'baz', 'this/theotherthing',\n                                  'that'))\n\n    def test_root_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        result = self._callFUT(root)\n        self.assertEqual(result, ('',))\n\n    def test_root_default_emptystring_name(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = ''\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, ('', 'other',))\n\n    def test_nonroot_default(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = 'other'\n        result = self._callFUT(other)\n        self.assertEqual(result, ('', 'other'))\n\n    def test_path_with_None_itermediate_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        other = DummyContext()\n        other.__parent__ = root\n        other.__name__ = None\n        other2 = DummyContext()\n        other2.__parent__ = other\n        other2.__name__ = 'other2'\n        result = self._callFUT(other2)\n        self.assertEqual(result, ('', '', 'other2'))\n\nclass QuotePathSegmentTests(unittest.TestCase):\n    def _callFUT(self, s):\n        from pyramid.traversal import quote_path_segment\n        return quote_path_segment(s)\n\n    def test_unicode(self):\n        la = text_(b'/La Pe\\xc3\\xb1a', 'utf-8')\n        result = self._callFUT(la)\n        self.assertEqual(result, '%2FLa%20Pe%C3%B1a')\n\n    def test_string(self):\n        s = '/ hello!'\n        result = self._callFUT(s)\n        self.assertEqual(result, '%2F%20hello%21')\n\n    def test_int(self):\n        s = 12345\n        result = self._callFUT(s)\n        self.assertEqual(result, '12345')\n        \n    def test_long(self):\n        from pyramid.compat import long\n        import sys\n        s = long(sys.maxsize + 1)\n        result = self._callFUT(s)\n        expected = str(s)\n        self.assertEqual(result, expected)\n\n    def test_other(self):\n        class Foo(object):\n            def __str__(self):\n                return 'abc'\n        s = Foo()\n        result = self._callFUT(s)\n        self.assertEqual(result, 'abc')\n\nclass ResourceURLTests(unittest.TestCase):\n    def _makeOne(self, context, url):\n        return self._getTargetClass()(context, url)\n\n    def _getTargetClass(self):\n        from pyramid.traversal import ResourceURL\n        return ResourceURL\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_class_conforms_to_IContextURL(self):\n        # bw compat\n        from zope.interface.verify import verifyClass\n        verifyClass(IContextURL, self._getTargetClass())\n\n    def test_instance_conforms_to_IContextURL(self):\n        from zope.interface.verify import verifyObject\n        context = DummyContext()\n        request = DummyRequest()\n        verifyObject(IContextURL, self._makeOne(context, request))\n\n    def test_instance_conforms_to_IResourceURL(self):\n        from pyramid.interfaces import IResourceURL\n        from zope.interface.verify import verifyObject\n        context = DummyContext()\n        request = DummyRequest()\n        verifyObject(IResourceURL, self._makeOne(context, request))\n        \n    def test_call_withlineage(self):\n        baz = DummyContext()\n        bar = DummyContext(baz)\n        foo = DummyContext(bar)\n        root = DummyContext(foo)\n        root.__parent__ = None\n        root.__name__ = None\n        foo.__parent__ = root\n        foo.__name__ = 'foo '\n        bar.__parent__ = foo\n        bar.__name__ = 'bar'\n        baz.__parent__ = bar\n        baz.__name__ = 'baz'\n        request = DummyRequest()\n        context_url = self._makeOne(baz, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/foo%20/bar/baz/')\n\n    def test_call_nolineage(self):\n        context = DummyContext()\n        context.__name__ = ''\n        context.__parent__ = None\n        request = DummyRequest()\n        context_url = self._makeOne(context, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n\n    def test_call_unicode_mixed_with_bytes_in_resource_names(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = text_(b'La Pe\\xc3\\xb1a', 'utf-8')\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = b'La Pe\\xc3\\xb1a'\n        request = DummyRequest()\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(\n            result,\n            'http://example.com:5432/La%20Pe%C3%B1a/La%20Pe%C3%B1a/')\n\n    def test_call_with_virtual_root_path(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        request = DummyRequest({VH_ROOT_KEY:'/one'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/two/')\n\n        request = DummyRequest({VH_ROOT_KEY:'/one/two'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n\n    def test_call_with_virtual_root_path_physical_not_startwith_vroot(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        request = DummyRequest({VH_ROOT_KEY:'/wrong'})\n        context_url = self._makeOne(two, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/one/two/')\n\n    def test_call_empty_names_not_ignored(self):\n        bar = DummyContext()\n        empty = DummyContext(bar)\n        root = DummyContext(empty)\n        root.__parent__ = None\n        root.__name__ = None\n        empty.__parent__ = root\n        empty.__name__ = ''\n        bar.__parent__ = empty\n        bar.__name__ = 'bar'\n        request = DummyRequest()\n        context_url = self._makeOne(bar, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432//bar/')\n\n    def test_call_local_url_returns_None(self):\n        resource = DummyContext()\n        def resource_url(request, info):\n            self.assertEqual(info['virtual_path'], '/')\n            self.assertEqual(info['physical_path'], '/')\n            return None\n        resource.__resource_url__ = resource_url\n        request = DummyRequest()\n        context_url = self._makeOne(resource, request)\n        result = context_url()\n        self.assertEqual(result, 'http://example.com:5432/')\n        \n    def test_call_local_url_returns_url(self):\n        resource = DummyContext()\n        def resource_url(request, info):\n            self.assertEqual(info['virtual_path'], '/')\n            self.assertEqual(info['physical_path'], '/')\n            return 'abc'\n        resource.__resource_url__ = resource_url\n        request = DummyRequest()\n        context_url = self._makeOne(resource, request)\n        result = context_url()\n        self.assertEqual(result, 'abc')\n\n    def test_virtual_root_no_virtual_root_path(self):\n        root = DummyContext()\n        root.__name__ = None\n        root.__parent__ = None\n        one = DummyContext()\n        one.__name__ = 'one'\n        one.__parent__ = root\n        request = DummyRequest()\n        context_url = self._makeOne(one, request)\n        self.assertEqual(context_url.virtual_root(), root)\n\n    def test_virtual_root_no_virtual_root_path_with_root_on_request(self):\n        context = DummyContext()\n        context.__parent__ = None\n        request = DummyRequest()\n        request.root = DummyContext()\n        context_url = self._makeOne(context, request)\n        self.assertEqual(context_url.virtual_root(), request.root)\n\n    def test_virtual_root_with_virtual_root_path(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        context = DummyContext()\n        context.__parent__ = None\n        traversed_to = DummyContext()\n        environ = {VH_ROOT_KEY:'/one'}\n        request = DummyRequest(environ)\n        traverser = make_traverser({'context':traversed_to, 'view_name':''})\n        self._registerTraverser(traverser)\n        context_url = self._makeOne(context, request)\n        self.assertEqual(context_url.virtual_root(), traversed_to)\n        self.assertEqual(context.request.environ['PATH_INFO'], '/one')\n\n    def test_IResourceURL_attributes_with_vroot(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {VH_ROOT_KEY:'/one'}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'two', ''))\n        \n    def test_IResourceURL_attributes_vroot_ends_with_slash(self):\n        from pyramid.interfaces import VH_ROOT_KEY\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {VH_ROOT_KEY:'/one/'}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'two', ''))\n        \n    def test_IResourceURL_attributes_no_vroot(self):\n        root = DummyContext()\n        root.__parent__ = None\n        root.__name__ = None\n        one = DummyContext()\n        one.__parent__ = root\n        one.__name__ = 'one'\n        two = DummyContext()\n        two.__parent__ = one\n        two.__name__ = 'two'\n        environ = {}\n        request = DummyRequest(environ)\n        context_url = self._makeOne(two, request)\n        self.assertEqual(context_url.physical_path, '/one/two/')\n        self.assertEqual(context_url.virtual_path, '/one/two/')\n        self.assertEqual(context_url.physical_path_tuple, ('', 'one', 'two',''))\n        self.assertEqual(context_url.virtual_path_tuple, ('', 'one', 'two', ''))\n\nclass TestVirtualRoot(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _callFUT(self, resource, request):\n        from pyramid.traversal import virtual_root\n        return virtual_root(resource, request)\n\n    def test_registered(self):\n        from zope.interface import Interface\n        request = _makeRequest()\n        request.registry.registerAdapter(DummyContextURL, (Interface,Interface),\n                                         IContextURL)\n        context = DummyContext()\n        result = self._callFUT(context, request)\n        self.assertEqual(result, '123')\n\n    def test_default(self):\n        context = DummyContext()\n        request = _makeRequest()\n        request.environ['PATH_INFO'] = '/'\n        result = self._callFUT(context, request)\n        self.assertEqual(result, context)\n\n    def test_default_no_registry_on_request(self):\n        context = DummyContext()\n        request = _makeRequest()\n        del request.registry\n        request.environ['PATH_INFO'] = '/'\n        result = self._callFUT(context, request)\n        self.assertEqual(result, context)\n\nclass TraverseTests(unittest.TestCase):\n    def setUp(self):\n        cleanUp()\n\n    def tearDown(self):\n        cleanUp()\n\n    def _callFUT(self, context, name):\n        from pyramid.traversal import traverse\n        return traverse(context, name)\n\n    def _registerTraverser(self, traverser):\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        from pyramid.interfaces import ITraverser\n        from zope.interface import Interface\n        reg.registerAdapter(traverser, (Interface,), ITraverser)\n\n    def test_request_has_registry(self):\n        from pyramid.threadlocal import get_current_registry\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.registry, get_current_registry())\n\n    def test_list(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_generator(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        def foo():\n            yield ''\n        self._callFUT(resource, foo())\n        self.assertEqual(resource.request.environ['PATH_INFO'], '/')\n\n    def test_self_string_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, '')\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_unicode_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, text_(''))\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_self_tuple_found(self):\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ())\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_relative_string_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, 'baz')\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_relative_tuple_found(self):\n        resource = DummyContext()\n        baz = DummyContext()\n        traverser = make_traverser({'context':baz, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ('baz',))\n        self.assertEqual(resource.request.environ['PATH_INFO'], 'baz')\n\n    def test_absolute_string_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, '/')\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_absolute_tuple_found(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, ('',))\n        self.assertEqual(root.wascontext, True)\n        self.assertEqual(root.request.environ['PATH_INFO'], '/')\n\n    def test_empty_sequence(self):\n        root = DummyContext()\n        resource = DummyContext()\n        resource.__parent__ = root\n        resource.__name__ = 'baz'\n        traverser = make_traverser({'context':root, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [])\n        self.assertEqual(resource.wascontext, True)\n        self.assertEqual(resource.request.environ['PATH_INFO'], '')\n\n    def test_default_traverser(self):\n        resource = DummyContext()\n        result = self._callFUT(resource, '')\n        self.assertEqual(result['view_name'], '')\n        self.assertEqual(result['context'], resource)\n\n    def test_requestfactory_overridden(self):\n        from pyramid.interfaces import IRequestFactory\n        from pyramid.request import Request\n        from pyramid.threadlocal import get_current_registry\n        reg = get_current_registry()\n        class MyRequest(Request):\n            pass\n        reg.registerUtility(MyRequest, IRequestFactory)\n        resource = DummyContext()\n        traverser = make_traverser({'context':resource, 'view_name':''})\n        self._registerTraverser(traverser)\n        self._callFUT(resource, [''])\n        self.assertEqual(resource.request.__class__, MyRequest)\n\nclass TestDefaultRootFactory(unittest.TestCase):\n    def _getTargetClass(self):\n        from pyramid.traversal import DefaultRootFactory\n        return DefaultRootFactory\n\n    def _makeOne(self, environ):\n        return self._getTargetClass()(environ)\n\n    def test_it(self):\n        class DummyRequest(object):\n            pass\n        root = self._makeOne(DummyRequest())\n        self.assertEqual(root.__parent__, None)\n        self.assertEqual(root.__name__, None)\n\nclass Test__join_path_tuple(unittest.TestCase):\n    def _callFUT(self, tup):\n        from pyramid.traversal import _join_path_tuple\n        return _join_path_tuple(tup)\n\n    def test_empty_tuple(self):\n        # tests \"or '/'\" case\n        result = self._callFUT(())\n        self.assertEqual(result, '/')\n\n    def test_nonempty_tuple(self):\n        result = self._callFUT(('x',))\n        self.assertEqual(result, 'x')\n\ndef make_traverser(result):\n    class DummyTraverser(object):\n        def __init__(self, context):\n            self.context = context\n            context.wascontext = True\n        def __call__(self, request):\n            self.context.request = request\n            return result\n    return DummyTraverser\n\nclass DummyContext(object):\n    __parent__ = None\n    def __init__(self, next=None, name=None):\n        self.next = next\n        self.__name__ = name\n\n    def __getitem__(self, name):\n        if self.next is None:\n            raise KeyError(name)\n        return self.next\n\n    def __repr__(self):\n        return '<DummyContext with name %s at id %s>'%(self.__name__, id(self))\n\nclass DummyRequest:\n\n    application_url = 'http://example.com:5432' # app_url never ends with slash\n    matchdict = None\n    matched_route = None\n\n    def __init__(self, environ=None, path_info=text_('/'), toraise=None):\n        if environ is None:\n            environ = {}\n        self.environ = environ\n        self._set_path_info(path_info)\n        self.toraise = toraise\n\n    def _get_path_info(self):\n        if self.toraise:\n            raise self.toraise\n        return self._path_info\n\n    def _set_path_info(self, v):\n        self._path_info = v\n\n    path_info = property(_get_path_info, _set_path_info)\n        \n\nclass DummyContextURL:\n    def __init__(self, context, request):\n        pass\n\n    def virtual_root(self):\n        return '123'\n\ndef _makeRequest(environ=None):\n    from pyramid.registry import Registry\n    request = DummyRequest()\n    request.registry = Registry()\n    return request\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 614ms\nPrepared 1 package in 754ms\nInstalled 9 packages in 16ms\n + pastedeploy==3.1.0\n + pyramid==1.5a1 (from file:///home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d)\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 21 packages in 18ms\nInstalled 12 packages in 10ms\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 + nose-selecttests==0.5\n + platformdirs==4.3.6\n + six==1.17.0\n + soupsieve==2.6\n + virtualenv==20.29.0\n + waitress==3.0.0\n + webtest==3.0.1\nResolved 16 packages in 5ms\nInstalled 12 packages in 8ms\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_95e97113b3fe108a1dbf908ae6716b89e786c91d\ncollected 950 items\n\nr2e_tests/test_1.py .................................................... [  5%]\n........................................................                 [ 11%]\nr2e_tests/test_config/test_adapters.py .FF..............F...             [ 13%]\nr2e_tests/test_config/test_assets.py ...........FF...................... [ 17%]\n.....F..........................                                         [ 20%]\nr2e_tests/test_config/test_factories.py ..................               [ 22%]\nr2e_tests/test_config/test_i18n.py FFF.FF...                             [ 23%]\nr2e_tests/test_config/test_init.py ..................................... [ 27%]\nF..F....................F...........F......................FF...FFF..... [ 34%]\n...............                                                          [ 36%]\nr2e_tests/test_config/test_predicates.py ............................... [ 39%]\n........................................                                 [ 44%]\nr2e_tests/test_config/test_rendering.py ....                             [ 44%]\nr2e_tests/test_config/test_routes.py ........................            [ 46%]\nr2e_tests/test_config/test_security.py ..........                        [ 48%]\nr2e_tests/test_config/test_settings.py .......................           [ 50%]\nr2e_tests/test_config/test_testing.py ............                       [ 51%]\nr2e_tests/test_config/test_tweens.py .................................   [ 55%]\nr2e_tests/test_config/test_util.py ..................................... [ 59%]\n.............                                                            [ 60%]\nr2e_tests/test_config/test_views.py ...................F................ [ 64%]\n........................................................................ [ 71%]\nFF...................................................................... [ 79%]\nFF.........F...F....F................................................... [ 86%]\n.......F                                                                 [ 87%]\nr2e_tests/test_scripts/test_common.py ...                                [ 88%]\nr2e_tests/test_scripts/test_pcreate.py .........                         [ 89%]\nr2e_tests/test_scripts/test_pdistreport.py ..                            [ 89%]\nr2e_tests/test_scripts/test_prequest.py F.FFFFFFFFF.F.FFF.               [ 91%]\nr2e_tests/test_scripts/test_proutes.py ...........                       [ 92%]\nr2e_tests/test_scripts/test_pserve.py ............................       [ 95%]\nr2e_tests/test_scripts/test_pshell.py .................                  [ 97%]\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 0x7e8f8c5d2d60>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x7e8f8c5d2d60>)\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 0x7e8f8c5d2d60>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x7e8f8c5d2d60>), <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 0x7e8f8c0c3a90>\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 0x7e8f8c0c3a90>, <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]f908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]f908ae6716b89e786c91d/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]f908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]f908ae6716b89e786c91d/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]f908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]f908ae6716b89e786c91d/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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:507: in wrapper\n    result = wrapped(self, *arg, **kw)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <pyramid.config.Configurator object at 0x7e8f8c74c220>\nspecs = ('/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale',)\nintrospectables = []\nspec = '/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale\" is not a directory\n\npyramid/config/i18n.py:87: 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]a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'] != ['/ho[70 chars]a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale']\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]8ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale', 'abc'] != ['/ho[77 chars]8ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale', 'abc']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale',\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]c91d/pyramid/tests/pkgs/localeapp/locale', '/h[130 chars]le2'] != ['/ho[91 chars]c91d/r2e_tests/pkgs/localeapp/locale', '/home/[122 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/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]c91d/pyramid/tests/pkgs/localeapp/locale3', '/[269 chars]le2'] != ['/ho[91 chars]c91d/r2e_tests/pkgs/localeapp/locale3', '/home[257 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[69 chars]a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale3'\nE       '/hom[69 chars]a1dbf908ae6716b89e786c91d/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:1020: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:633: in commit\n    self.action_state.execute_actions(introspector=self.introspector)\npyramid/config/__init__.py:1071: 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_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/pkgs/selfscan/another.py:\nE                       def two(request):\n\npyramid/config/__init__.py:1199: 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:1029: 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:420: 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:1228: 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:1215: 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:1202: 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:1241: 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:1305: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:522: in _add_predicate\n    self.action(discriminator, register, introspectables=(intr,),\nr2e_tests/test_config/test_init.py:1302: 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]e8f8bfb5610>, 'static', 'r2e_tests.test_config:files', {})] != [(<py[39 chars]e8f8bfb5610>, 'static', 'pyramid.tests.test_config:files', {})]\nE       \nE       First differing element 0:\nE       (<pyr[37 chars]7e8f8bfb5610>, 'static', 'r2e_tests.test_config:files', {})\nE       (<pyr[37 chars]7e8f8bfb5610>, 'static', 'pyramid.tests.test_config:files', {})\nE       \nE         [(<pyramid.config.Configurator object at 0x7e8f8bfb5610>,\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:1715: 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:1042: 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:1083: 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:2266: \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:396: 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:2268: 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:2285: \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:396: 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:2287: 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:2306: \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 0x7e8f8bc76730> 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:396: 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:2309: 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:2352: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x7e8f8bd26e80>\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:396: 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:2354: 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:2376: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x7e8f8bfb8af0>\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:396: 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:2378: 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:3816: 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, arg2: 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:283: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_element_urllquoted\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_unicode_highorder_chars\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_unicode_undecodeable_to_ascii\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_utf16\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_utf8\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_empty_elements\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_highorder\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_highorder_undecodeable\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_onedot\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_path_startswith_endswith\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_same_value_returned_if_cached\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_segments_are_unicode\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_twodots\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_twodots_at_start\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_unicode_simple\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_pathel_with_no_getitem\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_empty_pathinfo\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_explicit_viewname\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_pathinfo_KeyError\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_pathinfo_highorder\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root2\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root3\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root4\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root_highorder\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root_path_root\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_withconn_getitem_emptypath_nosubpath\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_withconn_getitem_withpath_nosubpath\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_withconn_getitem_withpath_withsubpath\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_class_conforms_to_ITraverser\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_instance_conforms_to_ITraverser\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_path_info_raises_unicodedecodeerror\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_and_vroot\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_empty\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_string\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_tuple\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_nothingfancy\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_with_subpath_string\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_with_subpath_tuple\nPASSED r2e_tests/test_1.py::FindInterfaceTests::test_it_class\nPASSED r2e_tests/test_1.py::FindInterfaceTests::test_it_interface\nPASSED r2e_tests/test_1.py::FindRootTests::test_it\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_string_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_string_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_tuple_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_tuple_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_unicode_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_generator\nPASSED r2e_tests/test_1.py::FindResourceTests::test_list\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_string_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_string_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_tuple_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_tuple_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_self_string_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_self_tuple_found\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_it\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_nonroot_default\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_path_with_None_itermediate_names\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_default\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_default_emptystring\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_object_nonnull_name_direct\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_object_nonnull_name_indirect\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_it\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_nonroot_default\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_path_with_None_itermediate_names\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_root_default\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_root_default_emptystring_name\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_int\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_long\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_other\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_string\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_unicode\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_IResourceURL_attributes_no_vroot\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_IResourceURL_attributes_vroot_ends_with_slash\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_IResourceURL_attributes_with_vroot\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_empty_names_not_ignored\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_local_url_returns_None\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_local_url_returns_url\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_nolineage\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_unicode_mixed_with_bytes_in_resource_names\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_with_virtual_root_path\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_with_virtual_root_path_physical_not_startwith_vroot\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_withlineage\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_class_conforms_to_IContextURL\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_instance_conforms_to_IContextURL\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_instance_conforms_to_IResourceURL\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_virtual_root_no_virtual_root_path\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_virtual_root_no_virtual_root_path_with_root_on_request\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_virtual_root_with_virtual_root_path\nPASSED r2e_tests/test_1.py::TestVirtualRoot::test_default\nPASSED r2e_tests/test_1.py::TestVirtualRoot::test_default_no_registry_on_request\nPASSED r2e_tests/test_1.py::TestVirtualRoot::test_registered\nPASSED r2e_tests/test_1.py::TraverseTests::test_absolute_string_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_absolute_tuple_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_default_traverser\nPASSED r2e_tests/test_1.py::TraverseTests::test_empty_sequence\nPASSED r2e_tests/test_1.py::TraverseTests::test_generator\nPASSED r2e_tests/test_1.py::TraverseTests::test_list\nPASSED r2e_tests/test_1.py::TraverseTests::test_relative_string_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_relative_tuple_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_request_has_registry\nPASSED r2e_tests/test_1.py::TraverseTests::test_requestfactory_overridden\nPASSED r2e_tests/test_1.py::TraverseTests::test_self_string_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_self_tuple_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_self_unicode_found\nPASSED r2e_tests/test_1.py::TestDefaultRootFactory::test_it\nPASSED r2e_tests/test_1.py::Test__join_path_tuple::test_empty_tuple\nPASSED r2e_tests/test_1.py::Test__join_path_tuple::test_nonempty_tuple\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_multiple_request_properties\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_multiple_request_properties_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_request_property_with_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_property_with_property\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_property_with_unnamed_callable\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_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_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_renderer_globals_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_renderer_globals_factory_dottedname\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_renderer\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_renderer_dottedname_factory\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_set_renderer_globals_factory\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_set_renderer_globals_factory_dottedname\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_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_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_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_custom_predicate_bests_standard_predicate\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_custom_predicates_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_custom_predicates_nomatch\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_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_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_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_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_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_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_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======================== 44 failed, 906 passed in 5.05s ========================\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_95e97113b3fe108a1dbf908ae6716b89e786c91d\ncollected 950 items\n\nr2e_tests/test_1.py .................................................... [  5%]\n.....................................................F..                 [ 11%]\nr2e_tests/test_config/test_adapters.py .FF..............F...             [ 13%]\nr2e_tests/test_config/test_assets.py ...........FF...................... [ 17%]\n.....F..........................                                         [ 20%]\nr2e_tests/test_config/test_factories.py ..................               [ 22%]\nr2e_tests/test_config/test_i18n.py FFF.FF...                             [ 23%]\nr2e_tests/test_config/test_init.py ..................................... [ 27%]\nF..F....................F...........F......................FF...FFF..... [ 34%]\n...............                                                          [ 36%]\nr2e_tests/test_config/test_predicates.py ............................... [ 39%]\n........................................                                 [ 44%]\nr2e_tests/test_config/test_rendering.py ....                             [ 44%]\nr2e_tests/test_config/test_routes.py ........................            [ 46%]\nr2e_tests/test_config/test_security.py ..........                        [ 48%]\nr2e_tests/test_config/test_settings.py .......................           [ 50%]\nr2e_tests/test_config/test_testing.py ............                       [ 51%]\nr2e_tests/test_config/test_tweens.py .................................   [ 55%]\nr2e_tests/test_config/test_util.py ..................................... [ 59%]\n.............                                                            [ 60%]\nr2e_tests/test_config/test_views.py ...................F................ [ 64%]\n........................................................................ [ 71%]\nFF...................................................................... [ 79%]\nFF.........F...F....F................................................... [ 86%]\n.......F                                                                 [ 87%]\nr2e_tests/test_scripts/test_common.py ...                                [ 88%]\nr2e_tests/test_scripts/test_pcreate.py .........                         [ 89%]\nr2e_tests/test_scripts/test_pdistreport.py ..                            [ 89%]\nr2e_tests/test_scripts/test_prequest.py F.FFFFFFFFF.F.FFF.               [ 91%]\nr2e_tests/test_scripts/test_proutes.py ...........                       [ 92%]\nr2e_tests/test_scripts/test_pserve.py ............................       [ 95%]\nr2e_tests/test_scripts/test_pshell.py .................                  [ 97%]\nr2e_tests/test_scripts/test_ptweens.py .....                             [ 97%]\nr2e_tests/test_scripts/test_pviews.py ................F......            [100%]\n\n=================================== FAILURES ===================================\n________________________ TestDefaultRootFactory.test_it ________________________\n\nself = <r2e_tests.test_1.TestDefaultRootFactory testMethod=test_it>\n\n    def test_it(self):\n        class DummyRequest(object):\n            pass\n>       root = self._makeOne(DummyRequest())\n\nr2e_tests/test_1.py:1284: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \nr2e_tests/test_1.py:1279: in _makeOne\n    return self._getTargetClass()(environ)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <pyramid.traversal.DefaultRootFactory object at 0x7eac8a40d910>\nrequest = <r2e_tests.test_1.TestDefaultRootFactory.test_it.<locals>.DummyRequest object at 0x7eac8a40dcd0>\n\n    def __init__(self, request):\n>       matchdict = request.matchdict\nE       AttributeError: 'DummyRequest' object has no attribute 'matchdict'\n\npyramid/traversal.py:825: AttributeError\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 0x7eac8a494f10>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x7eac8a494f10>)\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 0x7eac8a494f10>, <r2e_tests.test_config.test_adapters.DummyIface object at 0x7eac8a494f10>), <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 0x7eac8a1fefd0>\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 0x7eac8a1fefd0>, <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]f908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]f908ae6716b89e786c91d/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]f908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]f908ae6716b89e786c91d/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]f908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py' != '/hom[73 chars]f908ae6716b89e786c91d/r2e_tests/test_config/test_assets.py'\nE       - /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/test_assets.py\nE       ?                                                                                                    -- ^^^^^\nE       + /home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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:507: in wrapper\n    result = wrapped(self, *arg, **kw)\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\nself = <pyramid.config.Configurator object at 0x7eac8a82bca0>\nspecs = ('/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale',)\nintrospectables = []\nspec = '/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale\" is not a directory\n\npyramid/config/i18n.py:87: 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]a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'] != ['/ho[70 chars]a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale']\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]8ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale', 'abc'] != ['/ho[77 chars]8ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale', 'abc']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/r2e_tests/pkgs/localeapp/locale'\nE       \nE       - ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale',\nE       ?                                                                                                      -- ^^^^^\nE       \nE       + ['/home/gcpuser/buckets/local_repoeval_bucket/repos/pyramid_95e97113b3fe108a1dbf908ae6716b89e786c91d/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]c91d/pyramid/tests/pkgs/localeapp/locale', '/h[130 chars]le2'] != ['/ho[91 chars]c91d/r2e_tests/pkgs/localeapp/locale', '/home/[122 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale'\nE       '/hom[68 chars]8a1dbf908ae6716b89e786c91d/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]c91d/pyramid/tests/pkgs/localeapp/locale3', '/[269 chars]le2'] != ['/ho[91 chars]c91d/r2e_tests/pkgs/localeapp/locale3', '/home[257 chars]le2']\nE       \nE       First differing element 0:\nE       '/hom[69 chars]a1dbf908ae6716b89e786c91d/pyramid/tests/pkgs/localeapp/locale3'\nE       '/hom[69 chars]a1dbf908ae6716b89e786c91d/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:1020: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:633: in commit\n    self.action_state.execute_actions(introspector=self.introspector)\npyramid/config/__init__.py:1071: 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_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/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_95e97113b3fe108a1dbf908ae6716b89e786c91d/pyramid/tests/test_config/pkgs/selfscan/another.py:\nE                       def two(request):\n\npyramid/config/__init__.py:1199: 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:1029: 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:420: 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:1228: 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:1215: 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:1202: 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:1241: 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:1305: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \npyramid/config/__init__.py:522: in _add_predicate\n    self.action(discriminator, register, introspectables=(intr,),\nr2e_tests/test_config/test_init.py:1302: 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]eac8a2b3310>, 'static', 'r2e_tests.test_config:files', {})] != [(<py[39 chars]eac8a2b3310>, 'static', 'pyramid.tests.test_config:files', {})]\nE       \nE       First differing element 0:\nE       (<pyr[37 chars]7eac8a2b3310>, 'static', 'r2e_tests.test_config:files', {})\nE       (<pyr[37 chars]7eac8a2b3310>, 'static', 'pyramid.tests.test_config:files', {})\nE       \nE         [(<pyramid.config.Configurator object at 0x7eac8a2b3310>,\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:1715: 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:1042: 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:1083: 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:2266: \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:396: 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:2268: 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:2285: \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:396: 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:2287: 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:2306: \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 0x7eac89ff5a00> 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:396: 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:2309: 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:2352: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x7eac8a2534f0>\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:396: 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:2354: 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:2376: \n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \n\ncontext = None\nrequest = <r2e_tests.test_config.test_views.DummyRequest object at 0x7eac89fc44c0>\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:396: 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:2378: 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:3816: 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, arg2: 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:283: AssertionError\n==================================== PASSES ====================================\n=========================== short test summary info ============================\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_element_urllquoted\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_unicode_highorder_chars\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_unicode_undecodeable_to_ascii\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_utf16\nPASSED r2e_tests/test_1.py::TraversalPathTests::test_utf8\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_empty_elements\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_highorder\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_highorder_undecodeable\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_onedot\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_path_startswith_endswith\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_same_value_returned_if_cached\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_segments_are_unicode\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_twodots\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_twodots_at_start\nPASSED r2e_tests/test_1.py::TraversalPathInfoTests::test_unicode_simple\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_pathel_with_no_getitem\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_empty_pathinfo\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_explicit_viewname\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_pathinfo_KeyError\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_pathinfo_highorder\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root2\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root3\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root4\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root_highorder\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_with_vh_root_path_root\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_withconn_getitem_emptypath_nosubpath\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_withconn_getitem_withpath_nosubpath\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_call_withconn_getitem_withpath_withsubpath\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_class_conforms_to_ITraverser\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_instance_conforms_to_ITraverser\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_path_info_raises_unicodedecodeerror\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_and_vroot\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_empty\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_string\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_and_traverse_tuple\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_nothingfancy\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_with_subpath_string\nPASSED r2e_tests/test_1.py::ResourceTreeTraverserTests::test_withroute_with_subpath_tuple\nPASSED r2e_tests/test_1.py::FindInterfaceTests::test_it_class\nPASSED r2e_tests/test_1.py::FindInterfaceTests::test_it_interface\nPASSED r2e_tests/test_1.py::FindRootTests::test_it\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_string_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_string_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_tuple_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_tuple_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_absolute_unicode_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_generator\nPASSED r2e_tests/test_1.py::FindResourceTests::test_list\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_string_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_string_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_tuple_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_relative_tuple_notfound\nPASSED r2e_tests/test_1.py::FindResourceTests::test_self_string_found\nPASSED r2e_tests/test_1.py::FindResourceTests::test_self_tuple_found\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_it\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_nonroot_default\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_path_with_None_itermediate_names\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_default\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_default_emptystring\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_object_nonnull_name_direct\nPASSED r2e_tests/test_1.py::ResourcePathTests::test_root_object_nonnull_name_indirect\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_it\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_nonroot_default\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_path_with_None_itermediate_names\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_root_default\nPASSED r2e_tests/test_1.py::ResourcePathTupleTests::test_root_default_emptystring_name\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_int\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_long\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_other\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_string\nPASSED r2e_tests/test_1.py::QuotePathSegmentTests::test_unicode\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_IResourceURL_attributes_no_vroot\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_IResourceURL_attributes_vroot_ends_with_slash\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_IResourceURL_attributes_with_vroot\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_empty_names_not_ignored\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_local_url_returns_None\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_local_url_returns_url\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_nolineage\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_unicode_mixed_with_bytes_in_resource_names\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_with_virtual_root_path\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_with_virtual_root_path_physical_not_startwith_vroot\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_call_withlineage\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_class_conforms_to_IContextURL\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_instance_conforms_to_IContextURL\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_instance_conforms_to_IResourceURL\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_virtual_root_no_virtual_root_path\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_virtual_root_no_virtual_root_path_with_root_on_request\nPASSED r2e_tests/test_1.py::ResourceURLTests::test_virtual_root_with_virtual_root_path\nPASSED r2e_tests/test_1.py::TestVirtualRoot::test_default\nPASSED r2e_tests/test_1.py::TestVirtualRoot::test_default_no_registry_on_request\nPASSED r2e_tests/test_1.py::TestVirtualRoot::test_registered\nPASSED r2e_tests/test_1.py::TraverseTests::test_absolute_string_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_absolute_tuple_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_default_traverser\nPASSED r2e_tests/test_1.py::TraverseTests::test_empty_sequence\nPASSED r2e_tests/test_1.py::TraverseTests::test_generator\nPASSED r2e_tests/test_1.py::TraverseTests::test_list\nPASSED r2e_tests/test_1.py::TraverseTests::test_relative_string_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_relative_tuple_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_request_has_registry\nPASSED r2e_tests/test_1.py::TraverseTests::test_requestfactory_overridden\nPASSED r2e_tests/test_1.py::TraverseTests::test_self_string_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_self_tuple_found\nPASSED r2e_tests/test_1.py::TraverseTests::test_self_unicode_found\nPASSED r2e_tests/test_1.py::Test__join_path_tuple::test_empty_tuple\nPASSED r2e_tests/test_1.py::Test__join_path_tuple::test_nonempty_tuple\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_multiple_request_properties\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_multiple_request_properties_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_request_property_with_callable\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_property_with_property\nPASSED r2e_tests/test_config/test_factories.py::TestFactoriesMixin::test_set_request_property_with_unnamed_callable\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_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_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_renderer_globals_factory\nPASSED r2e_tests/test_config/test_init.py::ConfiguratorTests::test_setup_registry_renderer_globals_factory_dottedname\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_renderer\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_add_renderer_dottedname_factory\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_set_renderer_globals_factory\nPASSED r2e_tests/test_config/test_rendering.py::TestRenderingConfiguratorMixin::test_set_renderer_globals_factory_dottedname\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_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_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_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_custom_predicate_bests_standard_predicate\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_custom_predicates_match\nPASSED r2e_tests/test_config/test_views.py::TestViewsConfigurationMixin::test_add_view_with_custom_predicates_nomatch\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_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_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_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_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_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_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::TestDefaultRootFactory::test_it - AttributeError:...\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_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======================== 45 failed, 905 passed in 4.25s ========================\n",
    "old_commit_res_stderr": ""
}
CHANGES.txt pyramid/tests/test_traversal.py pyramid/traversal.py
We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[ISSUE]
**Title:** AttributeError When Initializing DefaultRootFactory Without matchdict

**Description:**
When initializing `DefaultRootFactory` with a request that lacks a `matchdict`, an `AttributeError` is raised. This occurs because the factory attempts to access `matchdict` attributes directly during initialization, leading to unexpected crashes in applications that do not provide a `matchdict`.

**Example Code:**
```python
class DummyRequest(object):
    pass

root = DefaultRootFactory(DummyRequest())
```

**Expected Behavior:**
`DefaultRootFactory` should initialize successfully even if the request does not contain a `matchdict`. It should handle the absence of `matchdict` gracefully without attempting to populate the factory's `__dict__` with its values.

**Actual Behavior:**
An `AttributeError` is raised:
```
AttributeError: 'DummyRequest' object has no attribute 'matchdict'
```
This prevents the application from initializing the root factory properly when `matchdict` is not present in the request.

[/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/traversal.py
import warnings

from zope.deprecation import deprecated

from zope.interface import implementer
from zope.interface.interfaces import IInterface

from repoze.lru import lru_cache

from pyramid.interfaces import (
    IResourceURL,
    IRequestFactory,
    ITraverser,
    VH_ROOT_KEY,
    )

with warnings.catch_warnings():
    warnings.filterwarnings('ignore')
    from pyramid.interfaces import IContextURL

from pyramid.compat import (
    PY3,
    native_,
    text_,
    ascii_native_,
    text_type,
    binary_type,
    is_nonstr_iter,
    decode_path_info,
    unquote_bytes_to_wsgi,
    )

from pyramid.encode import url_quote
from pyramid.exceptions import URLDecodeError
from pyramid.location import lineage
from pyramid.threadlocal import get_current_registry

empty = text_('')

def find_root(resource):
    """ Find the root node in the resource tree to which ``resource``
    belongs. Note that ``resource`` should be :term:`location`-aware.
    Note that the root resource is available in the request object by
    accessing the ``request.root`` attribute.
    """
    for location in lineage(resource):
        if location.__parent__ is None:
            resource = location
            break
    return resource

def find_resource(resource, path):
    """ Given a resource object and a string or tuple representing a path
    (such as the return value of :func:`pyramid.traversal.resource_path` or
    :func:`pyramid.traversal.resource_path_tuple`), return a resource in this
    application's resource tree at the specified path.  The resource passed
    in *must* be :term:`location`-aware.  If the path cannot be resolved (if
    the respective node in the resource tree does not exist), a
    :exc:`KeyError` will be raised.

    This function is the logical inverse of
    :func:`pyramid.traversal.resource_path` and
    :func:`pyramid.traversal.resource_path_tuple`; it can resolve any
    path string or tuple generated by either of those functions.

    Rules for passing a *string* as the ``path`` argument: if the
    first character in the path string is the ``/``
    character, the path is considered absolute and the resource tree
    traversal will start at the root resource.  If the first character
    of the path string is *not* the ``/`` character, the path is
    considered relative and resource tree traversal will begin at the resource
    object supplied to the function as the ``resource`` argument.  If an
    empty string is passed as ``path``, the ``resource`` passed in will
    be returned.  Resource path strings must be escaped in the following
    manner: each Unicode path segment must be encoded as UTF-8 and as
    each path segment must escaped via Python's :mod:`urllib.quote`.
    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or
    ``to%20the/La%20Pe%C3%B1a`` (relative).  The
    :func:`pyramid.traversal.resource_path` function generates strings
    which follow these rules (albeit only absolute ones).

    Rules for passing *text* (Unicode) as the ``path`` argument are the same
    as those for a string.  In particular, the text may not have any nonascii
    characters in it.

    Rules for passing a *tuple* as the ``path`` argument: if the first
    element in the path tuple is the empty string (for example ``('',
    'a', 'b', 'c')``, the path is considered absolute and the resource tree
    traversal will start at the resource tree root object.  If the first
    element in the path tuple is not the empty string (for example
    ``('a', 'b', 'c')``), the path is considered relative and resource tree
    traversal will begin at the resource object supplied to the function
    as the ``resource`` argument.  If an empty sequence is passed as
    ``path``, the ``resource`` passed in itself will be returned.  No
    URL-quoting or UTF-8-encoding of individual path segments within
    the tuple is required (each segment may be any string or unicode
    object representing a resource name).  Resource path tuples generated by
    :func:`pyramid.traversal.resource_path_tuple` can always be
    resolved by ``find_resource``.

    .. note:: For backwards compatibility purposes, this function can also
       be imported as :func:`pyramid.traversal.find_model`, although doing so
       will emit a deprecation warning.
    """
    if isinstance(path, text_type):
        path = ascii_native_(path)
    D = traverse(resource, path)
    view_name = D['view_name']
    context = D['context']
    if view_name:
        raise KeyError('%r has no subelement %s' % (context, view_name))
    return context

find_model = find_resource # b/w compat (forever)

def find_interface(resource, class_or_interface):
    """
    Return the first resource found in the :term:`lineage` of ``resource``
    which, a) if ``class_or_interface`` is a Python class object, is an
    instance of the class or any subclass of that class or b) if
    ``class_or_interface`` is a :term:`interface`, provides the specified
    interface.  Return ``None`` if no resource providing ``interface_or_class``
    can be found in the lineage.  The ``resource`` passed in *must* be
    :term:`location`-aware.
    """
    if IInterface.providedBy(class_or_interface):
        test = class_or_interface.providedBy
    else:
        test = lambda arg: isinstance(arg, class_or_interface)
    for location in lineage(resource):
        if test(location):
            return location

def resource_path(resource, *elements):
    """ Return a string object representing the absolute physical path of the
    resource object based on its position in the resource tree, e.g
    ``/foo/bar``.  Any positional arguments passed in as ``elements`` will be
    appended as path segments to the end of the resource path.  For instance,
    if the resource's path is ``/foo/bar`` and ``elements`` equals ``('a',
    'b')``, the returned string will be ``/foo/bar/a/b``.  The first
    character in the string will always be the ``/`` character (a leading
    ``/`` character in a path string represents that the path is absolute).

    Resource path strings returned will be escaped in the following
    manner: each unicode path segment will be encoded as UTF-8 and
    each path segment will be escaped via Python's :mod:`urllib.quote`.
    For example, ``/path/to%20the/La%20Pe%C3%B1a``.

    This function is a logical inverse of
    :mod:`pyramid.traversal.find_resource`: it can be used to generate
    path references that can later be resolved via that function.

    The ``resource`` passed in *must* be :term:`location`-aware.

    .. note::

       Each segment in the path string returned will use the ``__name__``
       attribute of the resource it represents within the resource tree.  Each
       of these segments *should* be a unicode or string object (as per the
       contract of :term:`location`-awareness).  However, no conversion or
       safety checking of resource names is performed.  For instance, if one of
       the resources in your tree has a ``__name__`` which (by error) is a
       dictionary, the :func:`pyramid.traversal.resource_path` function will
       attempt to append it to a string and it will cause a
       :exc:`pyramid.exceptions.URLDecodeError`.

    .. note::

       The :term:`root` resource *must* have a ``__name__`` attribute with a
       value of either ``None`` or the empty string for paths to be generated
       properly.  If the root resource has a non-null ``__name__`` attribute,
       its name will be prepended to the generated path rather than a single
       leading '/' character.

    .. note::

       For backwards compatibility purposes, this function can also
       be imported as ``model_path``, although doing so will cause
       a deprecation warning to be emitted.
    """
    # joining strings is a bit expensive so we delegate to a function
    # which caches the joined result for us
    return _join_path_tuple(resource_path_tuple(resource, *elements))

model_path = resource_path # b/w compat (forever)

def traverse(resource, path):
    """Given a resource object as ``resource`` and a string or tuple
    representing a path as ``path`` (such as the return value of
    :func:`pyramid.traversal.resource_path` or
    :func:`pyramid.traversal.resource_path_tuple` or the value of
    ``request.environ['PATH_INFO']``), return a dictionary with the
    keys ``context``, ``root``, ``view_name``, ``subpath``,
    ``traversed``, ``virtual_root``, and ``virtual_root_path``.

    A definition of each value in the returned dictionary:

    - ``context``: The :term:`context` (a :term:`resource` object) found
      via traversal or url dispatch.  If the ``path`` passed in is the
      empty string, the value of the ``resource`` argument passed to this
      function is returned.

    - ``root``: The resource object at which :term:`traversal` begins.
      If the ``resource`` passed in was found via url dispatch or if the
      ``path`` passed in was relative (non-absolute), the value of the
      ``resource`` argument passed to this function is returned.

    - ``view_name``: The :term:`view name` found during
      :term:`traversal` or :term:`url dispatch`; if the ``resource`` was
      found via traversal, this is usually a representation of the
      path segment which directly follows the path to the ``context``
      in the ``path``.  The ``view_name`` will be a Unicode object or
      the empty string.  The ``view_name`` will be the empty string if
      there is no element which follows the ``context`` path.  An
      example: if the path passed is ``/foo/bar``, and a resource
      object is found at ``/foo`` (but not at ``/foo/bar``), the 'view
      name' will be ``u'bar'``.  If the ``resource`` was found via
      urldispatch, the view_name will be the name the route found was
      registered with.

    - ``subpath``: For a ``resource`` found via :term:`traversal`, this
      is a sequence of path segments found in the ``path`` that follow
      the ``view_name`` (if any).  Each of these items is a Unicode
      object.  If no path segments follow the ``view_name``, the
      subpath will be the empty sequence.  An example: if the path
      passed is ``/foo/bar/baz/buz``, and a resource object is found at
      ``/foo`` (but not ``/foo/bar``), the 'view name' will be
      ``u'bar'`` and the :term:`subpath` will be ``[u'baz', u'buz']``.
      For a ``resource`` found via url dispatch, the subpath will be a
      sequence of values discerned from ``*subpath`` in the route
      pattern matched or the empty sequence.

    - ``traversed``: The sequence of path elements traversed from the
      root to find the ``context`` object during :term:`traversal`.
      Each of these items is a Unicode object.  If no path segments
      were traversed to find the ``context`` object (e.g. if the
      ``path`` provided is the empty string), the ``traversed`` value
      will be the empty sequence.  If the ``resource`` is a resource found
      via :term:`url dispatch`, traversed will be None.

    - ``virtual_root``: A resource object representing the 'virtual' root
      of the resource tree being traversed during :term:`traversal`.
      See :ref:`vhosting_chapter` for a definition of the virtual root
      object.  If no virtual hosting is in effect, and the ``path``
      passed in was absolute, the ``virtual_root`` will be the
      *physical* root resource object (the object at which :term:`traversal`
      begins).  If the ``resource`` passed in was found via :term:`URL
      dispatch` or if the ``path`` passed in was relative, the
      ``virtual_root`` will always equal the ``root`` object (the
      resource passed in).

    - ``virtual_root_path`` -- If :term:`traversal` was used to find
      the ``resource``, this will be the sequence of path elements
      traversed to find the ``virtual_root`` resource.  Each of these
      items is a Unicode object.  If no path segments were traversed
      to find the ``virtual_root`` resource (e.g. if virtual hosting is
      not in effect), the ``traversed`` value will be the empty list.
      If url dispatch was used to find the ``resource``, this will be
      ``None``.

    If the path cannot be resolved, a :exc:`KeyError` will be raised.

    Rules for passing a *string* as the ``path`` argument: if the
    first character in the path string is the with the ``/``
    character, the path will considered absolute and the resource tree
    traversal will start at the root resource.  If the first character
    of the path string is *not* the ``/`` character, the path is
    considered relative and resource tree traversal will begin at the resource
    object supplied to the function as the ``resource`` argument.  If an
    empty string is passed as ``path``, the ``resource`` passed in will
    be returned.  Resource path strings must be escaped in the following
    manner: each Unicode path segment must be encoded as UTF-8 and
    each path segment must escaped via Python's :mod:`urllib.quote`.
    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or
    ``to%20the/La%20Pe%C3%B1a`` (relative).  The
    :func:`pyramid.traversal.resource_path` function generates strings
    which follow these rules (albeit only absolute ones).

    Rules for passing a *tuple* as the ``path`` argument: if the first
    element in the path tuple is the empty string (for example ``('',
    'a', 'b', 'c')``, the path is considered absolute and the resource tree
    traversal will start at the resource tree root object.  If the first
    element in the path tuple is not the empty string (for example
    ``('a', 'b', 'c')``), the path is considered relative and resource tree
    traversal will begin at the resource object supplied to the function
    as the ``resource`` argument.  If an empty sequence is passed as
    ``path``, the ``resource`` passed in itself will be returned.  No
    URL-quoting or UTF-8-encoding of individual path segments within
    the tuple is required (each segment may be any string or unicode
    object representing a resource name).

    Explanation of the conversion of ``path`` segment values to
    Unicode during traversal: Each segment is URL-unquoted, and
    decoded into Unicode. Each segment is assumed to be encoded using
    the UTF-8 encoding (or a subset, such as ASCII); a
    :exc:`pyramid.exceptions.URLDecodeError` is raised if a segment
    cannot be decoded.  If a segment name is empty or if it is ``.``,
    it is ignored.  If a segment name is ``..``, the previous segment
    is deleted, and the ``..`` is ignored.  As a result of this
    process, the return values ``view_name``, each element in the
    ``subpath``, each element in ``traversed``, and each element in
    the ``virtual_root_path`` will be Unicode as opposed to a string,
    and will be URL-decoded.
    """

    if is_nonstr_iter(path):
        # the traverser factory expects PATH_INFO to be a string, not
        # unicode and it expects path segments to be utf-8 and
        # urlencoded (it's the same traverser which accepts PATH_INFO
        # from user agents; user agents always send strings).
        if path:
            path = _join_path_tuple(tuple(path))
        else:
            path = ''

    # The user is supposed to pass us a string object, never Unicode.  In
    # practice, however, users indeed pass Unicode to this API.  If they do
    # pass a Unicode object, its data *must* be entirely encodeable to ASCII,
    # so we encode it here as a convenience to the user and to prevent
    # second-order failures from cropping up (all failures will occur at this
    # step rather than later down the line as the result of calling
    # ``traversal_path``).

    path = ascii_native_(path)

    if path and path[0] == '/':
        resource = find_root(resource)

    reg = get_current_registry()

    request_factory = reg.queryUtility(IRequestFactory)
    if request_factory is None:
        from pyramid.request import Request # avoid circdep
        request_factory = Request

    request = request_factory.blank(path)
    request.registry = reg
    traverser = reg.queryAdapter(resource, ITraverser)
    if traverser is None:
        traverser = ResourceTreeTraverser(resource)

    return traverser(request)

def resource_path_tuple(resource, *elements):
    """
    Return a tuple representing the absolute physical path of the
    ``resource`` object based on its position in a resource tree, e.g
    ``('', 'foo', 'bar')``.  Any positional arguments passed in as
    ``elements`` will be appended as elements in the tuple
    representing the resource path.  For instance, if the resource's
    path is ``('', 'foo', 'bar')`` and elements equals ``('a', 'b')``,
    the returned tuple will be ``('', 'foo', 'bar', 'a', 'b')``.  The
    first element of this tuple will always be the empty string (a
    leading empty string element in a path tuple represents that the
    path is absolute).

    This function is a logical inverse of
    :func:`pyramid.traversal.find_resource`: it can be used to
    generate path references that can later be resolved by that function.

    The ``resource`` passed in *must* be :term:`location`-aware.

    .. note::

       Each segment in the path tuple returned will equal the ``__name__``
       attribute of the resource it represents within the resource tree.  Each
       of these segments *should* be a unicode or string object (as per the
       contract of :term:`location`-awareness).  However, no conversion or
       safety checking of resource names is performed.  For instance, if one of
       the resources in your tree has a ``__name__`` which (by error) is a
       dictionary, that dictionary will be placed in the path tuple; no warning
       or error will be given.

    .. note::

       The :term:`root` resource *must* have a ``__name__`` attribute with a
       value of either ``None`` or the empty string for path tuples to be
       generated properly.  If the root resource has a non-null ``__name__``
       attribute, its name will be the first element in the generated path tuple
       rather than the empty string.

    .. note::

       For backwards compatibility purposes, this function can also be imported
       as ``model_path_tuple``, although doing so will cause a deprecation
       warning to be emitted.
    """
    return tuple(_resource_path_list(resource, *elements))

model_path_tuple = resource_path_tuple  # b/w compat (forever)

def _resource_path_list(resource, *elements):
    """ Implementation detail shared by resource_path and resource_path_tuple"""
    path = [loc.__name__ or '' for loc in lineage(resource)]
    path.reverse()
    path.extend(elements)
    return path

_model_path_list = _resource_path_list # b/w compat, not an API

def virtual_root(resource, request):
    """
    Provided any :term:`resource` and a :term:`request` object, return
    the resource object representing the :term:`virtual root` of the
    current :term:`request`.  Using a virtual root in a
    :term:`traversal` -based :app:`Pyramid` application permits
    rooting, for example, the resource at the traversal path ``/cms`` at
    ``http://example.com/`` instead of rooting it at
    ``http://example.com/cms/``.

    If the ``resource`` passed in is a context obtained via
    :term:`traversal`, and if the ``HTTP_X_VHM_ROOT`` key is in the
    WSGI environment, the value of this key will be treated as a
    'virtual root path': the :func:`pyramid.traversal.find_resource`
    API will be used to find the virtual root resource using this path;
    if the resource is found, it will be returned.  If the
    ``HTTP_X_VHM_ROOT`` key is not present in the WSGI environment,
    the physical :term:`root` of the resource tree will be returned instead.

    Virtual roots are not useful at all in applications that use
    :term:`URL dispatch`. Contexts obtained via URL dispatch don't
    really support being virtually rooted (each URL dispatch context
    is both its own physical and virtual root).  However if this API
    is called with a ``resource`` argument which is a context obtained
    via URL dispatch, the resource passed in will be returned
    unconditionally."""
    try:
        reg = request.registry
    except AttributeError:
        reg = get_current_registry() # b/c
    urlgenerator = reg.queryMultiAdapter((resource, request), IContextURL)
    if urlgenerator is None:
        urlgenerator = TraversalContextURL(resource, request)
    return urlgenerator.virtual_root()

def traversal_path(path):
    """ Variant of :func:`pyramid.traversal.traversal_path_info` suitable for
    decoding paths that are URL-encoded.

    If this function is passed a Unicode object instead of a sequence of
    bytes as ``path``, that Unicode object *must* directly encodeable to
    ASCII.  For example, u'/foo' will work but u'/<unprintable unicode>' (a
    Unicode object with characters that cannot be encoded to ascii) will
    not. A :exc:`UnicodeEncodeError` will be raised if the Unicode cannot be
    encoded directly to ASCII.
    """
    if isinstance(path, text_type):
        # must not possess characters outside ascii
        path = path.encode('ascii')
    # we unquote this path exactly like a PEP 3333 server would
    path = unquote_bytes_to_wsgi(path) # result will be a native string
    return traversal_path_info(path) # result will be a tuple of unicode

@lru_cache(1000)
def traversal_path_info(path):
    """ Given``path``, return a tuple representing that path which can be
    used to traverse a resource tree.  ``path`` is assumed to be an
    already-URL-decoded ``str`` type as if it had come to us from an upstream
    WSGI server as the ``PATH_INFO`` environ variable.

    The ``path`` is first decoded to from its WSGI representation to Unicode;
    it is decoded differently depending on platform:

    - On Python 2, ``path`` is decoded to Unicode from bytes using the UTF-8
      decoding directly; a :exc:`pyramid.exc.URLDecodeError` is raised if a the
      URL cannot be decoded.

    - On Python 3, as per the PEP 3333 spec, ``path`` is first encoded to
      bytes using the Latin-1 encoding; the resulting set of bytes is
      subsequently decoded to text using the UTF-8 encoding; a
      :exc:`pyramid.exc.URLDecodeError` is raised if a the URL cannot be
      decoded.

    The ``path`` is split on slashes, creating a list of segments.  If a
    segment name is empty or if it is ``.``, it is ignored.  If a segment
    name is ``..``, the previous segment is deleted, and the ``..`` is
    ignored.

    Examples:

    ``/``

        ()

    ``/foo/bar/baz``

        (u'foo', u'bar', u'baz')

    ``foo/bar/baz``

        (u'foo', u'bar', u'baz')

    ``/foo/bar/baz/``

        (u'foo', u'bar', u'baz')

    ``/foo//bar//baz/``

        (u'foo', u'bar', u'baz')

    ``/foo/bar/baz/..``

        (u'foo', u'bar')

    ``/my%20archives/hello``

        (u'my archives', u'hello')

    ``/archives/La%20Pe%C3%B1a``

        (u'archives', u'<unprintable unicode>')

    .. note::

      This function does not generate the same type of tuples that
      :func:`pyramid.traversal.resource_path_tuple` does.  In particular, the
      leading empty string is not present in the tuple it returns, unlike tuples
      returned by :func:`pyramid.traversal.resource_path_tuple`.  As a result,
      tuples generated by ``traversal_path`` are not resolveable by the
      :func:`pyramid.traversal.find_resource` API.  ``traversal_path`` is a
      function mostly used by the internals of :app:`Pyramid` and by people
      writing their own traversal machinery, as opposed to users writing
      applications in :app:`Pyramid`.
    """
    try:
        path = decode_path_info(path) # result will be Unicode
    except UnicodeDecodeError as e:
        raise URLDecodeError(e.encoding, e.object, e.start, e.end, e.reason)
    return split_path_info(path) # result will be tuple of Unicode

@lru_cache(1000)
def split_path_info(path):
    # suitable for splitting an already-unquoted-already-decoded (unicode)
    # path value
    path = path.strip('/')
    clean = []
    for segment in path.split('/'):
        if not segment or segment == '.':
            continue
        elif segment == '..':
            if clean:
                del clean[-1]
        else:
            clean.append(segment)
    return tuple(clean)

_segment_cache = {}

quote_path_segment_doc = """ \
Return a quoted representation of a 'path segment' (such as
the string ``__name__`` attribute of a resource) as a string.  If the
``segment`` passed in is a unicode object, it is converted to a
UTF-8 string, then it is URL-quoted using Python's
``urllib.quote``.  If the ``segment`` passed in is a string, it is
URL-quoted using Python's :mod:`urllib.quote`.  If the segment
passed in is not a string or unicode object, an error will be
raised.  The return value of ``quote_path_segment`` is always a
string, never Unicode.

You may pass a string of characters that need not be encoded as
the ``safe`` argument to this function.  This corresponds to the
``safe`` argument to :mod:`urllib.quote`.

.. note::

   The return value for each segment passed to this
   function is cached in a module-scope dictionary for
   speed: the cached version is returned when possible
   rather than recomputing the quoted version.  No cache
   emptying is ever done for the lifetime of an
   application, however.  If you pass arbitrary
   user-supplied strings to this function (as opposed to
   some bounded set of values from a 'working set' known to
   your application), it may become a memory leak.
"""


if PY3: # pragma: no cover
    # special-case on Python 2 for speed?  unchecked
    def quote_path_segment(segment, safe=''):
        """ %s """ % quote_path_segment_doc
        # The bit of this code that deals with ``_segment_cache`` is an
        # optimization: we cache all the computation of URL path segments
        # in this module-scope dictionary with the original string (or
        # unicode value) as the key, so we can look it up later without
        # needing to reencode or re-url-quote it
        try:
            return _segment_cache[(segment, safe)]
        except KeyError:
            if segment.__class__ not in (text_type, binary_type):
                segment = str(segment)
            result = url_quote(native_(segment, 'utf-8'), safe)
            # we don't need a lock to mutate _segment_cache, as the below
            # will generate exactly one Python bytecode (STORE_SUBSCR)
            _segment_cache[(segment, safe)] = result
            return result
else:
    def quote_path_segment(segment, safe=''):
        """ %s """ % quote_path_segment_doc
        # The bit of this code that deals with ``_segment_cache`` is an
        # optimization: we cache all the computation of URL path segments
        # in this module-scope dictionary with the original string (or
        # unicode value) as the key, so we can look it up later without
        # needing to reencode or re-url-quote it
        try:
            return _segment_cache[(segment, safe)]
        except KeyError:
            if segment.__class__ is text_type: #isinstance slighly slower (~15%)
                result = url_quote(segment.encode('utf-8'), safe)
            else:
                result = url_quote(str(segment), safe)
            # we don't need a lock to mutate _segment_cache, as the below
            # will generate exactly one Python bytecode (STORE_SUBSCR)
            _segment_cache[(segment, safe)] = result
            return result
    
slash = text_('/')

@implementer(ITraverser)
class ResourceTreeTraverser(object):
    """ A resource tree traverser that should be used (for speed) when
    every resource in the tree supplies a ``__name__`` and
    ``__parent__`` attribute (ie. every resource in the tree is
    :term:`location` aware) ."""


    VIEW_SELECTOR = '@@'

    def __init__(self, root):
        self.root = root

    def __call__(self, request):
        environ = request.environ
        matchdict = request.matchdict

        if matchdict is not None:

            path = matchdict.get('traverse', slash) or slash
            if is_nonstr_iter(path):
                # this is a *traverse stararg (not a {traverse})
                # routing has already decoded these elements, so we just
                # need to join them
                path = '/' + slash.join(path) or slash

            subpath = matchdict.get('subpath', ())
            if not is_nonstr_iter(subpath):
                # this is not a *subpath stararg (just a {subpath})
                # routing has already decoded this string, so we just need
                # to split it
                subpath = split_path_info(subpath)

        else:
            # this request did not match a route
            subpath = ()
            try:
                # empty if mounted under a path in mod_wsgi, for example
                path = request.path_info or slash
            except KeyError:
                # if environ['PATH_INFO'] is just not there
                path = slash
            except UnicodeDecodeError as e:
                raise URLDecodeError(e.encoding, e.object, e.start, e.end,
                                     e.reason)

        if VH_ROOT_KEY in environ:
            # HTTP_X_VHM_ROOT
            vroot_path = decode_path_info(environ[VH_ROOT_KEY]) 
            vroot_tuple = split_path_info(vroot_path)
            vpath = vroot_path + path # both will (must) be unicode or asciistr
            vroot_idx = len(vroot_tuple) -1
        else:
            vroot_tuple = ()
            vpath = path
            vroot_idx = -1

        root = self.root
        ob = vroot = root

        if vpath == slash: # invariant: vpath must not be empty
            # prevent a call to traversal_path if we know it's going
            # to return the empty tuple
            vpath_tuple = ()
        else:
            # we do dead reckoning here via tuple slicing instead of
            # pushing and popping temporary lists for speed purposes
            # and this hurts readability; apologies
            i = 0
            view_selector = self.VIEW_SELECTOR
            vpath_tuple = split_path_info(vpath)
            for segment in vpath_tuple:
                if segment[:2] == view_selector:
                    return {'context':ob,
                            'view_name':segment[2:],
                            'subpath':vpath_tuple[i+1:],
                            'traversed':vpath_tuple[:vroot_idx+i+1],
                            'virtual_root':vroot,
                            'virtual_root_path':vroot_tuple,
                            'root':root}
                try:
                    getitem = ob.__getitem__
                except AttributeError:
                    return {'context':ob,
                            'view_name':segment,
                            'subpath':vpath_tuple[i+1:],
                            'traversed':vpath_tuple[:vroot_idx+i+1],
                            'virtual_root':vroot,
                            'virtual_root_path':vroot_tuple,
                            'root':root}

                try:
                    next = getitem(segment)
                except KeyError:
                    return {'context':ob,
                            'view_name':segment,
                            'subpath':vpath_tuple[i+1:],
                            'traversed':vpath_tuple[:vroot_idx+i+1],
                            'virtual_root':vroot,
                            'virtual_root_path':vroot_tuple,
                            'root':root}
                if i == vroot_idx:
                    vroot = next
                ob = next
                i += 1

        return {'context':ob, 'view_name':empty, 'subpath':subpath,
                'traversed':vpath_tuple, 'virtual_root':vroot,
                'virtual_root_path':vroot_tuple, 'root':root}

ModelGraphTraverser = ResourceTreeTraverser # b/w compat, not API, used in wild

@implementer(IResourceURL, IContextURL)
class ResourceURL(object):
    vroot_varname = VH_ROOT_KEY

    def __init__(self, resource, request):
        physical_path_tuple = resource_path_tuple(resource)
        physical_path = _join_path_tuple(physical_path_tuple)

        if physical_path_tuple != ('',):
            physical_path_tuple = physical_path_tuple + ('',)
            physical_path = physical_path + '/'

        virtual_path = physical_path
        virtual_path_tuple = physical_path_tuple

        environ = request.environ
        vroot_path = environ.get(self.vroot_varname)

        # if the physical path starts with the virtual root path, trim it out
        # of the virtual path
        if vroot_path is not None:
            vroot_path = vroot_path.rstrip('/')
            if vroot_path and physical_path.startswith(vroot_path):
                vroot_path_tuple = tuple(vroot_path.split('/'))
                numels = len(vroot_path_tuple)
                virtual_path_tuple = ('',) + physical_path_tuple[numels:]
                virtual_path = physical_path[len(vroot_path):]

        self.virtual_path = virtual_path    # IResourceURL attr
        self.physical_path = physical_path  # IResourceURL attr
        self.virtual_path_tuple = virtual_path_tuple # IResourceURL attr (1.5)
        self.physical_path_tuple = physical_path_tuple # IResourceURL attr (1.5)

        # bw compat for IContextURL methods
        self.resource = resource
        self.context = resource
        self.request = request

    # IContextURL method (deprecated in 1.3)
    def virtual_root(self):
        environ = self.request.environ
        vroot_varname = self.vroot_varname
        if vroot_varname in environ:
            return find_resource(self.context, environ[vroot_varname])
        # shortcut instead of using find_root; we probably already
        # have it on the request
        try:
            return self.request.root
        except AttributeError:
            return find_root(self.context)

    # IContextURL method (deprecated in 1.3)
    def __call__(self):
        """ Generate a URL based on the :term:`lineage` of a :term:`resource`
        object that is ``self.context``.  If any resource in the context
        lineage has a Unicode name, it will be converted to a UTF-8 string
        before being attached to the URL.  If a ``HTTP_X_VHM_ROOT`` key is
        present in the WSGI environment, its value will be treated as a
        'virtual root path': the path of the URL generated by this will be
        left-stripped of this virtual root path value.
        """
        local_url = getattr(self.context, '__resource_url__', None)
        if local_url is not None:
            result = local_url(
                self.request,
                {'virtual_path':self.virtual_path,
                 'physical_path':self.physical_path},
                )
            if result is not None:
                # allow it to punt by returning ``None``
                return result

        app_url = self.request.application_url # never ends in a slash
        return app_url + self.virtual_path

TraversalContextURL = ResourceURL # deprecated as of 1.3

deprecated(
    'TraversalContextURL',
    'As of Pyramid 1.3 the, "pyramid.traversal.TraversalContextURL" class is '
    'scheduled to be removed.   Use the '
    '"pyramid.config.Configurator.add_resource_url_adapter" method to register '
    'a class that implements "pyramid.interfaces.IResourceURL" instead. '
    'See the "What\'s new In Pyramid 1.3" document for a further description.'
    )

@lru_cache(1000)
def _join_path_tuple(tuple):
    return tuple and '/'.join([quote_path_segment(x) for x in tuple]) or '/'

class DefaultRootFactory:
    __parent__ = None
    __name__ = None
    def __init__(self, request):
        matchdict = request.matchdict
        # provide backwards compatibility for applications which
        # used routes (at least apps without any custom "context
        # factory") in BFG 0.9.X and before
        if matchdict is not None:
            self.__dict__.update(matchdict)

```
--- 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]
**Title:** AttributeError When Initializing DefaultRootFactory Without matchdict

**Description:**
When initializing `DefaultRootFactory` with a request that lacks a `matchdict`, an `AttributeError` is raised. This occurs because the factory attempts to access `matchdict` attributes directly during initialization, leading to unexpected crashes in applications that do not provide a `matchdict`.

**Example Code:**
```python
class DummyRequest(object):
    pass

root = DefaultRootFactory(DummyRequest())
```

**Expected Behavior:**
`DefaultRootFactory` should initialize successfully even if the request does not contain a `matchdict`. It should handle the absence of `matchdict` gracefully without attempting to populate the factory's `__dict__` with its values.

**Actual Behavior:**
An `AttributeError` is raised:
```
AttributeError: 'DummyRequest' object has no attribute 'matchdict'
```
This prevents the application from initializing the root factory properly when `matchdict` is not present in the request.

[/ISSUE]
{
    "TraversalPathTests.test_element_urllquoted": "PASSED",
    "TraversalPathTests.test_unicode_highorder_chars": "PASSED",
    "TraversalPathTests.test_unicode_undecodeable_to_ascii": "PASSED",
    "TraversalPathTests.test_utf16": "PASSED",
    "TraversalPathTests.test_utf8": "PASSED",
    "TraversalPathInfoTests.test_empty_elements": "PASSED",
    "TraversalPathInfoTests.test_highorder": "PASSED",
    "TraversalPathInfoTests.test_highorder_undecodeable": "PASSED",
    "TraversalPathInfoTests.test_onedot": "PASSED",
    "TraversalPathInfoTests.test_path_startswith_endswith": "PASSED",
    "TraversalPathInfoTests.test_same_value_returned_if_cached": "PASSED",
    "TraversalPathInfoTests.test_segments_are_unicode": "PASSED",
    "TraversalPathInfoTests.test_twodots": "PASSED",
    "TraversalPathInfoTests.test_twodots_at_start": "PASSED",
    "TraversalPathInfoTests.test_unicode_simple": "PASSED",
    "ResourceTreeTraverserTests.test_call_pathel_with_no_getitem": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_empty_pathinfo": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_explicit_viewname": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_pathinfo_KeyError": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_pathinfo_highorder": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_vh_root": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_vh_root2": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_vh_root3": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_vh_root4": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_vh_root_highorder": "PASSED",
    "ResourceTreeTraverserTests.test_call_with_vh_root_path_root": "PASSED",
    "ResourceTreeTraverserTests.test_call_withconn_getitem_emptypath_nosubpath": "PASSED",
    "ResourceTreeTraverserTests.test_call_withconn_getitem_withpath_nosubpath": "PASSED",
    "ResourceTreeTraverserTests.test_call_withconn_getitem_withpath_withsubpath": "PASSED",
    "ResourceTreeTraverserTests.test_class_conforms_to_ITraverser": "PASSED",
    "ResourceTreeTraverserTests.test_instance_conforms_to_ITraverser": "PASSED",
    "ResourceTreeTraverserTests.test_path_info_raises_unicodedecodeerror": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_and_traverse_and_vroot": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_and_traverse_empty": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_and_traverse_string": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_and_traverse_tuple": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_nothingfancy": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_with_subpath_string": "PASSED",
    "ResourceTreeTraverserTests.test_withroute_with_subpath_tuple": "PASSED",
    "FindInterfaceTests.test_it_class": "PASSED",
    "FindInterfaceTests.test_it_interface": "PASSED",
    "FindRootTests.test_it": "PASSED",
    "FindResourceTests.test_absolute_string_found": "PASSED",
    "FindResourceTests.test_absolute_string_notfound": "PASSED",
    "FindResourceTests.test_absolute_tuple_found": "PASSED",
    "FindResourceTests.test_absolute_tuple_notfound": "PASSED",
    "FindResourceTests.test_absolute_unicode_found": "PASSED",
    "FindResourceTests.test_generator": "PASSED",
    "FindResourceTests.test_list": "PASSED",
    "FindResourceTests.test_relative_string_found": "PASSED",
    "FindResourceTests.test_relative_string_notfound": "PASSED",
    "FindResourceTests.test_relative_tuple_found": "PASSED",
    "FindResourceTests.test_relative_tuple_notfound": "PASSED",
    "FindResourceTests.test_self_string_found": "PASSED",
    "FindResourceTests.test_self_tuple_found": "PASSED",
    "ResourcePathTests.test_it": "PASSED",
    "ResourcePathTests.test_nonroot_default": "PASSED",
    "ResourcePathTests.test_path_with_None_itermediate_names": "PASSED",
    "ResourcePathTests.test_root_default": "PASSED",
    "ResourcePathTests.test_root_default_emptystring": "PASSED",
    "ResourcePathTests.test_root_object_nonnull_name_direct": "PASSED",
    "ResourcePathTests.test_root_object_nonnull_name_indirect": "PASSED",
    "ResourcePathTupleTests.test_it": "PASSED",
    "ResourcePathTupleTests.test_nonroot_default": "PASSED",
    "ResourcePathTupleTests.test_path_with_None_itermediate_names": "PASSED",
    "ResourcePathTupleTests.test_root_default": "PASSED",
    "ResourcePathTupleTests.test_root_default_emptystring_name": "PASSED",
    "QuotePathSegmentTests.test_int": "PASSED",
    "QuotePathSegmentTests.test_long": "PASSED",
    "QuotePathSegmentTests.test_other": "PASSED",
    "QuotePathSegmentTests.test_string": "PASSED",
    "QuotePathSegmentTests.test_unicode": "PASSED",
    "ResourceURLTests.test_IResourceURL_attributes_no_vroot": "PASSED",
    "ResourceURLTests.test_IResourceURL_attributes_vroot_ends_with_slash": "PASSED",
    "ResourceURLTests.test_IResourceURL_attributes_with_vroot": "PASSED",
    "ResourceURLTests.test_call_empty_names_not_ignored": "PASSED",
    "ResourceURLTests.test_call_local_url_returns_None": "PASSED",
    "ResourceURLTests.test_call_local_url_returns_url": "PASSED",
    "ResourceURLTests.test_call_nolineage": "PASSED",
    "ResourceURLTests.test_call_unicode_mixed_with_bytes_in_resource_names": "PASSED",
    "ResourceURLTests.test_call_with_virtual_root_path": "PASSED",
    "ResourceURLTests.test_call_with_virtual_root_path_physical_not_startwith_vroot": "PASSED",
    "ResourceURLTests.test_call_withlineage": "PASSED",
    "ResourceURLTests.test_class_conforms_to_IContextURL": "PASSED",
    "ResourceURLTests.test_instance_conforms_to_IContextURL": "PASSED",
    "ResourceURLTests.test_instance_conforms_to_IResourceURL": "PASSED",
    "ResourceURLTests.test_virtual_root_no_virtual_root_path": "PASSED",
    "ResourceURLTests.test_virtual_root_no_virtual_root_path_with_root_on_request": "PASSED",
    "ResourceURLTests.test_virtual_root_with_virtual_root_path": "PASSED",
    "TestVirtualRoot.test_default": "PASSED",
    "TestVirtualRoot.test_default_no_registry_on_request": "PASSED",
    "TestVirtualRoot.test_registered": "PASSED",
    "TraverseTests.test_absolute_string_found": "PASSED",
    "TraverseTests.test_absolute_tuple_found": "PASSED",
    "TraverseTests.test_default_traverser": "PASSED",
    "TraverseTests.test_empty_sequence": "PASSED",
    "TraverseTests.test_generator": "PASSED",
    "TraverseTests.test_list": "PASSED",
    "TraverseTests.test_relative_string_found": "PASSED",
    "TraverseTests.test_relative_tuple_found": "PASSED",
    "TraverseTests.test_request_has_registry": "PASSED",
    "TraverseTests.test_requestfactory_overridden": "PASSED",
    "TraverseTests.test_self_string_found": "PASSED",
    "TraverseTests.test_self_tuple_found": "PASSED",
    "TraverseTests.test_self_unicode_found": "PASSED",
    "TestDefaultRootFactory.test_it": "PASSED",
    "Test__join_path_tuple.test_empty_tuple": "PASSED",
    "Test__join_path_tuple.test_nonempty_tuple": "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_multiple_request_properties": "PASSED",
    "TestFactoriesMixin.test_set_multiple_request_properties_conflict": "PASSED",
    "TestFactoriesMixin.test_set_request_factory": "PASSED",
    "TestFactoriesMixin.test_set_request_factory_dottedname": "PASSED",
    "TestFactoriesMixin.test_set_request_property_with_callable": "PASSED",
    "TestFactoriesMixin.test_set_request_property_with_property": "PASSED",
    "TestFactoriesMixin.test_set_request_property_with_unnamed_callable": "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",
    "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_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_renderer_globals_factory": "PASSED",
    "ConfiguratorTests.test_setup_registry_renderer_globals_factory_dottedname": "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_renderer": "PASSED",
    "TestRenderingConfiguratorMixin.test_add_renderer_dottedname_factory": "PASSED",
    "TestRenderingConfiguratorMixin.test_set_renderer_globals_factory": "PASSED",
    "TestRenderingConfiguratorMixin.test_set_renderer_globals_factory_dottedname": "PASSED",
    "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_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_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",
    "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_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_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_custom_predicate_bests_standard_predicate": "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_custom_predicates_match": "PASSED",
    "TestViewsConfigurationMixin.test_add_view_with_custom_predicates_nomatch": "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_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_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_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_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_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_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_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/traversal.py b/pyramid/traversal.py
index 341ed2d75..4c275c4c1 100644
--- a/pyramid/traversal.py
+++ b/pyramid/traversal.py
@@ -822,9 +822,4 @@ class DefaultRootFactory:
     __parent__ = None
     __name__ = None
     def __init__(self, request):
-        matchdict = request.matchdict
-        # provide backwards compatibility for applications which
-        # used routes (at least apps without any custom "context
-        # factory") in BFG 0.9.X and before
-        if matchdict is not None:
-            self.__dict__.update(matchdict)
+        pass
 

{"pyramid/traversal.py": "import warnings\n\nfrom zope.deprecation import deprecated\n\nfrom zope.interface import implementer\nfrom zope.interface.interfaces import IInterface\n\nfrom repoze.lru import lru_cache\n\nfrom pyramid.interfaces import (\n    IResourceURL,\n    IRequestFactory,\n    ITraverser,\n    VH_ROOT_KEY,\n    )\n\nwith warnings.catch_warnings():\n    warnings.filterwarnings('ignore')\n    from pyramid.interfaces import IContextURL\n\nfrom pyramid.compat import (\n    PY3,\n    native_,\n    text_,\n    ascii_native_,\n    text_type,\n    binary_type,\n    is_nonstr_iter,\n    decode_path_info,\n    unquote_bytes_to_wsgi,\n    )\n\nfrom pyramid.encode import url_quote\nfrom pyramid.exceptions import URLDecodeError\nfrom pyramid.location import lineage\nfrom pyramid.threadlocal import get_current_registry\n\nempty = text_('')\n\ndef find_root(resource):\n    \"\"\" Find the root node in the resource tree to which ``resource``\n    belongs. Note that ``resource`` should be :term:`location`-aware.\n    Note that the root resource is available in the request object by\n    accessing the ``request.root`` attribute.\n    \"\"\"\n    for location in lineage(resource):\n        if location.__parent__ is None:\n            resource = location\n            break\n    return resource\n\ndef find_resource(resource, path):\n    \"\"\" Given a resource object and a string or tuple representing a path\n    (such as the return value of :func:`pyramid.traversal.resource_path` or\n    :func:`pyramid.traversal.resource_path_tuple`), return a resource in this\n    application's resource tree at the specified path.  The resource passed\n    in *must* be :term:`location`-aware.  If the path cannot be resolved (if\n    the respective node in the resource tree does not exist), a\n    :exc:`KeyError` will be raised.\n\n    This function is the logical inverse of\n    :func:`pyramid.traversal.resource_path` and\n    :func:`pyramid.traversal.resource_path_tuple`; it can resolve any\n    path string or tuple generated by either of those functions.\n\n    Rules for passing a *string* as the ``path`` argument: if the\n    first character in the path string is the ``/``\n    character, the path is considered absolute and the resource tree\n    traversal will start at the root resource.  If the first character\n    of the path string is *not* the ``/`` character, the path is\n    considered relative and resource tree traversal will begin at the resource\n    object supplied to the function as the ``resource`` argument.  If an\n    empty string is passed as ``path``, the ``resource`` passed in will\n    be returned.  Resource path strings must be escaped in the following\n    manner: each Unicode path segment must be encoded as UTF-8 and as\n    each path segment must escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or\n    ``to%20the/La%20Pe%C3%B1a`` (relative).  The\n    :func:`pyramid.traversal.resource_path` function generates strings\n    which follow these rules (albeit only absolute ones).\n\n    Rules for passing *text* (Unicode) as the ``path`` argument are the same\n    as those for a string.  In particular, the text may not have any nonascii\n    characters in it.\n\n    Rules for passing a *tuple* as the ``path`` argument: if the first\n    element in the path tuple is the empty string (for example ``('',\n    'a', 'b', 'c')``, the path is considered absolute and the resource tree\n    traversal will start at the resource tree root object.  If the first\n    element in the path tuple is not the empty string (for example\n    ``('a', 'b', 'c')``), the path is considered relative and resource tree\n    traversal will begin at the resource object supplied to the function\n    as the ``resource`` argument.  If an empty sequence is passed as\n    ``path``, the ``resource`` passed in itself will be returned.  No\n    URL-quoting or UTF-8-encoding of individual path segments within\n    the tuple is required (each segment may be any string or unicode\n    object representing a resource name).  Resource path tuples generated by\n    :func:`pyramid.traversal.resource_path_tuple` can always be\n    resolved by ``find_resource``.\n\n    .. note:: For backwards compatibility purposes, this function can also\n       be imported as :func:`pyramid.traversal.find_model`, although doing so\n       will emit a deprecation warning.\n    \"\"\"\n    if isinstance(path, text_type):\n        path = ascii_native_(path)\n    D = traverse(resource, path)\n    view_name = D['view_name']\n    context = D['context']\n    if view_name:\n        raise KeyError('%r has no subelement %s' % (context, view_name))\n    return context\n\nfind_model = find_resource # b/w compat (forever)\n\ndef find_interface(resource, class_or_interface):\n    \"\"\"\n    Return the first resource found in the :term:`lineage` of ``resource``\n    which, a) if ``class_or_interface`` is a Python class object, is an\n    instance of the class or any subclass of that class or b) if\n    ``class_or_interface`` is a :term:`interface`, provides the specified\n    interface.  Return ``None`` if no resource providing ``interface_or_class``\n    can be found in the lineage.  The ``resource`` passed in *must* be\n    :term:`location`-aware.\n    \"\"\"\n    if IInterface.providedBy(class_or_interface):\n        test = class_or_interface.providedBy\n    else:\n        test = lambda arg: isinstance(arg, class_or_interface)\n    for location in lineage(resource):\n        if test(location):\n            return location\n\ndef resource_path(resource, *elements):\n    \"\"\" Return a string object representing the absolute physical path of the\n    resource object based on its position in the resource tree, e.g\n    ``/foo/bar``.  Any positional arguments passed in as ``elements`` will be\n    appended as path segments to the end of the resource path.  For instance,\n    if the resource's path is ``/foo/bar`` and ``elements`` equals ``('a',\n    'b')``, the returned string will be ``/foo/bar/a/b``.  The first\n    character in the string will always be the ``/`` character (a leading\n    ``/`` character in a path string represents that the path is absolute).\n\n    Resource path strings returned will be escaped in the following\n    manner: each unicode path segment will be encoded as UTF-8 and\n    each path segment will be escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a``.\n\n    This function is a logical inverse of\n    :mod:`pyramid.traversal.find_resource`: it can be used to generate\n    path references that can later be resolved via that function.\n\n    The ``resource`` passed in *must* be :term:`location`-aware.\n\n    .. note::\n\n       Each segment in the path string returned will use the ``__name__``\n       attribute of the resource it represents within the resource tree.  Each\n       of these segments *should* be a unicode or string object (as per the\n       contract of :term:`location`-awareness).  However, no conversion or\n       safety checking of resource names is performed.  For instance, if one of\n       the resources in your tree has a ``__name__`` which (by error) is a\n       dictionary, the :func:`pyramid.traversal.resource_path` function will\n       attempt to append it to a string and it will cause a\n       :exc:`pyramid.exceptions.URLDecodeError`.\n\n    .. note::\n\n       The :term:`root` resource *must* have a ``__name__`` attribute with a\n       value of either ``None`` or the empty string for paths to be generated\n       properly.  If the root resource has a non-null ``__name__`` attribute,\n       its name will be prepended to the generated path rather than a single\n       leading '/' character.\n\n    .. note::\n\n       For backwards compatibility purposes, this function can also\n       be imported as ``model_path``, although doing so will cause\n       a deprecation warning to be emitted.\n    \"\"\"\n    # joining strings is a bit expensive so we delegate to a function\n    # which caches the joined result for us\n    return _join_path_tuple(resource_path_tuple(resource, *elements))\n\nmodel_path = resource_path # b/w compat (forever)\n\ndef traverse(resource, path):\n    \"\"\"Given a resource object as ``resource`` and a string or tuple\n    representing a path as ``path`` (such as the return value of\n    :func:`pyramid.traversal.resource_path` or\n    :func:`pyramid.traversal.resource_path_tuple` or the value of\n    ``request.environ['PATH_INFO']``), return a dictionary with the\n    keys ``context``, ``root``, ``view_name``, ``subpath``,\n    ``traversed``, ``virtual_root``, and ``virtual_root_path``.\n\n    A definition of each value in the returned dictionary:\n\n    - ``context``: The :term:`context` (a :term:`resource` object) found\n      via traversal or url dispatch.  If the ``path`` passed in is the\n      empty string, the value of the ``resource`` argument passed to this\n      function is returned.\n\n    - ``root``: The resource object at which :term:`traversal` begins.\n      If the ``resource`` passed in was found via url dispatch or if the\n      ``path`` passed in was relative (non-absolute), the value of the\n      ``resource`` argument passed to this function is returned.\n\n    - ``view_name``: The :term:`view name` found during\n      :term:`traversal` or :term:`url dispatch`; if the ``resource`` was\n      found via traversal, this is usually a representation of the\n      path segment which directly follows the path to the ``context``\n      in the ``path``.  The ``view_name`` will be a Unicode object or\n      the empty string.  The ``view_name`` will be the empty string if\n      there is no element which follows the ``context`` path.  An\n      example: if the path passed is ``/foo/bar``, and a resource\n      object is found at ``/foo`` (but not at ``/foo/bar``), the 'view\n      name' will be ``u'bar'``.  If the ``resource`` was found via\n      urldispatch, the view_name will be the name the route found was\n      registered with.\n\n    - ``subpath``: For a ``resource`` found via :term:`traversal`, this\n      is a sequence of path segments found in the ``path`` that follow\n      the ``view_name`` (if any).  Each of these items is a Unicode\n      object.  If no path segments follow the ``view_name``, the\n      subpath will be the empty sequence.  An example: if the path\n      passed is ``/foo/bar/baz/buz``, and a resource object is found at\n      ``/foo`` (but not ``/foo/bar``), the 'view name' will be\n      ``u'bar'`` and the :term:`subpath` will be ``[u'baz', u'buz']``.\n      For a ``resource`` found via url dispatch, the subpath will be a\n      sequence of values discerned from ``*subpath`` in the route\n      pattern matched or the empty sequence.\n\n    - ``traversed``: The sequence of path elements traversed from the\n      root to find the ``context`` object during :term:`traversal`.\n      Each of these items is a Unicode object.  If no path segments\n      were traversed to find the ``context`` object (e.g. if the\n      ``path`` provided is the empty string), the ``traversed`` value\n      will be the empty sequence.  If the ``resource`` is a resource found\n      via :term:`url dispatch`, traversed will be None.\n\n    - ``virtual_root``: A resource object representing the 'virtual' root\n      of the resource tree being traversed during :term:`traversal`.\n      See :ref:`vhosting_chapter` for a definition of the virtual root\n      object.  If no virtual hosting is in effect, and the ``path``\n      passed in was absolute, the ``virtual_root`` will be the\n      *physical* root resource object (the object at which :term:`traversal`\n      begins).  If the ``resource`` passed in was found via :term:`URL\n      dispatch` or if the ``path`` passed in was relative, the\n      ``virtual_root`` will always equal the ``root`` object (the\n      resource passed in).\n\n    - ``virtual_root_path`` -- If :term:`traversal` was used to find\n      the ``resource``, this will be the sequence of path elements\n      traversed to find the ``virtual_root`` resource.  Each of these\n      items is a Unicode object.  If no path segments were traversed\n      to find the ``virtual_root`` resource (e.g. if virtual hosting is\n      not in effect), the ``traversed`` value will be the empty list.\n      If url dispatch was used to find the ``resource``, this will be\n      ``None``.\n\n    If the path cannot be resolved, a :exc:`KeyError` will be raised.\n\n    Rules for passing a *string* as the ``path`` argument: if the\n    first character in the path string is the with the ``/``\n    character, the path will considered absolute and the resource tree\n    traversal will start at the root resource.  If the first character\n    of the path string is *not* the ``/`` character, the path is\n    considered relative and resource tree traversal will begin at the resource\n    object supplied to the function as the ``resource`` argument.  If an\n    empty string is passed as ``path``, the ``resource`` passed in will\n    be returned.  Resource path strings must be escaped in the following\n    manner: each Unicode path segment must be encoded as UTF-8 and\n    each path segment must escaped via Python's :mod:`urllib.quote`.\n    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or\n    ``to%20the/La%20Pe%C3%B1a`` (relative).  The\n    :func:`pyramid.traversal.resource_path` function generates strings\n    which follow these rules (albeit only absolute ones).\n\n    Rules for passing a *tuple* as the ``path`` argument: if the first\n    element in the path tuple is the empty string (for example ``('',\n    'a', 'b', 'c')``, the path is considered absolute and the resource tree\n    traversal will start at the resource tree root object.  If the first\n    element in the path tuple is not the empty string (for example\n    ``('a', 'b', 'c')``), the path is considered relative and resource tree\n    traversal will begin at the resource object supplied to the function\n    as the ``resource`` argument.  If an empty sequence is passed as\n    ``path``, the ``resource`` passed in itself will be returned.  No\n    URL-quoting or UTF-8-encoding of individual path segments within\n    the tuple is required (each segment may be any string or unicode\n    object representing a resource name).\n\n    Explanation of the conversion of ``path`` segment values to\n    Unicode during traversal: Each segment is URL-unquoted, and\n    decoded into Unicode. Each segment is assumed to be encoded using\n    the UTF-8 encoding (or a subset, such as ASCII); a\n    :exc:`pyramid.exceptions.URLDecodeError` is raised if a segment\n    cannot be decoded.  If a segment name is empty or if it is ``.``,\n    it is ignored.  If a segment name is ``..``, the previous segment\n    is deleted, and the ``..`` is ignored.  As a result of this\n    process, the return values ``view_name``, each element in the\n    ``subpath``, each element in ``traversed``, and each element in\n    the ``virtual_root_path`` will be Unicode as opposed to a string,\n    and will be URL-decoded.\n    \"\"\"\n\n    if is_nonstr_iter(path):\n        # the traverser factory expects PATH_INFO to be a string, not\n        # unicode and it expects path segments to be utf-8 and\n        # urlencoded (it's the same traverser which accepts PATH_INFO\n        # from user agents; user agents always send strings).\n        if path:\n            path = _join_path_tuple(tuple(path))\n        else:\n            path = ''\n\n    # The user is supposed to pass us a string object, never Unicode.  In\n    # practice, however, users indeed pass Unicode to this API.  If they do\n    # pass a Unicode object, its data *must* be entirely encodeable to ASCII,\n    # so we encode it here as a convenience to the user and to prevent\n    # second-order failures from cropping up (all failures will occur at this\n    # step rather than later down the line as the result of calling\n    # ``traversal_path``).\n\n    path = ascii_native_(path)\n\n    if path and path[0] == '/':\n        resource = find_root(resource)\n\n    reg = get_current_registry()\n\n    request_factory = reg.queryUtility(IRequestFactory)\n    if request_factory is None:\n        from pyramid.request import Request # avoid circdep\n        request_factory = Request\n\n    request = request_factory.blank(path)\n    request.registry = reg\n    traverser = reg.queryAdapter(resource, ITraverser)\n    if traverser is None:\n        traverser = ResourceTreeTraverser(resource)\n\n    return traverser(request)\n\ndef resource_path_tuple(resource, *elements):\n    \"\"\"\n    Return a tuple representing the absolute physical path of the\n    ``resource`` object based on its position in a resource tree, e.g\n    ``('', 'foo', 'bar')``.  Any positional arguments passed in as\n    ``elements`` will be appended as elements in the tuple\n    representing the resource path.  For instance, if the resource's\n    path is ``('', 'foo', 'bar')`` and elements equals ``('a', 'b')``,\n    the returned tuple will be ``('', 'foo', 'bar', 'a', 'b')``.  The\n    first element of this tuple will always be the empty string (a\n    leading empty string element in a path tuple represents that the\n    path is absolute).\n\n    This function is a logical inverse of\n    :func:`pyramid.traversal.find_resource`: it can be used to\n    generate path references that can later be resolved by that function.\n\n    The ``resource`` passed in *must* be :term:`location`-aware.\n\n    .. note::\n\n       Each segment in the path tuple returned will equal the ``__name__``\n       attribute of the resource it represents within the resource tree.  Each\n       of these segments *should* be a unicode or string object (as per the\n       contract of :term:`location`-awareness).  However, no conversion or\n       safety checking of resource names is performed.  For instance, if one of\n       the resources in your tree has a ``__name__`` which (by error) is a\n       dictionary, that dictionary will be placed in the path tuple; no warning\n       or error will be given.\n\n    .. note::\n\n       The :term:`root` resource *must* have a ``__name__`` attribute with a\n       value of either ``None`` or the empty string for path tuples to be\n       generated properly.  If the root resource has a non-null ``__name__``\n       attribute, its name will be the first element in the generated path tuple\n       rather than the empty string.\n\n    .. note::\n\n       For backwards compatibility purposes, this function can also be imported\n       as ``model_path_tuple``, although doing so will cause a deprecation\n       warning to be emitted.\n    \"\"\"\n    return tuple(_resource_path_list(resource, *elements))\n\nmodel_path_tuple = resource_path_tuple  # b/w compat (forever)\n\ndef _resource_path_list(resource, *elements):\n    \"\"\" Implementation detail shared by resource_path and resource_path_tuple\"\"\"\n    path = [loc.__name__ or '' for loc in lineage(resource)]\n    path.reverse()\n    path.extend(elements)\n    return path\n\n_model_path_list = _resource_path_list # b/w compat, not an API\n\ndef virtual_root(resource, request):\n    \"\"\"\n    Provided any :term:`resource` and a :term:`request` object, return\n    the resource object representing the :term:`virtual root` of the\n    current :term:`request`.  Using a virtual root in a\n    :term:`traversal` -based :app:`Pyramid` application permits\n    rooting, for example, the resource at the traversal path ``/cms`` at\n    ``http://example.com/`` instead of rooting it at\n    ``http://example.com/cms/``.\n\n    If the ``resource`` passed in is a context obtained via\n    :term:`traversal`, and if the ``HTTP_X_VHM_ROOT`` key is in the\n    WSGI environment, the value of this key will be treated as a\n    'virtual root path': the :func:`pyramid.traversal.find_resource`\n    API will be used to find the virtual root resource using this path;\n    if the resource is found, it will be returned.  If the\n    ``HTTP_X_VHM_ROOT`` key is not present in the WSGI environment,\n    the physical :term:`root` of the resource tree will be returned instead.\n\n    Virtual roots are not useful at all in applications that use\n    :term:`URL dispatch`. Contexts obtained via URL dispatch don't\n    really support being virtually rooted (each URL dispatch context\n    is both its own physical and virtual root).  However if this API\n    is called with a ``resource`` argument which is a context obtained\n    via URL dispatch, the resource passed in will be returned\n    unconditionally.\"\"\"\n    try:\n        reg = request.registry\n    except AttributeError:\n        reg = get_current_registry() # b/c\n    urlgenerator = reg.queryMultiAdapter((resource, request), IContextURL)\n    if urlgenerator is None:\n        urlgenerator = TraversalContextURL(resource, request)\n    return urlgenerator.virtual_root()\n\ndef traversal_path(path):\n    \"\"\" Variant of :func:`pyramid.traversal.traversal_path_info` suitable for\n    decoding paths that are URL-encoded.\n\n    If this function is passed a Unicode object instead of a sequence of\n    bytes as ``path``, that Unicode object *must* directly encodeable to\n    ASCII.  For example, u'/foo' will work but u'/<unprintable unicode>' (a\n    Unicode object with characters that cannot be encoded to ascii) will\n    not. A :exc:`UnicodeEncodeError` will be raised if the Unicode cannot be\n    encoded directly to ASCII.\n    \"\"\"\n    if isinstance(path, text_type):\n        # must not possess characters outside ascii\n        path = path.encode('ascii')\n    # we unquote this path exactly like a PEP 3333 server would\n    path = unquote_bytes_to_wsgi(path) # result will be a native string\n    return traversal_path_info(path) # result will be a tuple of unicode\n\n@lru_cache(1000)\ndef traversal_path_info(path):\n    \"\"\" Given``path``, return a tuple representing that path which can be\n    used to traverse a resource tree.  ``path`` is assumed to be an\n    already-URL-decoded ``str`` type as if it had come to us from an upstream\n    WSGI server as the ``PATH_INFO`` environ variable.\n\n    The ``path`` is first decoded to from its WSGI representation to Unicode;\n    it is decoded differently depending on platform:\n\n    - On Python 2, ``path`` is decoded to Unicode from bytes using the UTF-8\n      decoding directly; a :exc:`pyramid.exc.URLDecodeError` is raised if a the\n      URL cannot be decoded.\n\n    - On Python 3, as per the PEP 3333 spec, ``path`` is first encoded to\n      bytes using the Latin-1 encoding; the resulting set of bytes is\n      subsequently decoded to text using the UTF-8 encoding; a\n      :exc:`pyramid.exc.URLDecodeError` is raised if a the URL cannot be\n      decoded.\n\n    The ``path`` is split on slashes, creating a list of segments.  If a\n    segment name is empty or if it is ``.``, it is ignored.  If a segment\n    name is ``..``, the previous segment is deleted, and the ``..`` is\n    ignored.\n\n    Examples:\n\n    ``/``\n\n        ()\n\n    ``/foo/bar/baz``\n\n        (u'foo', u'bar', u'baz')\n\n    ``foo/bar/baz``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo/bar/baz/``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo//bar//baz/``\n\n        (u'foo', u'bar', u'baz')\n\n    ``/foo/bar/baz/..``\n\n        (u'foo', u'bar')\n\n    ``/my%20archives/hello``\n\n        (u'my archives', u'hello')\n\n    ``/archives/La%20Pe%C3%B1a``\n\n        (u'archives', u'<unprintable unicode>')\n\n    .. note::\n\n      This function does not generate the same type of tuples that\n      :func:`pyramid.traversal.resource_path_tuple` does.  In particular, the\n      leading empty string is not present in the tuple it returns, unlike tuples\n      returned by :func:`pyramid.traversal.resource_path_tuple`.  As a result,\n      tuples generated by ``traversal_path`` are not resolveable by the\n      :func:`pyramid.traversal.find_resource` API.  ``traversal_path`` is a\n      function mostly used by the internals of :app:`Pyramid` and by people\n      writing their own traversal machinery, as opposed to users writing\n      applications in :app:`Pyramid`.\n    \"\"\"\n    try:\n        path = decode_path_info(path) # result will be Unicode\n    except UnicodeDecodeError as e:\n        raise URLDecodeError(e.encoding, e.object, e.start, e.end, e.reason)\n    return split_path_info(path) # result will be tuple of Unicode\n\n@lru_cache(1000)\ndef split_path_info(path):\n    # suitable for splitting an already-unquoted-already-decoded (unicode)\n    # path value\n    path = path.strip('/')\n    clean = []\n    for segment in path.split('/'):\n        if not segment or segment == '.':\n            continue\n        elif segment == '..':\n            if clean:\n                del clean[-1]\n        else:\n            clean.append(segment)\n    return tuple(clean)\n\n_segment_cache = {}\n\nquote_path_segment_doc = \"\"\" \\\nReturn a quoted representation of a 'path segment' (such as\nthe string ``__name__`` attribute of a resource) as a string.  If the\n``segment`` passed in is a unicode object, it is converted to a\nUTF-8 string, then it is URL-quoted using Python's\n``urllib.quote``.  If the ``segment`` passed in is a string, it is\nURL-quoted using Python's :mod:`urllib.quote`.  If the segment\npassed in is not a string or unicode object, an error will be\nraised.  The return value of ``quote_path_segment`` is always a\nstring, never Unicode.\n\nYou may pass a string of characters that need not be encoded as\nthe ``safe`` argument to this function.  This corresponds to the\n``safe`` argument to :mod:`urllib.quote`.\n\n.. note::\n\n   The return value for each segment passed to this\n   function is cached in a module-scope dictionary for\n   speed: the cached version is returned when possible\n   rather than recomputing the quoted version.  No cache\n   emptying is ever done for the lifetime of an\n   application, however.  If you pass arbitrary\n   user-supplied strings to this function (as opposed to\n   some bounded set of values from a 'working set' known to\n   your application), it may become a memory leak.\n\"\"\"\n\n\nif PY3: # pragma: no cover\n    # special-case on Python 2 for speed?  unchecked\n    def quote_path_segment(segment, safe=''):\n        \"\"\" %s \"\"\" % quote_path_segment_doc\n        # The bit of this code that deals with ``_segment_cache`` is an\n        # optimization: we cache all the computation of URL path segments\n        # in this module-scope dictionary with the original string (or\n        # unicode value) as the key, so we can look it up later without\n        # needing to reencode or re-url-quote it\n        try:\n            return _segment_cache[(segment, safe)]\n        except KeyError:\n            if segment.__class__ not in (text_type, binary_type):\n                segment = str(segment)\n            result = url_quote(native_(segment, 'utf-8'), safe)\n            # we don't need a lock to mutate _segment_cache, as the below\n            # will generate exactly one Python bytecode (STORE_SUBSCR)\n            _segment_cache[(segment, safe)] = result\n            return result\nelse:\n    def quote_path_segment(segment, safe=''):\n        \"\"\" %s \"\"\" % quote_path_segment_doc\n        # The bit of this code that deals with ``_segment_cache`` is an\n        # optimization: we cache all the computation of URL path segments\n        # in this module-scope dictionary with the original string (or\n        # unicode value) as the key, so we can look it up later without\n        # needing to reencode or re-url-quote it\n        try:\n            return _segment_cache[(segment, safe)]\n        except KeyError:\n            if segment.__class__ is text_type: #isinstance slighly slower (~15%)\n                result = url_quote(segment.encode('utf-8'), safe)\n            else:\n                result = url_quote(str(segment), safe)\n            # we don't need a lock to mutate _segment_cache, as the below\n            # will generate exactly one Python bytecode (STORE_SUBSCR)\n            _segment_cache[(segment, safe)] = result\n            return result\n    \nslash = text_('/')\n\n@implementer(ITraverser)\nclass ResourceTreeTraverser(object):\n    \"\"\" A resource tree traverser that should be used (for speed) when\n    every resource in the tree supplies a ``__name__`` and\n    ``__parent__`` attribute (ie. every resource in the tree is\n    :term:`location` aware) .\"\"\"\n\n\n    VIEW_SELECTOR = '@@'\n\n    def __init__(self, root):\n        self.root = root\n\n    def __call__(self, request):\n        environ = request.environ\n        matchdict = request.matchdict\n\n        if matchdict is not None:\n\n            path = matchdict.get('traverse', slash) or slash\n            if is_nonstr_iter(path):\n                # this is a *traverse stararg (not a {traverse})\n                # routing has already decoded these elements, so we just\n                # need to join them\n                path = '/' + slash.join(path) or slash\n\n            subpath = matchdict.get('subpath', ())\n            if not is_nonstr_iter(subpath):\n                # this is not a *subpath stararg (just a {subpath})\n                # routing has already decoded this string, so we just need\n                # to split it\n                subpath = split_path_info(subpath)\n\n        else:\n            # this request did not match a route\n            subpath = ()\n            try:\n                # empty if mounted under a path in mod_wsgi, for example\n                path = request.path_info or slash\n            except KeyError:\n                # if environ['PATH_INFO'] is just not there\n                path = slash\n            except UnicodeDecodeError as e:\n                raise URLDecodeError(e.encoding, e.object, e.start, e.end,\n                                     e.reason)\n\n        if VH_ROOT_KEY in environ:\n            # HTTP_X_VHM_ROOT\n            vroot_path = decode_path_info(environ[VH_ROOT_KEY]) \n            vroot_tuple = split_path_info(vroot_path)\n            vpath = vroot_path + path # both will (must) be unicode or asciistr\n            vroot_idx = len(vroot_tuple) -1\n        else:\n            vroot_tuple = ()\n            vpath = path\n            vroot_idx = -1\n\n        root = self.root\n        ob = vroot = root\n\n        if vpath == slash: # invariant: vpath must not be empty\n            # prevent a call to traversal_path if we know it's going\n            # to return the empty tuple\n            vpath_tuple = ()\n        else:\n            # we do dead reckoning here via tuple slicing instead of\n            # pushing and popping temporary lists for speed purposes\n            # and this hurts readability; apologies\n            i = 0\n            view_selector = self.VIEW_SELECTOR\n            vpath_tuple = split_path_info(vpath)\n            for segment in vpath_tuple:\n                if segment[:2] == view_selector:\n                    return {'context':ob,\n                            'view_name':segment[2:],\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n                try:\n                    getitem = ob.__getitem__\n                except AttributeError:\n                    return {'context':ob,\n                            'view_name':segment,\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n\n                try:\n                    next = getitem(segment)\n                except KeyError:\n                    return {'context':ob,\n                            'view_name':segment,\n                            'subpath':vpath_tuple[i+1:],\n                            'traversed':vpath_tuple[:vroot_idx+i+1],\n                            'virtual_root':vroot,\n                            'virtual_root_path':vroot_tuple,\n                            'root':root}\n                if i == vroot_idx:\n                    vroot = next\n                ob = next\n                i += 1\n\n        return {'context':ob, 'view_name':empty, 'subpath':subpath,\n                'traversed':vpath_tuple, 'virtual_root':vroot,\n                'virtual_root_path':vroot_tuple, 'root':root}\n\nModelGraphTraverser = ResourceTreeTraverser # b/w compat, not API, used in wild\n\n@implementer(IResourceURL, IContextURL)\nclass ResourceURL(object):\n    vroot_varname = VH_ROOT_KEY\n\n    def __init__(self, resource, request):\n        physical_path_tuple = resource_path_tuple(resource)\n        physical_path = _join_path_tuple(physical_path_tuple)\n\n        if physical_path_tuple != ('',):\n            physical_path_tuple = physical_path_tuple + ('',)\n            physical_path = physical_path + '/'\n\n        virtual_path = physical_path\n        virtual_path_tuple = physical_path_tuple\n\n        environ = request.environ\n        vroot_path = environ.get(self.vroot_varname)\n\n        # if the physical path starts with the virtual root path, trim it out\n        # of the virtual path\n        if vroot_path is not None:\n            vroot_path = vroot_path.rstrip('/')\n            if vroot_path and physical_path.startswith(vroot_path):\n                vroot_path_tuple = tuple(vroot_path.split('/'))\n                numels = len(vroot_path_tuple)\n                virtual_path_tuple = ('',) + physical_path_tuple[numels:]\n                virtual_path = physical_path[len(vroot_path):]\n\n        self.virtual_path = virtual_path    # IResourceURL attr\n        self.physical_path = physical_path  # IResourceURL attr\n        self.virtual_path_tuple = virtual_path_tuple # IResourceURL attr (1.5)\n        self.physical_path_tuple = physical_path_tuple # IResourceURL attr (1.5)\n\n        # bw compat for IContextURL methods\n        self.resource = resource\n        self.context = resource\n        self.request = request\n\n    # IContextURL method (deprecated in 1.3)\n    def virtual_root(self):\n        environ = self.request.environ\n        vroot_varname = self.vroot_varname\n        if vroot_varname in environ:\n            return find_resource(self.context, environ[vroot_varname])\n        # shortcut instead of using find_root; we probably already\n        # have it on the request\n        try:\n            return self.request.root\n        except AttributeError:\n            return find_root(self.context)\n\n    # IContextURL method (deprecated in 1.3)\n    def __call__(self):\n        \"\"\" Generate a URL based on the :term:`lineage` of a :term:`resource`\n        object that is ``self.context``.  If any resource in the context\n        lineage has a Unicode name, it will be converted to a UTF-8 string\n        before being attached to the URL.  If a ``HTTP_X_VHM_ROOT`` key is\n        present in the WSGI environment, its value will be treated as a\n        'virtual root path': the path of the URL generated by this will be\n        left-stripped of this virtual root path value.\n        \"\"\"\n        local_url = getattr(self.context, '__resource_url__', None)\n        if local_url is not None:\n            result = local_url(\n                self.request,\n                {'virtual_path':self.virtual_path,\n                 'physical_path':self.physical_path},\n                )\n            if result is not None:\n                # allow it to punt by returning ``None``\n                return result\n\n        app_url = self.request.application_url # never ends in a slash\n        return app_url + self.virtual_path\n\nTraversalContextURL = ResourceURL # deprecated as of 1.3\n\ndeprecated(\n    'TraversalContextURL',\n    'As of Pyramid 1.3 the, \"pyramid.traversal.TraversalContextURL\" class is '\n    'scheduled to be removed.   Use the '\n    '\"pyramid.config.Configurator.add_resource_url_adapter\" method to register '\n    'a class that implements \"pyramid.interfaces.IResourceURL\" instead. '\n    'See the \"What\\'s new In Pyramid 1.3\" document for a further description.'\n    )\n\n@lru_cache(1000)\ndef _join_path_tuple(tuple):\n    return tuple and '/'.join([quote_path_segment(x) for x in tuple]) or '/'\n\nclass DefaultRootFactory:\n    __parent__ = None\n    __name__ = None\n    def __init__(self, request):\n        matchdict = request.matchdict\n        # provide backwards compatibility for applications which\n        # used routes (at least apps without any custom \"context\n        # factory\") in BFG 0.9.X and before\n        if matchdict is not None:\n            self.__dict__.update(matchdict)\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]
**Title:** AttributeError When Initializing DefaultRootFactory Without matchdict

**Description:**
When initializing `DefaultRootFactory` with a request that lacks a `matchdict`, an `AttributeError` is raised. This occurs because the factory attempts to access `matchdict` attributes directly during initialization, leading to unexpected crashes in applications that do not provide a `matchdict`.

**Example Code:**
```python
class DummyRequest(object):
    pass

root = DefaultRootFactory(DummyRequest())
```

**Expected Behavior:**
`DefaultRootFactory` should initialize successfully even if the request does not contain a `matchdict`. It should handle the absence of `matchdict` gracefully without attempting to populate the factory's `__dict__` with its values.

**Actual Behavior:**
An `AttributeError` is raised:
```
AttributeError: 'DummyRequest' object has no attribute 'matchdict'
```
This prevents the application from initializing the root factory properly when `matchdict` is not present in the request.

[/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/traversal.py
import warnings

from zope.deprecation import deprecated

from zope.interface import implementer
from zope.interface.interfaces import IInterface

from repoze.lru import lru_cache

from pyramid.interfaces import (
    IResourceURL,
    IRequestFactory,
    ITraverser,
    VH_ROOT_KEY,
    )

with warnings.catch_warnings():
    warnings.filterwarnings('ignore')
    from pyramid.interfaces import IContextURL

from pyramid.compat import (
    PY3,
    native_,
    text_,
    ascii_native_,
    text_type,
    binary_type,
    is_nonstr_iter,
    decode_path_info,
    unquote_bytes_to_wsgi,
    )

from pyramid.encode import url_quote
from pyramid.exceptions import URLDecodeError
from pyramid.location import lineage
from pyramid.threadlocal import get_current_registry

empty = text_('')

def find_root(resource):
    """ Find the root node in the resource tree to which ``resource``
    belongs. Note that ``resource`` should be :term:`location`-aware.
    Note that the root resource is available in the request object by
    accessing the ``request.root`` attribute.
    """
    for location in lineage(resource):
        if location.__parent__ is None:
            resource = location
            break
    return resource

def find_resource(resource, path):
    """ Given a resource object and a string or tuple representing a path
    (such as the return value of :func:`pyramid.traversal.resource_path` or
    :func:`pyramid.traversal.resource_path_tuple`), return a resource in this
    application's resource tree at the specified path.  The resource passed
    in *must* be :term:`location`-aware.  If the path cannot be resolved (if
    the respective node in the resource tree does not exist), a
    :exc:`KeyError` will be raised.

    This function is the logical inverse of
    :func:`pyramid.traversal.resource_path` and
    :func:`pyramid.traversal.resource_path_tuple`; it can resolve any
    path string or tuple generated by either of those functions.

    Rules for passing a *string* as the ``path`` argument: if the
    first character in the path string is the ``/``
    character, the path is considered absolute and the resource tree
    traversal will start at the root resource.  If the first character
    of the path string is *not* the ``/`` character, the path is
    considered relative and resource tree traversal will begin at the resource
    object supplied to the function as the ``resource`` argument.  If an
    empty string is passed as ``path``, the ``resource`` passed in will
    be returned.  Resource path strings must be escaped in the following
    manner: each Unicode path segment must be encoded as UTF-8 and as
    each path segment must escaped via Python's :mod:`urllib.quote`.
    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or
    ``to%20the/La%20Pe%C3%B1a`` (relative).  The
    :func:`pyramid.traversal.resource_path` function generates strings
    which follow these rules (albeit only absolute ones).

    Rules for passing *text* (Unicode) as the ``path`` argument are the same
    as those for a string.  In particular, the text may not have any nonascii
    characters in it.

    Rules for passing a *tuple* as the ``path`` argument: if the first
    element in the path tuple is the empty string (for example ``('',
    'a', 'b', 'c')``, the path is considered absolute and the resource tree
    traversal will start at the resource tree root object.  If the first
    element in the path tuple is not the empty string (for example
    ``('a', 'b', 'c')``), the path is considered relative and resource tree
    traversal will begin at the resource object supplied to the function
    as the ``resource`` argument.  If an empty sequence is passed as
    ``path``, the ``resource`` passed in itself will be returned.  No
    URL-quoting or UTF-8-encoding of individual path segments within
    the tuple is required (each segment may be any string or unicode
    object representing a resource name).  Resource path tuples generated by
    :func:`pyramid.traversal.resource_path_tuple` can always be
    resolved by ``find_resource``.

    .. note:: For backwards compatibility purposes, this function can also
       be imported as :func:`pyramid.traversal.find_model`, although doing so
       will emit a deprecation warning.
    """
    if isinstance(path, text_type):
        path = ascii_native_(path)
    D = traverse(resource, path)
    view_name = D['view_name']
    context = D['context']
    if view_name:
        raise KeyError('%r has no subelement %s' % (context, view_name))
    return context

find_model = find_resource # b/w compat (forever)

def find_interface(resource, class_or_interface):
    """
    Return the first resource found in the :term:`lineage` of ``resource``
    which, a) if ``class_or_interface`` is a Python class object, is an
    instance of the class or any subclass of that class or b) if
    ``class_or_interface`` is a :term:`interface`, provides the specified
    interface.  Return ``None`` if no resource providing ``interface_or_class``
    can be found in the lineage.  The ``resource`` passed in *must* be
    :term:`location`-aware.
    """
    if IInterface.providedBy(class_or_interface):
        test = class_or_interface.providedBy
    else:
        test = lambda arg: isinstance(arg, class_or_interface)
    for location in lineage(resource):
        if test(location):
            return location

def resource_path(resource, *elements):
    """ Return a string object representing the absolute physical path of the
    resource object based on its position in the resource tree, e.g
    ``/foo/bar``.  Any positional arguments passed in as ``elements`` will be
    appended as path segments to the end of the resource path.  For instance,
    if the resource's path is ``/foo/bar`` and ``elements`` equals ``('a',
    'b')``, the returned string will be ``/foo/bar/a/b``.  The first
    character in the string will always be the ``/`` character (a leading
    ``/`` character in a path string represents that the path is absolute).

    Resource path strings returned will be escaped in the following
    manner: each unicode path segment will be encoded as UTF-8 and
    each path segment will be escaped via Python's :mod:`urllib.quote`.
    For example, ``/path/to%20the/La%20Pe%C3%B1a``.

    This function is a logical inverse of
    :mod:`pyramid.traversal.find_resource`: it can be used to generate
    path references that can later be resolved via that function.

    The ``resource`` passed in *must* be :term:`location`-aware.

    .. note::

       Each segment in the path string returned will use the ``__name__``
       attribute of the resource it represents within the resource tree.  Each
       of these segments *should* be a unicode or string object (as per the
       contract of :term:`location`-awareness).  However, no conversion or
       safety checking of resource names is performed.  For instance, if one of
       the resources in your tree has a ``__name__`` which (by error) is a
       dictionary, the :func:`pyramid.traversal.resource_path` function will
       attempt to append it to a string and it will cause a
       :exc:`pyramid.exceptions.URLDecodeError`.

    .. note::

       The :term:`root` resource *must* have a ``__name__`` attribute with a
       value of either ``None`` or the empty string for paths to be generated
       properly.  If the root resource has a non-null ``__name__`` attribute,
       its name will be prepended to the generated path rather than a single
       leading '/' character.

    .. note::

       For backwards compatibility purposes, this function can also
       be imported as ``model_path``, although doing so will cause
       a deprecation warning to be emitted.
    """
    # joining strings is a bit expensive so we delegate to a function
    # which caches the joined result for us
    return _join_path_tuple(resource_path_tuple(resource, *elements))

model_path = resource_path # b/w compat (forever)

def traverse(resource, path):
    """Given a resource object as ``resource`` and a string or tuple
    representing a path as ``path`` (such as the return value of
    :func:`pyramid.traversal.resource_path` or
    :func:`pyramid.traversal.resource_path_tuple` or the value of
    ``request.environ['PATH_INFO']``), return a dictionary with the
    keys ``context``, ``root``, ``view_name``, ``subpath``,
    ``traversed``, ``virtual_root``, and ``virtual_root_path``.

    A definition of each value in the returned dictionary:

    - ``context``: The :term:`context` (a :term:`resource` object) found
      via traversal or url dispatch.  If the ``path`` passed in is the
      empty string, the value of the ``resource`` argument passed to this
      function is returned.

    - ``root``: The resource object at which :term:`traversal` begins.
      If the ``resource`` passed in was found via url dispatch or if the
      ``path`` passed in was relative (non-absolute), the value of the
      ``resource`` argument passed to this function is returned.

    - ``view_name``: The :term:`view name` found during
      :term:`traversal` or :term:`url dispatch`; if the ``resource`` was
      found via traversal, this is usually a representation of the
      path segment which directly follows the path to the ``context``
      in the ``path``.  The ``view_name`` will be a Unicode object or
      the empty string.  The ``view_name`` will be the empty string if
      there is no element which follows the ``context`` path.  An
      example: if the path passed is ``/foo/bar``, and a resource
      object is found at ``/foo`` (but not at ``/foo/bar``), the 'view
      name' will be ``u'bar'``.  If the ``resource`` was found via
      urldispatch, the view_name will be the name the route found was
      registered with.

    - ``subpath``: For a ``resource`` found via :term:`traversal`, this
      is a sequence of path segments found in the ``path`` that follow
      the ``view_name`` (if any).  Each of these items is a Unicode
      object.  If no path segments follow the ``view_name``, the
      subpath will be the empty sequence.  An example: if the path
      passed is ``/foo/bar/baz/buz``, and a resource object is found at
      ``/foo`` (but not ``/foo/bar``), the 'view name' will be
      ``u'bar'`` and the :term:`subpath` will be ``[u'baz', u'buz']``.
      For a ``resource`` found via url dispatch, the subpath will be a
      sequence of values discerned from ``*subpath`` in the route
      pattern matched or the empty sequence.

    - ``traversed``: The sequence of path elements traversed from the
      root to find the ``context`` object during :term:`traversal`.
      Each of these items is a Unicode object.  If no path segments
      were traversed to find the ``context`` object (e.g. if the
      ``path`` provided is the empty string), the ``traversed`` value
      will be the empty sequence.  If the ``resource`` is a resource found
      via :term:`url dispatch`, traversed will be None.

    - ``virtual_root``: A resource object representing the 'virtual' root
      of the resource tree being traversed during :term:`traversal`.
      See :ref:`vhosting_chapter` for a definition of the virtual root
      object.  If no virtual hosting is in effect, and the ``path``
      passed in was absolute, the ``virtual_root`` will be the
      *physical* root resource object (the object at which :term:`traversal`
      begins).  If the ``resource`` passed in was found via :term:`URL
      dispatch` or if the ``path`` passed in was relative, the
      ``virtual_root`` will always equal the ``root`` object (the
      resource passed in).

    - ``virtual_root_path`` -- If :term:`traversal` was used to find
      the ``resource``, this will be the sequence of path elements
      traversed to find the ``virtual_root`` resource.  Each of these
      items is a Unicode object.  If no path segments were traversed
      to find the ``virtual_root`` resource (e.g. if virtual hosting is
      not in effect), the ``traversed`` value will be the empty list.
      If url dispatch was used to find the ``resource``, this will be
      ``None``.

    If the path cannot be resolved, a :exc:`KeyError` will be raised.

    Rules for passing a *string* as the ``path`` argument: if the
    first character in the path string is the with the ``/``
    character, the path will considered absolute and the resource tree
    traversal will start at the root resource.  If the first character
    of the path string is *not* the ``/`` character, the path is
    considered relative and resource tree traversal will begin at the resource
    object supplied to the function as the ``resource`` argument.  If an
    empty string is passed as ``path``, the ``resource`` passed in will
    be returned.  Resource path strings must be escaped in the following
    manner: each Unicode path segment must be encoded as UTF-8 and
    each path segment must escaped via Python's :mod:`urllib.quote`.
    For example, ``/path/to%20the/La%20Pe%C3%B1a`` (absolute) or
    ``to%20the/La%20Pe%C3%B1a`` (relative).  The
    :func:`pyramid.traversal.resource_path` function generates strings
    which follow these rules (albeit only absolute ones).

    Rules for passing a *tuple* as the ``path`` argument: if the first
    element in the path tuple is the empty string (for example ``('',
    'a', 'b', 'c')``, the path is considered absolute and the resource tree
    traversal will start at the resource tree root object.  If the first
    element in the path tuple is not the empty string (for example
    ``('a', 'b', 'c')``), the path is considered relative and resource tree
    traversal will begin at the resource object supplied to the function
    as the ``resource`` argument.  If an empty sequence is passed as
    ``path``, the ``resource`` passed in itself will be returned.  No
    URL-quoting or UTF-8-encoding of individual path segments within
    the tuple is required (each segment may be any string or unicode
    object representing a resource name).

    Explanation of the conversion of ``path`` segment values to
    Unicode during traversal: Each segment is URL-unquoted, and
    decoded into Unicode. Each segment is assumed to be encoded using
    the UTF-8 encoding (or a subset, such as ASCII); a
    :exc:`pyramid.exceptions.URLDecodeError` is raised if a segment
    cannot be decoded.  If a segment name is empty or if it is ``.``,
    it is ignored.  If a segment name is ``..``, the previous segment
    is deleted, and the ``..`` is ignored.  As a result of this
    process, the return values ``view_name``, each element in the
    ``subpath``, each element in ``traversed``, and each element in
    the ``virtual_root_path`` will be Unicode as opposed to a string,
    and will be URL-decoded.
    """

    if is_nonstr_iter(path):
        # the traverser factory expects PATH_INFO to be a string, not
        # unicode and it expects path segments to be utf-8 and
        # urlencoded (it's the same traverser which accepts PATH_INFO
        # from user agents; user agents always send strings).
        if path:
            path = _join_path_tuple(tuple(path))
        else:
            path = ''

    # The user is supposed to pass us a string object, never Unicode.  In
    # practice, however, users indeed pass Unicode to this API.  If they do
    # pass a Unicode object, its data *must* be entirely encodeable to ASCII,
    # so we encode it here as a convenience to the user and to prevent
    # second-order failures from cropping up (all failures will occur at this
    # step rather than later down the line as the result of calling
    # ``traversal_path``).

    path = ascii_native_(path)

    if path and path[0] == '/':
        resource = find_root(resource)

    reg = get_current_registry()

    request_factory = reg.queryUtility(IRequestFactory)
    if request_factory is None:
        from pyramid.request import Request # avoid circdep
        request_factory = Request

    request = request_factory.blank(path)
    request.registry = reg
    traverser = reg.queryAdapter(resource, ITraverser)
    if traverser is None:
        traverser = ResourceTreeTraverser(resource)

    return traverser(request)

def resource_path_tuple(resource, *elements):
    """
    Return a tuple representing the absolute physical path of the
    ``resource`` object based on its position in a resource tree, e.g
    ``('', 'foo', 'bar')``.  Any positional arguments passed in as
    ``elements`` will be appended as elements in the tuple
    representing the resource path.  For instance, if the resource's
    path is ``('', 'foo', 'bar')`` and elements equals ``('a', 'b')``,
    the returned tuple will be ``('', 'foo', 'bar', 'a', 'b')``.  The
    first element of this tuple will always be the empty string (a
    leading empty string element in a path tuple represents that the
    path is absolute).

    This function is a logical inverse of
    :func:`pyramid.traversal.find_resource`: it can be used to
    generate path references that can later be resolved by that function.

    The ``resource`` passed in *must* be :term:`location`-aware.

    .. note::

       Each segment in the path tuple returned will equal the ``__name__``
       attribute of the resource it represents within the resource tree.  Each
       of these segments *should* be a unicode or string object (as per the
       contract of :term:`location`-awareness).  However, no conversion or
       safety checking of resource names is performed.  For instance, if one of
       the resources in your tree has a ``__name__`` which (by error) is a
       dictionary, that dictionary will be placed in the path tuple; no warning
       or error will be given.

    .. note::

       The :term:`root` resource *must* have a ``__name__`` attribute with a
       value of either ``None`` or the empty string for path tuples to be
       generated properly.  If the root resource has a non-null ``__name__``
       attribute, its name will be the first element in the generated path tuple
       rather than the empty string.

    .. note::

       For backwards compatibility purposes, this function can also be imported
       as ``model_path_tuple``, although doing so will cause a deprecation
       warning to be emitted.
    """
    return tuple(_resource_path_list(resource, *elements))

model_path_tuple = resource_path_tuple  # b/w compat (forever)

def _resource_path_list(resource, *elements):
    """ Implementation detail shared by resource_path and resource_path_tuple"""
    path = [loc.__name__ or '' for loc in lineage(resource)]
    path.reverse()
    path.extend(elements)
    return path

_model_path_list = _resource_path_list # b/w compat, not an API

def virtual_root(resource, request):
    """
    Provided any :term:`resource` and a :term:`request` object, return
    the resource object representing the :term:`virtual root` of the
    current :term:`request`.  Using a virtual root in a
    :term:`traversal` -based :app:`Pyramid` application permits
    rooting, for example, the resource at the traversal path ``/cms`` at
    ``http://example.com/`` instead of rooting it at
    ``http://example.com/cms/``.

    If the ``resource`` passed in is a context obtained via
    :term:`traversal`, and if the ``HTTP_X_VHM_ROOT`` key is in the
    WSGI environment, the value of this key will be treated as a
    'virtual root path': the :func:`pyramid.traversal.find_resource`
    API will be used to find the virtual root resource using this path;
    if the resource is found, it will be returned.  If the
    ``HTTP_X_VHM_ROOT`` key is not present in the WSGI environment,
    the physical :term:`root` of the resource tree will be returned instead.

    Virtual roots are not useful at all in applications that use
    :term:`URL dispatch`. Contexts obtained via URL dispatch don't
    really support being virtually rooted (each URL dispatch context
    is both its own physical and virtual root).  However if this API
    is called with a ``resource`` argument which is a context obtained
    via URL dispatch, the resource passed in will be returned
    unconditionally."""
    try:
        reg = request.registry
    except AttributeError:
        reg = get_current_registry() # b/c
    urlgenerator = reg.queryMultiAdapter((resource, request), IContextURL)
    if urlgenerator is None:
        urlgenerator = TraversalContextURL(resource, request)
    return urlgenerator.virtual_root()

def traversal_path(path):
    """ Variant of :func:`pyramid.traversal.traversal_path_info` suitable for
    decoding paths that are URL-encoded.

    If this function is passed a Unicode object instead of a sequence of
    bytes as ``path``, that Unicode object *must* directly encodeable to
    ASCII.  For example, u'/foo' will work but u'/<unprintable unicode>' (a
    Unicode object with characters that cannot be encoded to ascii) will
    not. A :exc:`UnicodeEncodeError` will be raised if the Unicode cannot be
    encoded directly to ASCII.
    """
    if isinstance(path, text_type):
        # must not possess characters outside ascii
        path = path.encode('ascii')
    # we unquote this path exactly like a PEP 3333 server would
    path = unquote_bytes_to_wsgi(path) # result will be a native string
    return traversal_path_info(path) # result will be a tuple of unicode

@lru_cache(1000)
def traversal_path_info(path):
    """ Given``path``, return a tuple representing that path which can be
    used to traverse a resource tree.  ``path`` is assumed to be an
    already-URL-decoded ``str`` type as if it had come to us from an upstream
    WSGI server as the ``PATH_INFO`` environ variable.

    The ``path`` is first decoded to from its WSGI representation to Unicode;
    it is decoded differently depending on platform:

    - On Python 2, ``path`` is decoded to Unicode from bytes using the UTF-8
      decoding directly; a :exc:`pyramid.exc.URLDecodeError` is raised if a the
      URL cannot be decoded.

    - On Python 3, as per the PEP 3333 spec, ``path`` is first encoded to
      bytes using the Latin-1 encoding; the resulting set of bytes is
      subsequently decoded to text using the UTF-8 encoding; a
      :exc:`pyramid.exc.URLDecodeError` is raised if a the URL cannot be
      decoded.

    The ``path`` is split on slashes, creating a list of segments.  If a
    segment name is empty or if it is ``.``, it is ignored.  If a segment
    name is ``..``, the previous segment is deleted, and the ``..`` is
    ignored.

    Examples:

    ``/``

        ()

    ``/foo/bar/baz``

        (u'foo', u'bar', u'baz')

    ``foo/bar/baz``

        (u'foo', u'bar', u'baz')

    ``/foo/bar/baz/``

        (u'foo', u'bar', u'baz')

    ``/foo//bar//baz/``

        (u'foo', u'bar', u'baz')

    ``/foo/bar/baz/..``

        (u'foo', u'bar')

    ``/my%20archives/hello``

        (u'my archives', u'hello')

    ``/archives/La%20Pe%C3%B1a``

        (u'archives', u'<unprintable unicode>')

    .. note::

      This function does not generate the same type of tuples that
      :func:`pyramid.traversal.resource_path_tuple` does.  In particular, the
      leading empty string is not present in the tuple it returns, unlike tuples
      returned by :func:`pyramid.traversal.resource_path_tuple`.  As a result,
      tuples generated by ``traversal_path`` are not resolveable by the
      :func:`pyramid.traversal.find_resource` API.  ``traversal_path`` is a
      function mostly used by the internals of :app:`Pyramid` and by people
      writing their own traversal machinery, as opposed to users writing
      applications in :app:`Pyramid`.
    """
    try:
        path = decode_path_info(path) # result will be Unicode
    except UnicodeDecodeError as e:
        raise URLDecodeError(e.encoding, e.object, e.start, e.end, e.reason)
    return split_path_info(path) # result will be tuple of Unicode

@lru_cache(1000)
def split_path_info(path):
    # suitable for splitting an already-unquoted-already-decoded (unicode)
    # path value
    path = path.strip('/')
    clean = []
    for segment in path.split('/'):
        if not segment or segment == '.':
            continue
        elif segment == '..':
            if clean:
                del clean[-1]
        else:
            clean.append(segment)
    return tuple(clean)

_segment_cache = {}

quote_path_segment_doc = """ \
Return a quoted representation of a 'path segment' (such as
the string ``__name__`` attribute of a resource) as a string.  If the
``segment`` passed in is a unicode object, it is converted to a
UTF-8 string, then it is URL-quoted using Python's
``urllib.quote``.  If the ``segment`` passed in is a string, it is
URL-quoted using Python's :mod:`urllib.quote`.  If the segment
passed in is not a string or unicode object, an error will be
raised.  The return value of ``quote_path_segment`` is always a
string, never Unicode.

You may pass a string of characters that need not be encoded as
the ``safe`` argument to this function.  This corresponds to the
``safe`` argument to :mod:`urllib.quote`.

.. note::

   The return value for each segment passed to this
   function is cached in a module-scope dictionary for
   speed: the cached version is returned when possible
   rather than recomputing the quoted version.  No cache
   emptying is ever done for the lifetime of an
   application, however.  If you pass arbitrary
   user-supplied strings to this function (as opposed to
   some bounded set of values from a 'working set' known to
   your application), it may become a memory leak.
"""


if PY3: # pragma: no cover
    # special-case on Python 2 for speed?  unchecked
    def quote_path_segment(segment, safe=''):
        """ %s """ % quote_path_segment_doc
        # The bit of this code that deals with ``_segment_cache`` is an
        # optimization: we cache all the computation of URL path segments
        # in this module-scope dictionary with the original string (or
        # unicode value) as the key, so we can look it up later without
        # needing to reencode or re-url-quote it
        try:
            return _segment_cache[(segment, safe)]
        except KeyError:
            if segment.__class__ not in (text_type, binary_type):
                segment = str(segment)
            result = url_quote(native_(segment, 'utf-8'), safe)
            # we don't need a lock to mutate _segment_cache, as the below
            # will generate exactly one Python bytecode (STORE_SUBSCR)
            _segment_cache[(segment, safe)] = result
            return result
else:
    def quote_path_segment(segment, safe=''):
        """ %s """ % quote_path_segment_doc
        # The bit of this code that deals with ``_segment_cache`` is an
        # optimization: we cache all the computation of URL path segments
        # in this module-scope dictionary with the original string (or
        # unicode value) as the key, so we can look it up later without
        # needing to reencode or re-url-quote it
        try:
            return _segment_cache[(segment, safe)]
        except KeyError:
            if segment.__class__ is text_type: #isinstance slighly slower (~15%)
                result = url_quote(segment.encode('utf-8'), safe)
            else:
                result = url_quote(str(segment), safe)
            # we don't need a lock to mutate _segment_cache, as the below
            # will generate exactly one Python bytecode (STORE_SUBSCR)
            _segment_cache[(segment, safe)] = result
            return result
    
slash = text_('/')

@implementer(ITraverser)
class ResourceTreeTraverser(object):
    """ A resource tree traverser that should be used (for speed) when
    every resource in the tree supplies a ``__name__`` and
    ``__parent__`` attribute (ie. every resource in the tree is
    :term:`location` aware) ."""


    VIEW_SELECTOR = '@@'

    def __init__(self, root):
        self.root = root

    def __call__(self, request):
        environ = request.environ
        matchdict = request.matchdict

        if matchdict is not None:

            path = matchdict.get('traverse', slash) or slash
            if is_nonstr_iter(path):
                # this is a *traverse stararg (not a {traverse})
                # routing has already decoded these elements, so we just
                # need to join them
                path = '/' + slash.join(path) or slash

            subpath = matchdict.get('subpath', ())
            if not is_nonstr_iter(subpath):
                # this is not a *subpath stararg (just a {subpath})
                # routing has already decoded this string, so we just need
                # to split it
                subpath = split_path_info(subpath)

        else:
            # this request did not match a route
            subpath = ()
            try:
                # empty if mounted under a path in mod_wsgi, for example
                path = request.path_info or slash
            except KeyError:
                # if environ['PATH_INFO'] is just not there
                path = slash
            except UnicodeDecodeError as e:
                raise URLDecodeError(e.encoding, e.object, e.start, e.end,
                                     e.reason)

        if VH_ROOT_KEY in environ:
            # HTTP_X_VHM_ROOT
            vroot_path = decode_path_info(environ[VH_ROOT_KEY]) 
            vroot_tuple = split_path_info(vroot_path)
            vpath = vroot_path + path # both will (must) be unicode or asciistr
            vroot_idx = len(vroot_tuple) -1
        else:
            vroot_tuple = ()
            vpath = path
            vroot_idx = -1

        root = self.root
        ob = vroot = root

        if vpath == slash: # invariant: vpath must not be empty
            # prevent a call to traversal_path if we know it's going
            # to return the empty tuple
            vpath_tuple = ()
        else:
            # we do dead reckoning here via tuple slicing instead of
            # pushing and popping temporary lists for speed purposes
            # and this hurts readability; apologies
            i = 0
            view_selector = self.VIEW_SELECTOR
            vpath_tuple = split_path_info(vpath)
            for segment in vpath_tuple:
                if segment[:2] == view_selector:
                    return {'context':ob,
                            'view_name':segment[2:],
                            'subpath':vpath_tuple[i+1:],
                            'traversed':vpath_tuple[:vroot_idx+i+1],
                            'virtual_root':vroot,
                            'virtual_root_path':vroot_tuple,
                            'root':root}
                try:
                    getitem = ob.__getitem__
                except AttributeError:
                    return {'context':ob,
                            'view_name':segment,
                            'subpath':vpath_tuple[i+1:],
                            'traversed':vpath_tuple[:vroot_idx+i+1],
                            'virtual_root':vroot,
                            'virtual_root_path':vroot_tuple,
                            'root':root}

                try:
                    next = getitem(segment)
                except KeyError:
                    return {'context':ob,
                            'view_name':segment,
                            'subpath':vpath_tuple[i+1:],
                            'traversed':vpath_tuple[:vroot_idx+i+1],
                            'virtual_root':vroot,
                            'virtual_root_path':vroot_tuple,
                            'root':root}
                if i == vroot_idx:
                    vroot = next
                ob = next
                i += 1

        return {'context':ob, 'view_name':empty, 'subpath':subpath,
                'traversed':vpath_tuple, 'virtual_root':vroot,
                'virtual_root_path':vroot_tuple, 'root':root}

ModelGraphTraverser = ResourceTreeTraverser # b/w compat, not API, used in wild

@implementer(IResourceURL, IContextURL)
class ResourceURL(object):
    vroot_varname = VH_ROOT_KEY

    def __init__(self, resource, request):
        physical_path_tuple = resource_path_tuple(resource)
        physical_path = _join_path_tuple(physical_path_tuple)

        if physical_path_tuple != ('',):
            physical_path_tuple = physical_path_tuple + ('',)
            physical_path = physical_path + '/'

        virtual_path = physical_path
        virtual_path_tuple = physical_path_tuple

        environ = request.environ
        vroot_path = environ.get(self.vroot_varname)

        # if the physical path starts with the virtual root path, trim it out
        # of the virtual path
        if vroot_path is not None:
            vroot_path = vroot_path.rstrip('/')
            if vroot_path and physical_path.startswith(vroot_path):
                vroot_path_tuple = tuple(vroot_path.split('/'))
                numels = len(vroot_path_tuple)
                virtual_path_tuple = ('',) + physical_path_tuple[numels:]
                virtual_path = physical_path[len(vroot_path):]

        self.virtual_path = virtual_path    # IResourceURL attr
        self.physical_path = physical_path  # IResourceURL attr
        self.virtual_path_tuple = virtual_path_tuple # IResourceURL attr (1.5)
        self.physical_path_tuple = physical_path_tuple # IResourceURL attr (1.5)

        # bw compat for IContextURL methods
        self.resource = resource
        self.context = resource
        self.request = request

    # IContextURL method (deprecated in 1.3)
    def virtual_root(self):
        environ = self.request.environ
        vroot_varname = self.vroot_varname
        if vroot_varname in environ:
            return find_resource(self.context, environ[vroot_varname])
        # shortcut instead of using find_root; we probably already
        # have it on the request
        try:
            return self.request.root
        except AttributeError:
            return find_root(self.context)

    # IContextURL method (deprecated in 1.3)
    def __call__(self):
        """ Generate a URL based on the :term:`lineage` of a :term:`resource`
        object that is ``self.context``.  If any resource in the context
        lineage has a Unicode name, it will be converted to a UTF-8 string
        before being attached to the URL.  If a ``HTTP_X_VHM_ROOT`` key is
        present in the WSGI environment, its value will be treated as a
        'virtual root path': the path of the URL generated by this will be
        left-stripped of this virtual root path value.
        """
        local_url = getattr(self.context, '__resource_url__', None)
        if local_url is not None:
            result = local_url(
                self.request,
                {'virtual_path':self.virtual_path,
                 'physical_path':self.physical_path},
                )
            if result is not None:
                # allow it to punt by returning ``None``
                return result

        app_url = self.request.application_url # never ends in a slash
        return app_url + self.virtual_path

TraversalContextURL = ResourceURL # deprecated as of 1.3

deprecated(
    'TraversalContextURL',
    'As of Pyramid 1.3 the, "pyramid.traversal.TraversalContextURL" class is '
    'scheduled to be removed.   Use the '
    '"pyramid.config.Configurator.add_resource_url_adapter" method to register '
    'a class that implements "pyramid.interfaces.IResourceURL" instead. '
    'See the "What\'s new In Pyramid 1.3" document for a further description.'
    )

@lru_cache(1000)
def _join_path_tuple(tuple):
    return tuple and '/'.join([quote_path_segment(x) for x in tuple]) or '/'

class DefaultRootFactory:
    __parent__ = None
    __name__ = None
    def __init__(self, request):
        matchdict = request.matchdict
        # provide backwards compatibility for applications which
        # used routes (at least apps without any custom "context
        # factory") in BFG 0.9.X and before
        if matchdict is not None:
            self.__dict__.update(matchdict)

```
--- 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