Michael Merickel
2018-10-15 dd3cc81f75dcb5ff96e0751653071722a15f46c2
fix the tests to import from the tests package instead of pyramid.tests
45 files modified
1030 ■■■■ changed files
tests/fixtures/dummy.ini 2 ●●● patch | view | raw | blame | history
tests/pkgs/conflictapp/__init__.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/defpermbugapp/__init__.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/eventonly/__init__.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/forbiddenview/__init__.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/includeapp1/root.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/includeapp1/three.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/includeapp1/two.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/notfoundview/__init__.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/static_assetspec/__init__.py 2 ●●● patch | view | raw | blame | history
tests/pkgs/static_routeprefix/__init__.py 4 ●●●● patch | view | raw | blame | history
tests/pkgs/staticpermapp/__init__.py 6 ●●●● patch | view | raw | blame | history
tests/pkgs/viewdecoratorapp/__init__.py 2 ●●● patch | view | raw | blame | history
tests/test_asset.py 20 ●●●● patch | view | raw | blame | history
tests/test_authentication.py 30 ●●●● patch | view | raw | blame | history
tests/test_config/test_adapters.py 18 ●●●● patch | view | raw | blame | history
tests/test_config/test_assets.py 134 ●●●● patch | view | raw | blame | history
tests/test_config/test_factories.py 10 ●●●● patch | view | raw | blame | history
tests/test_config/test_i18n.py 44 ●●●● patch | view | raw | blame | history
tests/test_config/test_init.py 169 ●●●● patch | view | raw | blame | history
tests/test_config/test_rendering.py 6 ●●●● patch | view | raw | blame | history
tests/test_config/test_routes.py 6 ●●●● patch | view | raw | blame | history
tests/test_config/test_testing.py 4 ●●●● patch | view | raw | blame | history
tests/test_config/test_tweens.py 46 ●●●● patch | view | raw | blame | history
tests/test_config/test_views.py 60 ●●●● patch | view | raw | blame | history
tests/test_csrf.py 6 ●●●● patch | view | raw | blame | history
tests/test_integration.py 53 ●●●● patch | view | raw | blame | history
tests/test_paster.py 2 ●●● patch | view | raw | blame | history
tests/test_path.py 161 ●●●● patch | view | raw | blame | history
tests/test_registry.py 2 ●●● patch | view | raw | blame | history
tests/test_renderers.py 28 ●●●● patch | view | raw | blame | history
tests/test_scaffolds/test_copydir.py 9 ●●●●● patch | view | raw | blame | history
tests/test_scripts/test_prequest.py 2 ●●● patch | view | raw | blame | history
tests/test_scripts/test_proutes.py 28 ●●●● patch | view | raw | blame | history
tests/test_scripts/test_pserve.py 4 ●●●● patch | view | raw | blame | history
tests/test_scripts/test_pshell.py 2 ●●● patch | view | raw | blame | history
tests/test_scripts/test_ptweens.py 2 ●●● patch | view | raw | blame | history
tests/test_scripts/test_pviews.py 24 ●●●● patch | view | raw | blame | history
tests/test_session.py 2 ●●● patch | view | raw | blame | history
tests/test_static.py 64 ●●●● patch | view | raw | blame | history
tests/test_testing.py 2 ●●● patch | view | raw | blame | history
tests/test_url.py 22 ●●●● patch | view | raw | blame | history
tests/test_util.py 14 ●●●● patch | view | raw | blame | history
tests/test_view.py 14 ●●●● patch | view | raw | blame | history
tests/test_viewderivers.py 10 ●●●● patch | view | raw | blame | history
tests/fixtures/dummy.ini
@@ -1,4 +1,4 @@
[app:myapp]
use = call:pyramid.tests.test_paster:make_dummyapp
use = call:tests.test_paster:make_dummyapp
foo = %(bar)s
tests/pkgs/conflictapp/__init__.py
@@ -21,4 +21,4 @@
    config.set_authentication_policy(AuthTktAuthenticationPolicy(
        'seekri1t', hashalg='sha512'))
    config.set_authorization_policy(ACLAuthorizationPolicy())
    config.include('pyramid.tests.pkgs.conflictapp.included')
    config.include('tests.pkgs.conflictapp.included')
tests/pkgs/defpermbugapp/__init__.py
@@ -19,7 +19,7 @@
     from pyramid.authentication import AuthTktAuthenticationPolicy
     authn_policy = AuthTktAuthenticationPolicy('seekt1t', hashalg='sha512')
     authz_policy = ACLAuthorizationPolicy()
     config.scan('pyramid.tests.pkgs.defpermbugapp')
     config.scan('tests.pkgs.defpermbugapp')
     config._set_authentication_policy(authn_policy)
     config._set_authorization_policy(authz_policy)
     config.set_default_permission('private')
tests/pkgs/eventonly/__init__.py
@@ -60,5 +60,5 @@
def includeme(config):
    config.add_subscriber_predicate('yup', Yup)
    config.scan('pyramid.tests.pkgs.eventonly')
    config.scan('tests.pkgs.eventonly')
    
tests/pkgs/forbiddenview/__init__.py
@@ -27,5 +27,5 @@
    config.set_default_permission('a')
    config.add_route('foo', '/foo')
    config.add_route('bar', '/bar')
    config.scan('pyramid.tests.pkgs.forbiddenview')
    config.scan('tests.pkgs.forbiddenview')
    
tests/pkgs/includeapp1/root.py
@@ -5,6 +5,6 @@
def configure(config):
    config.add_view(aview)
    config.include('pyramid.tests.pkgs.includeapp1.two.configure')
    config.include('tests.pkgs.includeapp1.two.configure')
    config.commit()
    
tests/pkgs/includeapp1/three.py
@@ -5,6 +5,6 @@
def configure(config):
    config.add_view(aview, name='three')
    config.include('pyramid.tests.pkgs.includeapp1.two.configure') # should not cycle
    config.include('tests.pkgs.includeapp1.two.configure') # should not cycle
    config.add_view(aview) # will be overridden by root when resolved
    
tests/pkgs/includeapp1/two.py
@@ -5,5 +5,5 @@
def configure(config):
    config.add_view(aview, name='two')
    config.include('pyramid.tests.pkgs.includeapp1.three.configure')
    config.include('tests.pkgs.includeapp1.three.configure')
    config.add_view(aview) # will be overridden by root when resolved
tests/pkgs/notfoundview/__init__.py
@@ -26,5 +26,5 @@
    config.add_route('foo2', '/foo/')
    config.add_route('bar', '/bar/')
    config.add_route('baz', '/baz')
    config.scan('pyramid.tests.pkgs.notfoundview')
    config.scan('tests.pkgs.notfoundview')
    
tests/pkgs/static_assetspec/__init__.py
@@ -1,3 +1,3 @@
def includeme(config):
    config.add_static_view('/', 'pyramid.tests:fixtures')
    config.add_static_view('/', 'tests:fixtures')
tests/pkgs/static_routeprefix/__init__.py
@@ -1,7 +1,7 @@
def includeme(config):
    config.add_static_view('/static', 'pyramid.tests:fixtures')
    config.add_static_view('/static', 'tests:fixtures')
    config.include(includeme2, route_prefix='/prefix')
def includeme2(config):
    config.add_static_view('/static', 'pyramid.tests:fixtures/static')
    config.add_static_view('/static', 'tests:fixtures/static')
tests/pkgs/staticpermapp/__init__.py
@@ -16,10 +16,10 @@
     authz_policy = ACLAuthorizationPolicy()
     config._set_authentication_policy(authn_policy)
     config._set_authorization_policy(authz_policy)
     config.add_static_view('allowed', 'pyramid.tests:fixtures/static/')
     config.add_static_view('protected', 'pyramid.tests:fixtures/static/',
     config.add_static_view('allowed', 'tests:fixtures/static/')
     config.add_static_view('protected', 'tests:fixtures/static/',
                            permission='view')
     config.add_static_view('factory_protected',
                            'pyramid.tests:fixtures/static/',
                            'tests:fixtures/static/',
                            permission='view',
                            factory=LocalRootFactory)
tests/pkgs/viewdecoratorapp/__init__.py
@@ -1,3 +1,3 @@
def includeme(config):
    config.scan('pyramid.tests.pkgs.viewdecoratorapp')
    config.scan('tests.pkgs.viewdecoratorapp')
    
tests/test_asset.py
@@ -14,14 +14,14 @@
        self.assertEqual(package_name, None)
    def test_rel_spec(self):
        pkg = 'pyramid.tests'
        pkg = 'tests'
        path = 'test_asset.py'
        package_name, filename = self._callFUT(path, pkg)
        self.assertEqual(package_name, 'pyramid.tests')
        self.assertEqual(package_name, 'tests')
        self.assertEqual(filename, 'test_asset.py')
        
    def test_abs_spec(self):
        pkg = 'pyramid.tests'
        pkg = 'tests'
        path = 'pyramid.nottests:test_asset.py'
        package_name, filename = self._callFUT(path, pkg)
        self.assertEqual(package_name, 'pyramid.nottests')
@@ -35,11 +35,11 @@
        self.assertEqual(filename, 'test_asset.py')
    def test_package_name_is_package_object(self):
        import pyramid.tests
        pkg = pyramid.tests
        import tests
        pkg = tests
        path = 'test_asset.py'
        package_name, filename = self._callFUT(path, pkg)
        self.assertEqual(package_name, 'pyramid.tests')
        self.assertEqual(package_name, 'tests')
        self.assertEqual(filename, 'test_asset.py')
@@ -57,7 +57,7 @@
        self.assertEqual(result, '/abc')
    def test_pkgrelative(self):
        result = self._callFUT('abc', 'pyramid.tests')
        result = self._callFUT('abc', 'tests')
        self.assertEqual(result, os.path.join(here, 'abc'))
class Test_asset_spec_from_abspath(unittest.TestCase):
@@ -72,13 +72,13 @@
    def test_abspath_startswith_package_path(self):
        abspath = os.path.join(here, 'fixtureapp')
        pkg = DummyPackage('pyramid.tests')
        pkg = DummyPackage('tests')
        pkg.__file__ = 'file'
        result = self._callFUT(abspath, pkg)
        self.assertEqual(result, 'pyramid:fixtureapp')
        self.assertEqual(result, 'tests:fixtureapp')
    def test_abspath_doesnt_startwith_package_path(self):
        pkg = DummyPackage('pyramid.tests')
        pkg = DummyPackage('tests')
        result = self._callFUT(here, pkg)
        self.assertEqual(result, here)
tests/test_authentication.py
@@ -36,7 +36,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            'pyramid.tests.test_authentication.MyAuthenticationPolicy.'
            'tests.test_authentication.MyAuthenticationPolicy.'
            'authenticated_userid: call to unauthenticated_userid returned '
            'None; returning None')
@@ -47,7 +47,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
             "pyramid.tests.test_authentication.MyAuthenticationPolicy."
             "tests.test_authentication.MyAuthenticationPolicy."
            "authenticated_userid: there was no groupfinder callback; "
            "returning 'fred'")
@@ -60,7 +60,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            'pyramid.tests.test_authentication.MyAuthenticationPolicy.'
            'tests.test_authentication.MyAuthenticationPolicy.'
            'authenticated_userid: groupfinder callback returned None; '
            'returning None')
@@ -73,7 +73,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "authenticated_userid: groupfinder callback returned []; "
            "returning 'fred'")
@@ -84,7 +84,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "authenticated_userid: use of userid 'system.Authenticated' is "
            "disallowed by any built-in Pyramid security policy, returning "
            "None")
@@ -96,7 +96,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "authenticated_userid: use of userid 'system.Everyone' is "
            "disallowed by any built-in Pyramid security policy, returning "
            "None")
@@ -109,7 +109,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "effective_principals: unauthenticated_userid returned None; "
            "returning ['system.Everyone']")
@@ -122,12 +122,12 @@
        self.assertEqual(len(self.messages), 2)
        self.assertEqual(
            self.messages[0],
            'pyramid.tests.test_authentication.MyAuthenticationPolicy.'
            'tests.test_authentication.MyAuthenticationPolicy.'
            'effective_principals: groupfinder callback is None, so groups '
            'is []')
        self.assertEqual(
            self.messages[1],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "effective_principals: returning effective principals: "
            "['system.Everyone', 'system.Authenticated', 'fred']")
@@ -141,12 +141,12 @@
        self.assertEqual(len(self.messages), 2)
        self.assertEqual(
            self.messages[0],
            'pyramid.tests.test_authentication.MyAuthenticationPolicy.'
            'tests.test_authentication.MyAuthenticationPolicy.'
            'effective_principals: groupfinder callback returned None as '
            'groups')
        self.assertEqual(
            self.messages[1],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "effective_principals: returning effective principals: "
            "['system.Everyone']")
@@ -161,11 +161,11 @@
        self.assertEqual(len(self.messages), 2)
        self.assertEqual(
            self.messages[0],
            'pyramid.tests.test_authentication.MyAuthenticationPolicy.'
            'tests.test_authentication.MyAuthenticationPolicy.'
            'effective_principals: groupfinder callback returned [] as groups')
        self.assertEqual(
            self.messages[1],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "effective_principals: returning effective principals: "
            "['system.Everyone', 'system.Authenticated', 'fred']")
@@ -178,7 +178,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "effective_principals: unauthenticated_userid returned disallowed "
            "'system.Authenticated'; returning ['system.Everyone'] as if it "
            "was None")
@@ -192,7 +192,7 @@
        self.assertEqual(len(self.messages), 1)
        self.assertEqual(
            self.messages[0],
            "pyramid.tests.test_authentication.MyAuthenticationPolicy."
            "tests.test_authentication.MyAuthenticationPolicy."
            "effective_principals: unauthenticated_userid returned disallowed "
            "'system.Everyone'; returning ['system.Everyone'] as if it "
            "was None")
tests/test_config/test_adapters.py
@@ -1,7 +1,7 @@
import unittest
from pyramid.compat import PY2
from pyramid.tests.test_config import IDummy
from . import IDummy
class AdaptersConfiguratorMixinTests(unittest.TestCase):
    def _makeOne(self, *arg, **kw):
@@ -50,15 +50,15 @@
        self.assertEqual(len(L), 1)
    def test_add_subscriber_dottednames(self):
        import pyramid.tests.test_config
        import tests.test_config
        from pyramid.interfaces import INewRequest
        config = self._makeOne(autocommit=True)
        config.add_subscriber('pyramid.tests.test_config',
        config.add_subscriber('tests.test_config',
                              'pyramid.interfaces.INewRequest')
        handlers = list(config.registry.registeredHandlers())
        self.assertEqual(len(handlers), 1)
        handler = handlers[0]
        self.assertEqual(handler.handler, pyramid.tests.test_config)
        self.assertEqual(handler.handler, tests.test_config)
        self.assertEqual(handler.required, (INewRequest,))
    def test_add_object_event_subscriber(self):
@@ -231,8 +231,8 @@
        from pyramid.interfaces import ITraverser
        config = self._makeOne(autocommit=True)
        config.add_traverser(
            'pyramid.tests.test_config.test_adapters.DummyTraverser',
            'pyramid.tests.test_config.test_adapters.DummyIface')
            'tests.test_config.test_adapters.DummyTraverser',
            'tests.test_config.test_adapters.DummyIface')
        iface = DummyIface()
        traverser = config.registry.getAdapter(iface, ITraverser)
        self.assertEqual(traverser.__class__, DummyTraverser)
@@ -273,8 +273,8 @@
        from pyramid.interfaces import IResourceURL
        config = self._makeOne(autocommit=True)
        config.add_resource_url_adapter(
            'pyramid.tests.test_config.test_adapters.DummyResourceURL',
            'pyramid.tests.test_config.test_adapters.DummyIface',
            'tests.test_config.test_adapters.DummyResourceURL',
            'tests.test_config.test_adapters.DummyIface',
            )
        iface = DummyIface()
        adapter = config.registry.getMultiAdapter((iface, iface), 
@@ -326,7 +326,7 @@
        self.assertEqual(
            intr.title,
            "resource url adapter for resource iface "
            "<class 'pyramid.tests.test_config.test_adapters.DummyIface'>"
            "<class 'tests.test_config.test_adapters.DummyIface'>"
            )
        self.assertEqual(intr['adapter'], DummyResourceURL)
        self.assertEqual(intr['resource_iface'], DummyIface)
tests/test_config/test_assets.py
@@ -21,32 +21,32 @@
        config = self._makeOne()
        self.assertRaises(ConfigurationError, config.override_asset,
                          'a:foo/',
                          'pyramid.tests.test_config.pkgs.asset:foo.pt')
                          'tests.test_config.pkgs.asset:foo.pt')
    def test_override_asset_file_with_directory(self):
        from pyramid.exceptions import ConfigurationError
        config = self._makeOne()
        self.assertRaises(ConfigurationError, config.override_asset,
                          'a:foo.pt',
                          'pyramid.tests.test_config.pkgs.asset:templates/')
                          'tests.test_config.pkgs.asset:templates/')
    def test_override_asset_file_with_package(self):
        from pyramid.exceptions import ConfigurationError
        config = self._makeOne()
        self.assertRaises(ConfigurationError, config.override_asset,
                          'a:foo.pt',
                          'pyramid.tests.test_config.pkgs.asset')
                          'tests.test_config.pkgs.asset')
    def test_override_asset_file_with_file(self):
        from pyramid.config.assets import PackageAssetSource
        config = self._makeOne(autocommit=True)
        override = DummyUnderOverride()
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset:templates/foo.pt',
            'pyramid.tests.test_config.pkgs.asset.subpackage:templates/bar.pt',
            'tests.test_config.pkgs.asset:templates/foo.pt',
            'tests.test_config.pkgs.asset.subpackage:templates/bar.pt',
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from pyramid.tests.test_config.pkgs.asset import subpackage
        from tests.test_config.pkgs import asset
        from tests.test_config.pkgs.asset import subpackage
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, 'templates/foo.pt')
        source = override.source
@@ -65,11 +65,11 @@
        config = self._makeOne(autocommit=True)
        override = DummyUnderOverride()
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset',
            'pyramid.tests.test_config.pkgs.asset.subpackage',
            'tests.test_config.pkgs.asset',
            'tests.test_config.pkgs.asset.subpackage',
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from pyramid.tests.test_config.pkgs.asset import subpackage
        from tests.test_config.pkgs import asset
        from tests.test_config.pkgs.asset import subpackage
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, '')
        source = override.source
@@ -88,11 +88,11 @@
        config = self._makeOne(autocommit=True)
        override = DummyUnderOverride()
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset:templates/',
            'pyramid.tests.test_config.pkgs.asset.subpackage:templates/',
            'tests.test_config.pkgs.asset:templates/',
            'tests.test_config.pkgs.asset.subpackage:templates/',
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from pyramid.tests.test_config.pkgs.asset import subpackage
        from tests.test_config.pkgs import asset
        from tests.test_config.pkgs.asset import subpackage
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, 'templates/')
        source = override.source
@@ -111,11 +111,11 @@
        config = self._makeOne(autocommit=True)
        override = DummyUnderOverride()
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset:templates/',
            'pyramid.tests.test_config.pkgs.asset.subpackage',
            'tests.test_config.pkgs.asset:templates/',
            'tests.test_config.pkgs.asset.subpackage',
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from pyramid.tests.test_config.pkgs.asset import subpackage
        from tests.test_config.pkgs import asset
        from tests.test_config.pkgs.asset import subpackage
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, 'templates/')
        source = override.source
@@ -134,11 +134,11 @@
        config = self._makeOne(autocommit=True)
        override = DummyUnderOverride()
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset',
            'pyramid.tests.test_config.pkgs.asset.subpackage:templates/',
            'tests.test_config.pkgs.asset',
            'tests.test_config.pkgs.asset.subpackage:templates/',
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from pyramid.tests.test_config.pkgs.asset import subpackage
        from tests.test_config.pkgs import asset
        from tests.test_config.pkgs.asset import subpackage
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, '')
        source = override.source
@@ -181,10 +181,10 @@
        abspath = os.path.join(here, 'pkgs', 'asset', 'subpackage',
                               'templates', 'bar.pt')
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset:templates/foo.pt',
            'tests.test_config.pkgs.asset:templates/foo.pt',
            abspath,
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from tests.test_config.pkgs import asset
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, 'templates/foo.pt')
        source = override.source
@@ -203,10 +203,10 @@
        override = DummyUnderOverride()
        abspath = os.path.join(here, 'pkgs', 'asset', 'subpackage', 'templates')
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset:templates/',
            'tests.test_config.pkgs.asset:templates/',
            abspath,
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from tests.test_config.pkgs import asset
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, 'templates/')
        source = override.source
@@ -225,10 +225,10 @@
        override = DummyUnderOverride()
        abspath = os.path.join(here, 'pkgs', 'asset', 'subpackage', 'templates')
        config.override_asset(
            'pyramid.tests.test_config.pkgs.asset',
            'tests.test_config.pkgs.asset',
            abspath,
            _override=override)
        from pyramid.tests.test_config.pkgs import asset
        from tests.test_config.pkgs import asset
        self.assertEqual(override.package, asset)
        self.assertEqual(override.path, '')
        source = override.source
@@ -282,7 +282,7 @@
        klass = self._getTargetClass()
        return klass(module)
    def _registerOverrides(self, overrides, name='pyramid.tests.test_config'):
    def _registerOverrides(self, overrides, name='tests.test_config'):
        from pyramid.interfaces import IPackageOverrides
        from pyramid.threadlocal import get_current_registry
        reg = get_current_registry()
@@ -290,38 +290,38 @@
    def test_get_resource_filename_no_overrides(self):
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        expected = os.path.join(here, resource_name)
        result = provider.get_resource_filename(None, resource_name)
        self.assertEqual(result, expected)
    def test_get_resource_stream_no_overrides(self):
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        with provider.get_resource_stream(None, resource_name) as result:
            _assertBody(result.read(), os.path.join(here, resource_name))
    def test_get_resource_string_no_overrides(self):
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.get_resource_string(None, resource_name)
        _assertBody(result, os.path.join(here, resource_name))
    def test_has_resource_no_overrides(self):
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.has_resource(resource_name)
        self.assertEqual(result, True)
    def test_resource_isdir_no_overrides(self):
        file_resource_name = 'test_assets.py'
        directory_resource_name = 'files'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.resource_isdir(file_resource_name)
        self.assertEqual(result, False)
        result = provider.resource_isdir(directory_resource_name)
@@ -329,8 +329,8 @@
    def test_resource_listdir_no_overrides(self):
        resource_name = 'files'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.resource_listdir(resource_name)
        self.assertTrue(result)
@@ -338,8 +338,8 @@
        overrides = DummyOverrides(None)
        self._registerOverrides(overrides)
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        expected = os.path.join(here, resource_name)
        result = provider.get_resource_filename(None, resource_name)
        self.assertEqual(result, expected)
@@ -348,8 +348,8 @@
        overrides = DummyOverrides(None)
        self._registerOverrides(overrides)
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        with provider.get_resource_stream(None, resource_name) as result:
            _assertBody(result.read(), os.path.join(here, resource_name))
@@ -357,8 +357,8 @@
        overrides = DummyOverrides(None)
        self._registerOverrides(overrides)
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.get_resource_string(None, resource_name)
        _assertBody(result, os.path.join(here, resource_name))
@@ -366,8 +366,8 @@
        overrides = DummyOverrides(None)
        self._registerOverrides(overrides)
        resource_name = 'test_assets.py'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.has_resource(resource_name)
        self.assertEqual(result, True)
@@ -375,8 +375,8 @@
        overrides = DummyOverrides(None)
        self._registerOverrides(overrides)
        resource_name = 'files'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.resource_isdir(resource_name)
        self.assertEqual(result, True)
@@ -384,57 +384,57 @@
        overrides = DummyOverrides(None)
        self._registerOverrides(overrides)
        resource_name = 'files'
        import pyramid.tests.test_config
        provider = self._makeOne(pyramid.tests.test_config)
        import tests.test_config
        provider = self._makeOne(tests.test_config)
        result = provider.resource_listdir(resource_name)
        self.assertTrue(result)
    def test_get_resource_filename_override_returns_value(self):
        overrides = DummyOverrides('value')
        import pyramid.tests.test_config
        import tests.test_config
        self._registerOverrides(overrides)
        provider = self._makeOne(pyramid.tests.test_config)
        provider = self._makeOne(tests.test_config)
        result = provider.get_resource_filename(None, 'test_assets.py')
        self.assertEqual(result, 'value')
    def test_get_resource_stream_override_returns_value(self):
        from io import BytesIO
        overrides = DummyOverrides(BytesIO(b'value'))
        import pyramid.tests.test_config
        import tests.test_config
        self._registerOverrides(overrides)
        provider = self._makeOne(pyramid.tests.test_config)
        provider = self._makeOne(tests.test_config)
        with provider.get_resource_stream(None, 'test_assets.py') as stream:
            self.assertEqual(stream.getvalue(), b'value')
    def test_get_resource_string_override_returns_value(self):
        overrides = DummyOverrides('value')
        import pyramid.tests.test_config
        import tests.test_config
        self._registerOverrides(overrides)
        provider = self._makeOne(pyramid.tests.test_config)
        provider = self._makeOne(tests.test_config)
        result = provider.get_resource_string(None, 'test_assets.py')
        self.assertEqual(result, 'value')
    def test_has_resource_override_returns_True(self):
        overrides = DummyOverrides(True)
        import pyramid.tests.test_config
        import tests.test_config
        self._registerOverrides(overrides)
        provider = self._makeOne(pyramid.tests.test_config)
        provider = self._makeOne(tests.test_config)
        result = provider.has_resource('test_assets.py')
        self.assertEqual(result, True)
    def test_resource_isdir_override_returns_False(self):
        overrides = DummyOverrides(False)
        import pyramid.tests.test_config
        import tests.test_config
        self._registerOverrides(overrides)
        provider = self._makeOne(pyramid.tests.test_config)
        provider = self._makeOne(tests.test_config)
        result = provider.resource_isdir('files')
        self.assertEqual(result, False)
    def test_resource_listdir_override_returns_values(self):
        overrides = DummyOverrides(['a'])
        import pyramid.tests.test_config
        import tests.test_config
        self._registerOverrides(overrides)
        provider = self._makeOne(pyramid.tests.test_config)
        provider = self._makeOne(tests.test_config)
        result = provider.resource_listdir('files')
        self.assertEqual(result, ['a'])
@@ -791,7 +791,7 @@
        from pyramid.config.assets import PackageAssetSource
        return PackageAssetSource
    def _makeOne(self, prefix, package='pyramid.tests.test_config'):
    def _makeOne(self, prefix, package='tests.test_config'):
        klass = self._getTargetClass()
        return klass(package, prefix)
tests/test_config/test_factories.py
@@ -1,6 +1,6 @@
import unittest
from pyramid.tests.test_config import dummyfactory
from . import dummyfactory
class TestFactoriesMixin(unittest.TestCase):
    def _makeOne(self, *arg, **kw):
@@ -19,7 +19,7 @@
        from pyramid.interfaces import IRequestFactory
        config = self._makeOne(autocommit=True)
        config.set_request_factory(
            'pyramid.tests.test_config.dummyfactory')
            'tests.test_config.dummyfactory')
        self.assertEqual(config.registry.getUtility(IRequestFactory),
                         dummyfactory)
@@ -34,7 +34,7 @@
        from pyramid.interfaces import IResponseFactory
        config = self._makeOne(autocommit=True)
        config.set_response_factory(
            'pyramid.tests.test_config.dummyfactory')
            'tests.test_config.dummyfactory')
        self.assertEqual(config.registry.getUtility(IResponseFactory),
                         dummyfactory)
@@ -59,7 +59,7 @@
    def test_set_root_factory_dottedname(self):
        from pyramid.interfaces import IRootFactory
        config = self._makeOne()
        config.set_root_factory('pyramid.tests.test_config.dummyfactory')
        config.set_root_factory('tests.test_config.dummyfactory')
        self.assertEqual(config.registry.queryUtility(IRootFactory), None)
        config.commit()
        self.assertEqual(config.registry.getUtility(IRootFactory), dummyfactory)
@@ -76,7 +76,7 @@
    def test_set_session_factory_dottedname(self):
        from pyramid.interfaces import ISessionFactory
        config = self._makeOne()
        config.set_session_factory('pyramid.tests.test_config.dummyfactory')
        config.set_session_factory('tests.test_config.dummyfactory')
        self.assertEqual(config.registry.queryUtility(ISessionFactory), None)
        config.commit()
        self.assertEqual(config.registry.getUtility(ISessionFactory),
tests/test_config/test_i18n.py
@@ -1,7 +1,7 @@
import os
import unittest
from pyramid.tests.test_config import dummyfactory
from . import dummyfactory
here = os.path.dirname(__file__)
locale = os.path.abspath(
@@ -29,7 +29,7 @@
        from pyramid.interfaces import ILocaleNegotiator
        config = self._makeOne(autocommit=True)
        config.set_locale_negotiator(
            'pyramid.tests.test_config.dummyfactory')
            'tests.test_config.dummyfactory')
        self.assertEqual(config.registry.getUtility(ILocaleNegotiator),
                         dummyfactory)
@@ -49,7 +49,7 @@
    def test_add_translation_dirs_asset_spec(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')
        config.add_translation_dirs('tests.pkgs.localeapp:locale')
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale])
@@ -58,33 +58,33 @@
        config = self._makeOne(autocommit=True)
        directories = ['abc']
        config.registry.registerUtility(directories, ITranslationDirectories)
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')
        config.add_translation_dirs('tests.pkgs.localeapp:locale')
        result = config.registry.getUtility(ITranslationDirectories)
        self.assertEqual(result, [locale, 'abc'])
    def test_add_translation_dirs_multiple_specs(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',
                                    'pyramid.tests.pkgs.localeapp:locale2')
        config.add_translation_dirs('tests.pkgs.localeapp:locale',
                                    'tests.pkgs.localeapp:locale2')
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale, locale2])
    def test_add_translation_dirs_multiple_specs_multiple_calls(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',
                                    'pyramid.tests.pkgs.localeapp:locale2')
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale3')
        config.add_translation_dirs('tests.pkgs.localeapp:locale',
                                    'tests.pkgs.localeapp:locale2')
        config.add_translation_dirs('tests.pkgs.localeapp:locale3')
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale3, locale, locale2])
    def test_add_translation_dirs_override_multiple_specs_multiple_calls(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',
                                    'pyramid.tests.pkgs.localeapp:locale2')
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale3',
        config.add_translation_dirs('tests.pkgs.localeapp:locale',
                                    'tests.pkgs.localeapp:locale2')
        config.add_translation_dirs('tests.pkgs.localeapp:locale3',
                                    override=True)
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale, locale2, locale3])
@@ -93,7 +93,7 @@
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        with self.assertRaises(TypeError):
            config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale',
            config.add_translation_dirs('tests.pkgs.localeapp:locale',
                                        foo=1)
    def test_add_translation_dirs_abspath(self):
@@ -106,9 +106,9 @@
    def test_add_translation_dirs_uses_override_out_of_order(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne()
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')
        config.override_asset('pyramid.tests.pkgs.localeapp:locale/',
                              'pyramid.tests.pkgs.localeapp:locale2/')
        config.add_translation_dirs('tests.pkgs.localeapp:locale')
        config.override_asset('tests.pkgs.localeapp:locale/',
                              'tests.pkgs.localeapp:locale2/')
        config.commit()
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale2])
@@ -116,17 +116,17 @@
    def test_add_translation_dirs_doesnt_use_override_w_autocommit(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')
        config.override_asset('pyramid.tests.pkgs.localeapp:locale/',
                              'pyramid.tests.pkgs.localeapp:locale2/')
        config.add_translation_dirs('tests.pkgs.localeapp:locale')
        config.override_asset('tests.pkgs.localeapp:locale/',
                              'tests.pkgs.localeapp:locale2/')
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale])
    def test_add_translation_dirs_uses_override_w_autocommit(self):
        from pyramid.interfaces import ITranslationDirectories
        config = self._makeOne(autocommit=True)
        config.override_asset('pyramid.tests.pkgs.localeapp:locale/',
                              'pyramid.tests.pkgs.localeapp:locale2/')
        config.add_translation_dirs('pyramid.tests.pkgs.localeapp:locale')
        config.override_asset('tests.pkgs.localeapp:locale/',
                              'tests.pkgs.localeapp:locale2/')
        config.add_translation_dirs('tests.pkgs.localeapp:locale')
        self.assertEqual(config.registry.getUtility(ITranslationDirectories),
                         [locale2])
tests/test_config/test_init.py
@@ -5,12 +5,12 @@
from pyramid.compat import im_func
from pyramid.testing import skip_on
from pyramid.tests.test_config import dummy_tween_factory
from pyramid.tests.test_config import dummy_include
from pyramid.tests.test_config import dummy_extend
from pyramid.tests.test_config import dummy_extend2
from pyramid.tests.test_config import IDummy
from pyramid.tests.test_config import DummyContext
from . import dummy_tween_factory
from . import dummy_include
from . import dummy_extend
from . import dummy_extend2
from . import IDummy
from . import DummyContext
from pyramid.exceptions import ConfigurationExecutionError
from pyramid.exceptions import ConfigurationConflictError
@@ -63,7 +63,7 @@
        from pyramid.config import Configurator
        from pyramid.interfaces import IRendererFactory
        config = Configurator()
        this_pkg = sys.modules['pyramid.tests.test_config']
        this_pkg = sys.modules['tests.test_config']
        self.assertTrue(config.registry.getUtility(ISettings))
        self.assertEqual(config.package, this_pkg)
        config.commit()
@@ -178,7 +178,7 @@
        from pyramid.interfaces import IDebugLogger
        config = self._makeOne()
        logger = config.registry.getUtility(IDebugLogger)
        self.assertEqual(logger.name, 'pyramid.tests.test_config')
        self.assertEqual(logger.name, 'tests.test_config')
    def test_ctor_noreg_debug_logger_non_None(self):
        from pyramid.interfaces import IDebugLogger
@@ -294,28 +294,28 @@
        self.assertEqual(result, response)
        
    def test_with_package_module(self):
        from pyramid.tests.test_config import test_init
        import pyramid.tests
        from . import test_init
        config = self._makeOne()
        newconfig = config.with_package(test_init)
        self.assertEqual(newconfig.package, pyramid.tests.test_config)
        import tests.test_config
        self.assertEqual(newconfig.package, tests.test_config)
    def test_with_package_package(self):
        import pyramid.tests.test_config
        from tests import test_config
        config = self._makeOne()
        newconfig = config.with_package(pyramid.tests.test_config)
        self.assertEqual(newconfig.package, pyramid.tests.test_config)
        newconfig = config.with_package(test_config)
        self.assertEqual(newconfig.package, test_config)
    def test_with_package(self):
        import pyramid.tests
        import tests
        config = self._makeOne()
        config.basepath = 'basepath'
        config.info = 'info'
        config.includepath = ('spec',)
        config.autocommit = True
        config.route_prefix = 'prefix'
        newconfig = config.with_package(pyramid.tests)
        self.assertEqual(newconfig.package, pyramid.tests)
        newconfig = config.with_package(tests)
        self.assertEqual(newconfig.package, tests)
        self.assertEqual(newconfig.registry, config.registry)
        self.assertEqual(newconfig.autocommit, True)
        self.assertEqual(newconfig.route_prefix, 'prefix')
@@ -324,38 +324,38 @@
        self.assertEqual(newconfig.includepath, ('spec',))
    def test_maybe_dotted_string_success(self):
        import pyramid.tests.test_config
        import tests.test_config
        config = self._makeOne()
        result = config.maybe_dotted('pyramid.tests.test_config')
        self.assertEqual(result, pyramid.tests.test_config)
        result = config.maybe_dotted('tests.test_config')
        self.assertEqual(result, tests.test_config)
    def test_maybe_dotted_string_fail(self):
        config = self._makeOne()
        self.assertRaises(ImportError, config.maybe_dotted, 'cant.be.found')
    def test_maybe_dotted_notstring_success(self):
        import pyramid.tests.test_config
        import tests.test_config
        config = self._makeOne()
        result = config.maybe_dotted(pyramid.tests.test_config)
        self.assertEqual(result, pyramid.tests.test_config)
        result = config.maybe_dotted(tests.test_config)
        self.assertEqual(result, tests.test_config)
    def test_absolute_asset_spec_already_absolute(self):
        import pyramid.tests.test_config
        config = self._makeOne(package=pyramid.tests.test_config)
        import tests.test_config
        config = self._makeOne(package=tests.test_config)
        result = config.absolute_asset_spec('already:absolute')
        self.assertEqual(result, 'already:absolute')
    def test_absolute_asset_spec_notastring(self):
        import pyramid.tests.test_config
        config = self._makeOne(package=pyramid.tests.test_config)
        import tests.test_config
        config = self._makeOne(package=tests.test_config)
        result = config.absolute_asset_spec(None)
        self.assertEqual(result, None)
    def test_absolute_asset_spec_relative(self):
        import pyramid.tests.test_config
        config = self._makeOne(package=pyramid.tests.test_config)
        import tests.test_config
        config = self._makeOne(package=tests.test_config)
        result = config.absolute_asset_spec('files')
        self.assertEqual(result, 'pyramid.tests.test_config:files')
        self.assertEqual(result, 'tests.test_config:files')
    def test__fix_registry_has_listeners(self):
        reg = DummyRegistry()
@@ -498,7 +498,7 @@
        config = self._makeOne(reg)
        config.setup_registry()
        logger = reg.getUtility(IDebugLogger)
        self.assertEqual(logger.name, 'pyramid.tests.test_config')
        self.assertEqual(logger.name, 'tests.test_config')
    def test_setup_registry_debug_logger_non_None(self):
        from pyramid.registry import Registry
@@ -535,11 +535,11 @@
        from pyramid.interfaces import IAuthenticationPolicy
        reg = Registry()
        config = self._makeOne(reg)
        config.setup_registry(authentication_policy='pyramid.tests.test_config')
        config.setup_registry(authentication_policy='tests.test_config')
        config.commit()
        result = reg.getUtility(IAuthenticationPolicy)
        import pyramid.tests.test_config
        self.assertEqual(result, pyramid.tests.test_config)
        import tests.test_config
        self.assertEqual(result, tests.test_config)
    def test_setup_registry_authorization_policy_dottedname(self):
        from pyramid.registry import Registry
@@ -548,11 +548,11 @@
        config = self._makeOne(reg)
        dummy = object()
        config.setup_registry(authentication_policy=dummy,
                              authorization_policy='pyramid.tests.test_config')
                              authorization_policy='tests.test_config')
        config.commit()
        result = reg.getUtility(IAuthorizationPolicy)
        import pyramid.tests.test_config
        self.assertEqual(result, pyramid.tests.test_config)
        import tests.test_config
        self.assertEqual(result, tests.test_config)
    def test_setup_registry_authorization_policy_only(self):
        from pyramid.registry import Registry
@@ -576,24 +576,23 @@
        from pyramid.interfaces import IRootFactory
        reg = Registry()
        config = self._makeOne(reg)
        import pyramid.tests.test_config
        config.setup_registry(root_factory='pyramid.tests.test_config')
        import tests.test_config
        config.setup_registry(root_factory='tests.test_config')
        self.assertEqual(reg.queryUtility(IRootFactory), None)
        config.commit()
        self.assertEqual(reg.getUtility(IRootFactory),
                         pyramid.tests.test_config)
        self.assertEqual(reg.getUtility(IRootFactory), tests.test_config)
    def test_setup_registry_locale_negotiator_dottedname(self):
        from pyramid.registry import Registry
        from pyramid.interfaces import ILocaleNegotiator
        reg = Registry()
        config = self._makeOne(reg)
        import pyramid.tests.test_config
        config.setup_registry(locale_negotiator='pyramid.tests.test_config')
        import tests.test_config
        config.setup_registry(locale_negotiator='tests.test_config')
        self.assertEqual(reg.queryUtility(ILocaleNegotiator), None)
        config.commit()
        utility = reg.getUtility(ILocaleNegotiator)
        self.assertEqual(utility, pyramid.tests.test_config)
        self.assertEqual(utility, tests.test_config)
    def test_setup_registry_locale_negotiator(self):
        from pyramid.registry import Registry
@@ -636,12 +635,12 @@
        from pyramid.interfaces import IRequestFactory
        reg = Registry()
        config = self._makeOne(reg)
        import pyramid.tests.test_config
        config.setup_registry(request_factory='pyramid.tests.test_config')
        import tests.test_config
        config.setup_registry(request_factory='tests.test_config')
        self.assertEqual(reg.queryUtility(IRequestFactory), None)
        config.commit()
        utility = reg.getUtility(IRequestFactory)
        self.assertEqual(utility, pyramid.tests.test_config)
        self.assertEqual(utility, tests.test_config)
    def test_setup_registry_alternate_renderers(self):
        from pyramid.registry import Registry
@@ -669,8 +668,8 @@
        config = self._makeOne(reg)
        settings = {
            'pyramid.includes':
"""pyramid.tests.test_config.dummy_include
pyramid.tests.test_config.dummy_include2""",
"""tests.test_config.dummy_include
tests.test_config.dummy_include2""",
        }
        config.setup_registry(settings=settings)
        self.assertTrue(reg.included)
@@ -682,7 +681,7 @@
        config = self._makeOne(reg)
        settings = {
            'pyramid.includes':
"""pyramid.tests.test_config.dummy_include pyramid.tests.test_config.dummy_include2""",
"""tests.test_config.dummy_include tests.test_config.dummy_include2""",
        }
        config.setup_registry(settings=settings)
        self.assertTrue(reg.included)
@@ -695,14 +694,14 @@
        config = self._makeOne(reg)
        settings = {
            'pyramid.tweens':
                    'pyramid.tests.test_config.dummy_tween_factory'
                    'tests.test_config.dummy_tween_factory'
        }
        config.setup_registry(settings=settings)
        config.commit()
        tweens = config.registry.getUtility(ITweens)
        self.assertEqual(
            tweens.explicit,
            [('pyramid.tests.test_config.dummy_tween_factory',
            [('tests.test_config.dummy_tween_factory',
              dummy_tween_factory)])
    def test_introspector_decorator(self):
@@ -739,9 +738,9 @@
        pyramid.config.global_registries.empty()
    def test_include_with_dotted_name(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self._makeOne()
        config.include('pyramid.tests.test_config.dummy_include')
        config.include('tests.test_config.dummy_include')
        after = config.action_state
        actions = after.actions
        self.assertEqual(len(actions), 1)
@@ -751,7 +750,7 @@
        self.assertEqual(action['args'], test_config)
    def test_include_with_python_callable(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self._makeOne()
        config.include(dummy_include)
        after = config.action_state
@@ -763,9 +762,9 @@
        self.assertEqual(action['args'], test_config)
    def test_include_with_module_defaults_to_includeme(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self._makeOne()
        config.include('pyramid.tests.test_config')
        config.include('tests.test_config')
        after = config.action_state
        actions = after.actions
        self.assertEqual(len(actions), 1)
@@ -777,7 +776,7 @@
    def test_include_with_module_defaults_to_includeme_missing(self):
        from pyramid.exceptions import ConfigurationError
        config = self._makeOne()
        self.assertRaises(ConfigurationError, config.include, 'pyramid.tests')
        self.assertRaises(ConfigurationError, config.include, 'tests')
    def test_include_with_route_prefix(self):
        root_config = self._makeOne(autocommit=True)
@@ -812,18 +811,18 @@
                return None
        config.inspect = DummyInspect()
        try:
            config.include('pyramid.tests.test_config.dummy_include')
            config.include('tests.test_config.dummy_include')
        except ConfigurationError as e:
            self.assertEqual(
                e.args[0], 
                "No source file for module 'pyramid.tests.test_config' (.py "
                "No source file for module 'tests.test_config' (.py "
                "file must exist, refusing to use orphan .pyc or .pyo file).")
        else: # pragma: no cover
            raise AssertionError
    def test_include_constant_root_package(self):
        from pyramid import tests
        from pyramid.tests import test_config
        import tests
        from tests import test_config
        config = self._makeOne(root_package=tests)
        results = {}
        def include(config):
@@ -834,8 +833,8 @@
        self.assertEqual(results['package'], test_config)
    def test_include_threadlocals_active(self):
        from pyramid.tests import test_config
        from pyramid.threadlocal import get_current_registry
        from tests import test_config
        stack = []
        def include(config):
            stack.append(get_current_registry())
@@ -935,7 +934,7 @@
        from zope.interface import alsoProvides
        from pyramid.interfaces import IRequest
        from pyramid.view import render_view_to_response
        import pyramid.tests.test_config.pkgs.scannable as package
        import tests.test_config.pkgs.scannable as package
        config = self._makeOne(autocommit=True)
        config.scan(package)
@@ -1039,10 +1038,10 @@
        from zope.interface import alsoProvides
        from pyramid.interfaces import IRequest
        from pyramid.view import render_view_to_response
        import pyramid.tests.test_config.pkgs.scannable as package
        import tests.test_config.pkgs.scannable as package
        config = self._makeOne(autocommit=True)
        config.scan(package, 
                    ignore='pyramid.tests.test_config.pkgs.scannable.another')
                    ignore='tests.test_config.pkgs.scannable.another')
        ctx = DummyContext()
        req = DummyRequest()
@@ -1062,7 +1061,7 @@
        from pyramid.interfaces import IRequest
        from pyramid.view import render_view_to_response
        config = self._makeOne(autocommit=True)
        config.scan('pyramid.tests.test_config.pkgs.scannable')
        config.scan('tests.test_config.pkgs.scannable')
        ctx = DummyContext()
        req = DummyRequest()
@@ -1075,7 +1074,7 @@
    def test_scan_integration_with_extra_kw(self):
        config = self._makeOne(autocommit=True)
        config.scan('pyramid.tests.test_config.pkgs.scanextrakw', a=1)
        config.scan('tests.test_config.pkgs.scanextrakw', a=1)
        self.assertEqual(config.a, 1)
    def test_scan_integration_with_onerror(self):
@@ -1097,7 +1096,7 @@
            sys.path.remove(path)
    def test_scan_integration_conflict(self):
        from pyramid.tests.test_config.pkgs import selfscan
        from tests.test_config.pkgs import selfscan
        from pyramid.config import Configurator
        c = Configurator()
        c.scan(selfscan)
@@ -1275,10 +1274,10 @@
        self.config = Configurator()
    def test_extend_with_dotted_name(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self.config
        config.add_directive(
            'dummy_extend', 'pyramid.tests.test_config.dummy_extend')
            'dummy_extend', 'tests.test_config.dummy_extend')
        self.assertTrue(hasattr(config, 'dummy_extend'))
        config.dummy_extend('discrim')
        after = config.action_state
@@ -1288,10 +1287,10 @@
        self.assertEqual(action['args'], test_config)
    def test_add_directive_with_partial(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self.config
        config.add_directive(
                'dummy_partial', 'pyramid.tests.test_config.dummy_partial')
                'dummy_partial', 'tests.test_config.dummy_partial')
        self.assertTrue(hasattr(config, 'dummy_partial'))
        config.dummy_partial()
        after = config.action_state
@@ -1301,10 +1300,10 @@
        self.assertEqual(action['args'], test_config)
    def test_add_directive_with_custom_callable(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self.config
        config.add_directive(
                'dummy_callable', 'pyramid.tests.test_config.dummy_callable')
                'dummy_callable', 'tests.test_config.dummy_callable')
        self.assertTrue(hasattr(config, 'dummy_callable'))
        config.dummy_callable('discrim')
        after = config.action_state
@@ -1314,7 +1313,7 @@
        self.assertEqual(action['args'], test_config)
    def test_extend_with_python_callable(self):
        from pyramid.tests import test_config
        from tests import test_config
        config = self.config
        config.add_directive(
            'dummy_extend', dummy_extend)
@@ -1351,7 +1350,7 @@
    def test_directive_persists_across_configurator_creations(self):
        config = self.config
        config.add_directive('dummy_extend', dummy_extend)
        config2 = config.with_package('pyramid.tests')
        config2 = config.with_package('tests')
        config2.dummy_extend('discrim')
        after = config2.action_state
        actions = after.actions
@@ -1391,7 +1390,7 @@
        config._add_predicate(
            'route',
            'testing',
            'pyramid.tests.test_config.test_init.DummyPredicate'
            'tests.test_config.test_init.DummyPredicate'
            )
        
class TestActionState(unittest.TestCase):
@@ -1404,7 +1403,7 @@
        self.assertEqual(c.actions, [])
    def test_action_simple(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        c = self._makeOne()
        c.actions = []
        c.action(1, f, (1,), {'x':1})
@@ -1733,7 +1732,7 @@
        return resolveConflicts(actions)
    def test_it_success_tuples(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        result = self._callFUT([
            (None, f),
            (1, f, (1,), {}, (), 'first'),
@@ -1794,7 +1793,7 @@
                  )
    def test_it_success_dicts(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        result = self._callFUT([
            (None, f),
            (1, f, (1,), {}, (), 'first'),
@@ -1855,7 +1854,7 @@
                  )
    def test_it_conflict(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        result = self._callFUT([
            (None, f),
            (1, f, (2,), {}, ('x',), 'eek'),     # will conflict
@@ -1867,7 +1866,7 @@
        self.assertRaises(ConfigurationConflictError, list, result)
    def test_it_with_actions_grouped_by_order(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        result = self._callFUT([
            (None, f),                                 # X
            (1, f, (1,), {}, (), 'third', 10),         # X
@@ -1941,7 +1940,7 @@
                  )
    def test_override_success_across_orders(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        result = self._callFUT([
            (1, f, (2,), {}, ('x',), 'eek', 0),
            (1, f, (3,), {}, ('x', 'y'), 'ack', 10),
@@ -1959,7 +1958,7 @@
        ])
    def test_conflicts_across_orders(self):
        from pyramid.tests.test_config import dummyfactory as f
        from . import dummyfactory as f
        result = self._callFUT([
            (1, f, (2,), {}, ('x', 'y'), 'eek', 0),
            (1, f, (3,), {}, ('x'), 'ack', 10),
tests/test_config/test_rendering.py
@@ -27,8 +27,8 @@
    def test_add_renderer_dottedname_factory(self):
        from pyramid.interfaces import IRendererFactory
        config = self._makeOne(autocommit=True)
        import pyramid.tests.test_config
        config.add_renderer('name', 'pyramid.tests.test_config')
        import tests.test_config
        config.add_renderer('name', 'tests.test_config')
        self.assertEqual(config.registry.getUtility(IRendererFactory, 'name'),
                         pyramid.tests.test_config)
                         tests.test_config)
tests/test_config/test_routes.py
@@ -1,7 +1,7 @@
import unittest
from pyramid.tests.test_config import dummyfactory
from pyramid.tests.test_config import DummyContext
from . import dummyfactory
from . import DummyContext
from pyramid.compat import text_
class RoutesConfiguratorMixinTests(unittest.TestCase):
@@ -74,7 +74,7 @@
        config = self._makeOne(autocommit=True)
        config.add_route(
            'name', 'path',
            factory='pyramid.tests.test_config.dummyfactory')
            factory='tests.test_config.dummyfactory')
        route = self._assertRoute(config, 'name', 'path')
        self.assertEqual(route.factory, dummyfactory)
tests/test_config/test_testing.py
@@ -2,7 +2,7 @@
from pyramid.compat import text_
from pyramid.security import AuthenticationAPIMixin, AuthorizationAPIMixin
from pyramid.tests.test_config import IDummy
from . import IDummy
class TestingConfiguratorMixinTests(unittest.TestCase):
    def _makeOne(self, *arg, **kw):
@@ -91,7 +91,7 @@
    def test_testing_add_subscriber_dottedname(self):
        config = self._makeOne(autocommit=True)
        L = config.testing_add_subscriber(
            'pyramid.tests.test_config.test_init.IDummy')
            'tests.test_config.test_init.IDummy')
        event = DummyEvent()
        config.registry.notify(event)
        self.assertEqual(len(L), 1)
tests/test_config/test_tweens.py
@@ -1,7 +1,7 @@
import unittest
from pyramid.tests.test_config import dummy_tween_factory
from pyramid.tests.test_config import dummy_tween_factory2
from . import dummy_tween_factory
from . import dummy_tween_factory2
from pyramid.exceptions import ConfigurationConflictError
@@ -18,18 +18,18 @@
        def factory2(handler, registry): return handler
        config = self._makeOne()
        config.add_tween(
            'pyramid.tests.test_config.dummy_tween_factory')
            'tests.test_config.dummy_tween_factory')
        config.add_tween(
            'pyramid.tests.test_config.dummy_tween_factory2')
            'tests.test_config.dummy_tween_factory2')
        config.commit()
        tweens = config.registry.queryUtility(ITweens)
        implicit = tweens.implicit()
        self.assertEqual(
            implicit,
            [
                ('pyramid.tests.test_config.dummy_tween_factory2',
                ('tests.test_config.dummy_tween_factory2',
                 dummy_tween_factory2),
                ('pyramid.tests.test_config.dummy_tween_factory',
                ('tests.test_config.dummy_tween_factory',
                 dummy_tween_factory),
                ('pyramid.tweens.excview_tween_factory',
                 excview_tween_factory),
@@ -42,12 +42,12 @@
        from pyramid.tweens import MAIN
        config = self._makeOne()
        config.add_tween(
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            over=MAIN)
        config.add_tween(
            'pyramid.tests.test_config.dummy_tween_factory2',
            'tests.test_config.dummy_tween_factory2',
            over=MAIN,
            under='pyramid.tests.test_config.dummy_tween_factory')
            under='tests.test_config.dummy_tween_factory')
        config.commit()
        tweens = config.registry.queryUtility(ITweens)
        implicit = tweens.implicit()
@@ -55,9 +55,9 @@
            implicit,
            [
                ('pyramid.tweens.excview_tween_factory', excview_tween_factory),
                ('pyramid.tests.test_config.dummy_tween_factory',
                ('tests.test_config.dummy_tween_factory',
                 dummy_tween_factory),
                ('pyramid.tests.test_config.dummy_tween_factory2',
                ('tests.test_config.dummy_tween_factory2',
                 dummy_tween_factory2),
             ])
@@ -66,7 +66,7 @@
        config = self._makeOne()
        self.assertRaises(
            ConfigurationError, config.add_tween,
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            under=False)
    def test_add_tweens_names_with_over_nonstringoriter(self):
@@ -74,20 +74,20 @@
        config = self._makeOne()
        self.assertRaises(
            ConfigurationError, config.add_tween,
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            over=False)
    def test_add_tween_dottedname(self):
        from pyramid.interfaces import ITweens
        from pyramid.tweens import excview_tween_factory
        config = self._makeOne()
        config.add_tween('pyramid.tests.test_config.dummy_tween_factory')
        config.add_tween('tests.test_config.dummy_tween_factory')
        config.commit()
        tweens = config.registry.queryUtility(ITweens)
        self.assertEqual(
            tweens.implicit(),
            [
                ('pyramid.tests.test_config.dummy_tween_factory',
                ('tests.test_config.dummy_tween_factory',
                 dummy_tween_factory),
                ('pyramid.tweens.excview_tween_factory',
                 excview_tween_factory),
@@ -102,10 +102,10 @@
    def test_add_tween_unsuitable(self):
        from pyramid.exceptions import ConfigurationError
        import pyramid.tests.test_config
        import tests.test_config
        config = self._makeOne()
        self.assertRaises(ConfigurationError, config.add_tween,
                          pyramid.tests.test_config)
                          tests.test_config)
    def test_add_tween_name_ingress(self):
        from pyramid.exceptions import ConfigurationError
@@ -121,8 +121,8 @@
    def test_add_tweens_conflict(self):
        config = self._makeOne()
        config.add_tween('pyramid.tests.test_config.dummy_tween_factory')
        config.add_tween('pyramid.tests.test_config.dummy_tween_factory')
        config.add_tween('tests.test_config.dummy_tween_factory')
        config.add_tween('tests.test_config.dummy_tween_factory')
        self.assertRaises(ConfigurationConflictError, config.commit)
    def test_add_tween_over_ingress(self):
@@ -132,7 +132,7 @@
        self.assertRaises(
            ConfigurationError,
            config.add_tween,
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            over=INGRESS)
    def test_add_tween_over_ingress_iterable(self):
@@ -142,7 +142,7 @@
        self.assertRaises(
            ConfigurationError,
            config.add_tween,
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            over=('a', INGRESS))
    def test_add_tween_under_main(self):
@@ -152,7 +152,7 @@
        self.assertRaises(
            ConfigurationError,
            config.add_tween,
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            under=MAIN)
    def test_add_tween_under_main_iterable(self):
@@ -162,7 +162,7 @@
        self.assertRaises(
            ConfigurationError,
            config.add_tween,
            'pyramid.tests.test_config.dummy_tween_factory',
            'tests.test_config.dummy_tween_factory',
            under=('a', MAIN))
class TestTweens(unittest.TestCase):
tests/test_config/test_views.py
@@ -2,9 +2,9 @@
import unittest
from pyramid import testing
from pyramid.tests.test_config import IDummy
from . import IDummy
from pyramid.tests.test_config import dummy_view
from . import dummy_view
from pyramid.compat import (
    im_func,
@@ -155,7 +155,7 @@
    def test_add_view_view_callable_dottedname(self):
        from pyramid.renderers import null_renderer
        config = self._makeOne(autocommit=True)
        config.add_view(view='pyramid.tests.test_config.dummy_view',
        config.add_view(view='tests.test_config.dummy_view',
                        renderer=null_renderer)
        wrapper = self._getViewCallable(config)
        self.assertEqual(wrapper(None, None), 'OK')
@@ -367,7 +367,7 @@
        from pyramid.renderers import null_renderer
        view = lambda *arg: 'OK'
        config = self._makeOne(autocommit=True)
        config.add_view(context='pyramid.tests.test_config.IDummy',
        config.add_view(context='tests.test_config.IDummy',
                        view=view,  renderer=null_renderer)
        wrapper = self._getViewCallable(config, IDummy)
        self.assertEqual(wrapper, view)
@@ -376,7 +376,7 @@
        from pyramid.renderers import null_renderer
        view = lambda *arg: 'OK'
        config = self._makeOne(autocommit=True)
        config.add_view(for_='pyramid.tests.test_config.IDummy',
        config.add_view(for_='tests.test_config.IDummy',
                        view=view, renderer=null_renderer)
        wrapper = self._getViewCallable(config, IDummy)
        self.assertEqual(wrapper, view)
@@ -1162,7 +1162,7 @@
            )
    def test_add_view_with_template_renderer(self):
        from pyramid.tests import test_config
        from tests import test_config
        from pyramid.interfaces import ISettings
        class view(object):
            def __init__(self, context, request):
@@ -1173,7 +1173,7 @@
                return {'a':'1'}
        config = self._makeOne(autocommit=True)
        renderer = self._registerRenderer(config)
        fixture = 'pyramid.tests.test_config:files/minimal.txt'
        fixture = 'tests.test_config:files/minimal.txt'
        config.introspection = False
        config.add_view(view=view, renderer=fixture)
        wrapper = self._getViewCallable(config)
@@ -1210,11 +1210,11 @@
        self.assertEqual(result.body, b'moo')
    def test_add_view_with_template_renderer_no_callable(self):
        from pyramid.tests import test_config
        from tests import test_config
        from pyramid.interfaces import ISettings
        config = self._makeOne(autocommit=True)
        renderer = self._registerRenderer(config)
        fixture = 'pyramid.tests.test_config:files/minimal.txt'
        fixture = 'tests.test_config:files/minimal.txt'
        config.introspection = False
        config.add_view(view=None, renderer=fixture)
        wrapper = self._getViewCallable(config)
@@ -1522,7 +1522,7 @@
        config = self._makeOne(autocommit=True)
        config.add_view(
            view=view,
            containment='pyramid.tests.test_config.IDummy',
            containment='tests.test_config.IDummy',
            renderer=null_renderer)
        wrapper = self._getViewCallable(config)
        context = DummyContext()
@@ -1773,7 +1773,7 @@
        from zope.interface import directlyProvides
        class view(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IDummy'
                'containment':'tests.test_config.IDummy'
                }
            def __init__(self, request):
                pass
@@ -1798,7 +1798,7 @@
        from zope.interface import directlyProvides
        config = self._makeOne(autocommit=True)
        config.add_view(
            view='pyramid.tests.test_config.test_views.DummyViewDefaultsClass',
            view='tests.test_config.test_views.DummyViewDefaultsClass',
            renderer=null_renderer)
        wrapper = self._getViewCallable(config)
        context = DummyContext()
@@ -1815,7 +1815,7 @@
        from zope.interface import directlyProvides
        config = self._makeOne(autocommit=True)
        config.add_view(
            'pyramid.tests.test_config.test_views.DummyViewDefaultsClass',
            'tests.test_config.test_views.DummyViewDefaultsClass',
            renderer=null_renderer)
        wrapper = self._getViewCallable(config)
        context = DummyContext()
@@ -1830,11 +1830,11 @@
        from pyramid.renderers import null_renderer
        class view(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IDummy'
                'containment':'tests.test_config.IDummy'
                }
        class view2(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IFactory'
                'containment':'tests.test_config.IFactory'
                }
        config = self._makeOne(autocommit=False)
        config.add_view(
@@ -1849,11 +1849,11 @@
        from pyramid.renderers import null_renderer
        class view(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IDummy'
                'containment':'tests.test_config.IDummy'
                }
        class view2(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IDummy'
                'containment':'tests.test_config.IDummy'
                }
        config = self._makeOne(autocommit=False)
        config.add_view(
@@ -1975,7 +1975,7 @@
        from zope.interface import implementedBy
        class view(object):
            __view_defaults__ = {
                'containment': 'pyramid.tests.test_config.IDummy'
                'containment': 'tests.test_config.IDummy'
                }
            def __init__(self, request):
                pass
@@ -2009,7 +2009,7 @@
        from pyramid.renderers import null_renderer
        config = self._makeOne()
        result = config.derive_view(
            'pyramid.tests.test_config.dummy_view',
            'tests.test_config.dummy_view',
            renderer=null_renderer)
        self.assertFalse(result is dummy_view)
        self.assertEqual(result(None, None), 'OK')
@@ -2071,10 +2071,10 @@
        config = self._makeOne(autocommit=True)
        config.registry.registerUtility(info, IStaticURLInfo)
        config.add_static_view('static',
                               'pyramid.tests.test_config:files')
                               'tests.test_config:files')
        self.assertEqual(
            info.added,
            [(config, 'static', 'pyramid.tests.test_config:files', {})])
            [(config, 'static', 'tests.test_config:files', {})])
    def test_add_static_view_package_here_relative(self):
        from pyramid.interfaces import IStaticURLInfo
@@ -2084,7 +2084,7 @@
        config.add_static_view('static', 'files')
        self.assertEqual(
            info.added,
            [(config, 'static', 'pyramid.tests.test_config:files', {})])
            [(config, 'static', 'tests.test_config:files', {})])
    def test_add_static_view_absolute(self):
        import os
@@ -2169,7 +2169,7 @@
        from zope.interface import implementedBy
        class view(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IDummy'
                'containment':'tests.test_config.IDummy'
                }
            def __init__(self, request):
                pass
@@ -2305,7 +2305,7 @@
        from zope.interface import implementedBy
        class view(object):
            __view_defaults__ = {
                'containment':'pyramid.tests.test_config.IDummy'
                'containment':'tests.test_config.IDummy'
                }
            def __init__(self, request):
                pass
@@ -2379,9 +2379,9 @@
    def test_set_view_mapper_dottedname(self):
        from pyramid.interfaces import IViewMapperFactory
        config = self._makeOne(autocommit=True)
        config.set_view_mapper('pyramid.tests.test_config')
        config.set_view_mapper('tests.test_config')
        result = config.registry.getUtility(IViewMapperFactory)
        from pyramid.tests import test_config
        from tests import test_config
        self.assertEqual(result, test_config)
    def test_add_normal_and_exception_view_intr_derived_callable(self):
@@ -3284,8 +3284,8 @@
            request = testing.DummyRequest()
            config.add_static_view('static', 'path')
            config.override_asset(
                'pyramid.tests.test_config:path/',
                'pyramid.tests.test_config:other_path/')
                'tests.test_config:path/',
                'tests.test_config:other_path/')
            def cb(val):
                def cb_(request, subpath, kw):
                    kw['_query'] = {'x': val}
@@ -3468,7 +3468,7 @@
        def view(): pass
        result = self._callFUT(view)
        self.assertEqual(result,
                         'function pyramid.tests.test_config.test_views.view')
                         'function tests.test_config.test_views.view')
class Test_viewdefaults(unittest.TestCase):
    def _makeOne(self, wrapped):
@@ -3599,7 +3599,7 @@
class DummyViewDefaultsClass(object):
    __view_defaults__ = {
        'containment':'pyramid.tests.test_config.IDummy'
        'containment':'tests.test_config.IDummy'
        }
    def __init__(self, request):
        pass
tests/test_csrf.py
@@ -239,7 +239,7 @@
        self.config.set_default_csrf_options(require_csrf=False)
    def _callFUT(self, *args, **kwargs):
        from ..csrf import check_csrf_token
        from pyramid.csrf import check_csrf_token
        return check_csrf_token(*args, **kwargs)
    def test_success_token(self):
@@ -281,7 +281,7 @@
        self.config = testing.setUp()
    def _callFUT(self, *args, **kwargs):
        from ..csrf import check_csrf_token
        from pyramid.csrf import check_csrf_token
        return check_csrf_token(*args, **kwargs)
    def test_success_token(self):
@@ -304,7 +304,7 @@
class Test_check_csrf_origin(unittest.TestCase):
    def _callFUT(self, *args, **kwargs):
        from ..csrf import check_csrf_origin
        from pyramid.csrf import check_csrf_origin
        return check_csrf_origin(*args, **kwargs)
    def test_success_with_http(self):
tests/test_integration.py
@@ -48,7 +48,7 @@
        from pyramid.interfaces import IView
        from pyramid.interfaces import IViewClassifier
        from pyramid.config import Configurator
        from pyramid.tests import test_integration
        from . import test_integration
        config = Configurator()
        config.scan(test_integration)
        config.commit()
@@ -189,7 +189,7 @@
        self.testapp.get('/%2F/test_integration.py', status=404)
class TestEventOnlySubscribers(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.eventonly'
    package = 'tests.pkgs.eventonly'
    def test_sendfoo(self):
        res = self.testapp.get('/sendfoo', status=200)
@@ -201,10 +201,10 @@
                         [b'foobar', b'foobar2', b'foobaryup', b'foobaryup2'])
class TestStaticAppUsingAbsPath(StaticAppBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.static_abspath'
    package = 'tests.pkgs.static_abspath'
class TestStaticAppUsingAssetSpec(StaticAppBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.static_assetspec'
    package = 'tests.pkgs.static_assetspec'
class TestStaticAppNoSubpath(unittest.TestCase):
    staticapp = static_view(os.path.join(here, 'fixtures'), use_subpath=False)
@@ -231,7 +231,7 @@
        _assertBody(result.body, os.path.join(here, 'fixtures/minimal.txt'))
class TestStaticAppWithRoutePrefix(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.static_routeprefix'
    package = 'tests.pkgs.static_routeprefix'
    def test_includelevel1(self):
        res = self.testapp.get('/static/minimal.txt', status=200)
@@ -245,7 +245,7 @@
class TestFixtureApp(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.fixtureapp'
    package = 'tests.pkgs.fixtureapp'
    def test_another(self):
        res = self.testapp.get('/another.html', status=200)
        self.assertEqual(res.body, b'fixture')
@@ -265,8 +265,8 @@
        self.testapp.get('/protected.html', status=403)
class TestStaticPermApp(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.staticpermapp'
    root_factory = 'pyramid.tests.pkgs.staticpermapp:RootFactory'
    package = 'tests.pkgs.staticpermapp'
    root_factory = 'tests.pkgs.staticpermapp:RootFactory'
    def test_allowed(self):
        result = self.testapp.get('/allowed/index.html', status=200)
        _assertBody(result.body,
@@ -295,7 +295,7 @@
class TestCCBug(IntegrationBase, unittest.TestCase):
    # "unordered" as reported in IRC by author of
    # http://labs.creativecommons.org/2010/01/13/cc-engine-and-web-non-frameworks/
    package = 'pyramid.tests.pkgs.ccbugapp'
    package = 'tests.pkgs.ccbugapp'
    def test_rdf(self):
        res = self.testapp.get('/licenses/1/v1/rdf', status=200)
        self.assertEqual(res.body, b'rdf')
@@ -308,7 +308,7 @@
    # make sure views registered for a route "win" over views registered
    # without one, even though the context of the non-route view may
    # be more specific than the route view.
    package = 'pyramid.tests.pkgs.hybridapp'
    package = 'tests.pkgs.hybridapp'
    def test_root(self):
        res = self.testapp.get('/', status=200)
        self.assertEqual(res.body, b'global')
@@ -349,14 +349,14 @@
class TestRestBugApp(IntegrationBase, unittest.TestCase):
    # test bug reported by delijati 2010/2/3 (http://pastebin.com/d4cc15515)
    package = 'pyramid.tests.pkgs.restbugapp'
    package = 'tests.pkgs.restbugapp'
    def test_it(self):
        res = self.testapp.get('/pet', status=200)
        self.assertEqual(res.body, b'gotten')
class TestForbiddenAppHasResult(IntegrationBase, unittest.TestCase):
    # test that forbidden exception has ACLDenied result attached
    package = 'pyramid.tests.pkgs.forbiddenapp'
    package = 'tests.pkgs.forbiddenapp'
    def test_it(self):
        res = self.testapp.get('/x', status=403)
        message, result = [x.strip() for x in res.body.split(b'\n')]
@@ -370,7 +370,7 @@
            result.endswith(b"for principals ['system.Everyone']"))
class TestViewDecoratorApp(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.viewdecoratorapp'
    package = 'tests.pkgs.viewdecoratorapp'
    def test_first(self):
        res = self.testapp.get('/first', status=200)
@@ -381,7 +381,7 @@
        self.assertTrue(b'OK2' in res.body)
class TestNotFoundView(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.notfoundview'
    package = 'tests.pkgs.notfoundview'
    def test_it(self):
        res = self.testapp.get('/wontbefound', status=200)
@@ -398,7 +398,7 @@
        self.assertTrue(b'baz_notfound' in res.body)
class TestForbiddenView(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.forbiddenview'
    package = 'tests.pkgs.forbiddenview'
    def test_it(self):
        res = self.testapp.get('/foo', status=200)
@@ -408,7 +408,7 @@
        
class TestViewPermissionBug(IntegrationBase, unittest.TestCase):
    # view_execution_permitted bug as reported by Shane at http://lists.repoze.org/pipermail/repoze-dev/2010-October/003603.html
    package = 'pyramid.tests.pkgs.permbugapp'
    package = 'tests.pkgs.permbugapp'
    def test_test(self):
        res = self.testapp.get('/test', status=200)
        self.assertTrue(b'ACLDenied' in res.body)
@@ -418,7 +418,7 @@
class TestDefaultViewPermissionBug(IntegrationBase, unittest.TestCase):
    # default_view_permission bug as reported by Wiggy at http://lists.repoze.org/pipermail/repoze-dev/2010-October/003602.html
    package = 'pyramid.tests.pkgs.defpermbugapp'
    package = 'tests.pkgs.defpermbugapp'
    def test_x(self):
        res = self.testapp.get('/x', status=403)
        self.assertTrue(b'failed permission check' in res.body)
@@ -431,13 +431,12 @@
        res = self.testapp.get('/z', status=200)
        self.assertTrue(b'public' in res.body)
from pyramid.tests.pkgs.exceptionviewapp.models import \
     AnException, NotAnException
from .pkgs.exceptionviewapp.models import AnException, NotAnException
excroot = {'anexception':AnException(),
           'notanexception':NotAnException()}
class TestExceptionViewsApp(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.exceptionviewapp'
    package = 'tests.pkgs.exceptionviewapp'
    root_factory = lambda *arg: excroot
    def test_root(self):
        res = self.testapp.get('/', status=200)
@@ -472,7 +471,7 @@
        self.assertTrue(b'caught' in res.body)
        
class TestConflictApp(unittest.TestCase):
    package = 'pyramid.tests.pkgs.conflictapp'
    package = 'tests.pkgs.conflictapp'
    def _makeConfig(self):
        from pyramid.config import Configurator
        config = Configurator()
@@ -535,7 +534,7 @@
    def setUp(self):
        from pyramid.config import Configurator
        config = Configurator()
        from pyramid.tests.pkgs.includeapp1.root import configure
        from .pkgs.includeapp1.root import configure
        configure(config)
        app = config.make_wsgi_app()
        self.testapp = TestApp(app)
@@ -558,7 +557,7 @@
class SelfScanAppTest(unittest.TestCase):
    def setUp(self):
        from pyramid.tests.test_config.pkgs.selfscan import main
        from .test_config.pkgs.selfscan import main
        config = main()
        app = config.make_wsgi_app()
        self.testapp = TestApp(app)
@@ -577,7 +576,7 @@
class WSGIApp2AppTest(unittest.TestCase):
    def setUp(self):
        from pyramid.tests.pkgs.wsgiapp2app import main
        from .pkgs.wsgiapp2app import main
        config = main()
        app = config.make_wsgi_app()
        self.testapp = TestApp(app)
@@ -592,7 +591,7 @@
class SubrequestAppTest(unittest.TestCase):
    def setUp(self):
        from pyramid.tests.pkgs.subrequestapp import main
        from .pkgs.subrequestapp import main
        config = main()
        app = config.make_wsgi_app()
        self.testapp = TestApp(app)
@@ -614,7 +613,7 @@
        self.assertTrue(b'Value error raised' in res.body)
class RendererScanAppTest(IntegrationBase, unittest.TestCase):
    package = 'pyramid.tests.pkgs.rendererscanapp'
    package = 'tests.pkgs.rendererscanapp'
    def test_root(self):
        res = self.testapp.get('/one', status=200)
        self.assertTrue(b'One!' in res.body)
@@ -624,7 +623,7 @@
        self.assertTrue(b'Two!' in res.body)
    def test_rescan(self):
        self.config.scan('pyramid.tests.pkgs.rendererscanapp')
        self.config.scan('tests.pkgs.rendererscanapp')
        app = self.config.make_wsgi_app()
        testapp = TestApp(app)
        res = testapp.get('/one', status=200)
tests/test_paster.py
@@ -1,6 +1,6 @@
import os
import unittest
from pyramid.tests.test_scripts.dummy import DummyLoader
from .test_scripts.dummy import DummyLoader
here = os.path.dirname(__file__)
tests/test_path.py
@@ -6,7 +6,7 @@
class TestCallerPath(unittest.TestCase):
    def tearDown(self):
        from pyramid.tests import test_path
        from . import test_path
        if hasattr(test_path, '__abspath__'):
            del test_path.__abspath__
@@ -25,14 +25,14 @@
    def test_memoization_has_abspath(self):
        import os
        from pyramid.tests import test_path
        from . import test_path
        test_path.__abspath__ = '/foo/bar'
        result = self._callFUT('a/b/c')
        self.assertEqual(result, os.path.join('/foo/bar', 'a/b/c'))
    def test_memoization_success(self):
        import os
        from pyramid.tests import test_path
        from . import test_path
        result = self._callFUT('a/b/c')
        self.assertEqual(result, os.path.join(here, 'a/b/c'))
        self.assertEqual(test_path.__abspath__, here)
@@ -43,17 +43,17 @@
        return caller_module(*arg, **kw)
    def test_it_level_1(self):
        from pyramid.tests import test_path
        from . import test_path
        result = self._callFUT(1)
        self.assertEqual(result, test_path)
    def test_it_level_2(self):
        from pyramid.tests import test_path
        from . import test_path
        result = self._callFUT(2)
        self.assertEqual(result, test_path)
    def test_it_level_3(self):
        from pyramid.tests import test_path
        from . import test_path
        result = self._callFUT(3)
        self.assertNotEqual(result, test_path)
@@ -75,12 +75,12 @@
        return caller_package(*arg, **kw)
    def test_it_level_1(self):
        from pyramid import tests
        import tests
        result = self._callFUT(1)
        self.assertEqual(result, tests)
    def test_it_level_2(self):
        from pyramid import tests
        import tests
        result = self._callFUT(2)
        self.assertEqual(result, tests)
@@ -90,11 +90,11 @@
        self.assertEqual(result, unittest)
    def test_it_package(self):
        import pyramid.tests
        import tests
        def dummy_caller_module(*arg):
            return pyramid.tests
            return tests
        result = self._callFUT(1, caller_module=dummy_caller_module)
        self.assertEqual(result, pyramid.tests)
        self.assertEqual(result, tests)
        
class TestPackagePath(unittest.TestCase):
    def _callFUT(self, package):
@@ -102,25 +102,25 @@
        return package_path(package)
    def test_it_package(self):
        from pyramid import tests
        import tests
        package = DummyPackageOrModule(tests)
        result = self._callFUT(package)
        self.assertEqual(result, package.package_path)
        
    def test_it_module(self):
        from pyramid.tests import test_path
        from . import test_path
        module = DummyPackageOrModule(test_path)
        result = self._callFUT(module)
        self.assertEqual(result, module.package_path)
    def test_memoization_success(self):
        from pyramid.tests import test_path
        from . import test_path
        module = DummyPackageOrModule(test_path)
        self._callFUT(module)
        self.assertEqual(module.__abspath__, module.package_path)
        
    def test_memoization_fail(self):
        from pyramid.tests import test_path
        from . import test_path
        module = DummyPackageOrModule(test_path, raise_exc=TypeError)
        result = self._callFUT(module)
        self.assertFalse(hasattr(module, '__abspath__'))
@@ -132,15 +132,15 @@
        return package_of(package)
    def test_it_package(self):
        from pyramid import tests
        import tests
        package = DummyPackageOrModule(tests)
        result = self._callFUT(package)
        self.assertEqual(result, tests)
    def test_it_module(self):
        import pyramid.tests.test_path
        from pyramid import tests
        package = DummyPackageOrModule(pyramid.tests.test_path)
        import tests.test_path
        import tests
        package = DummyPackageOrModule(tests.test_path)
        result = self._callFUT(package)
        self.assertEqual(result, tests)
@@ -150,22 +150,22 @@
        return package_name(package)
    def test_it_package(self):
        from pyramid import tests
        import tests
        package = DummyPackageOrModule(tests)
        result = self._callFUT(package)
        self.assertEqual(result, 'pyramid.tests')
        self.assertEqual(result, 'tests')
    def test_it_namespace_package(self):
        from pyramid import tests
        import tests
        package = DummyNamespacePackage(tests)
        result = self._callFUT(package)
        self.assertEqual(result, 'pyramid.tests')
        self.assertEqual(result, 'tests')
        
    def test_it_module(self):
        from pyramid.tests import test_path
        from . import test_path
        module = DummyPackageOrModule(test_path)
        result = self._callFUT(module)
        self.assertEqual(result, 'pyramid.tests')
        self.assertEqual(result, 'tests')
    def test_it_None(self):
        result = self._callFUT(None)
@@ -185,43 +185,43 @@
        return self._getTargetClass()(package)
    def test_get_package_caller_package(self):
        import pyramid.tests
        import tests
        from pyramid.path import CALLER_PACKAGE
        self.assertEqual(self._makeOne(CALLER_PACKAGE).get_package(),
                         pyramid.tests)
                         tests)
    def test_get_package_name_caller_package(self):
        from pyramid.path import CALLER_PACKAGE
        self.assertEqual(self._makeOne(CALLER_PACKAGE).get_package_name(),
                         'pyramid.tests')
                         'tests')
    def test_get_package_string(self):
        import pyramid.tests
        self.assertEqual(self._makeOne('pyramid.tests').get_package(),
                         pyramid.tests)
        import tests
        self.assertEqual(self._makeOne('tests').get_package(),
                         tests)
    def test_get_package_name_string(self):
        self.assertEqual(self._makeOne('pyramid.tests').get_package_name(),
                         'pyramid.tests')
        self.assertEqual(self._makeOne('tests').get_package_name(),
                         'tests')
class TestAssetResolver(unittest.TestCase):
    def _getTargetClass(self):
        from pyramid.path import AssetResolver
        return AssetResolver
    def _makeOne(self, package='pyramid.tests'):
    def _makeOne(self, package='tests'):
        return self._getTargetClass()(package)
    def test_ctor_as_package(self):
        import sys
        tests = sys.modules['pyramid.tests']
        tests = sys.modules['tests']
        inst = self._makeOne(tests)
        self.assertEqual(inst.package, tests)
    def test_ctor_as_str(self):
        import sys
        tests = sys.modules['pyramid.tests']
        inst = self._makeOne('pyramid.tests')
        tests = sys.modules['tests']
        inst = self._makeOne('tests')
        self.assertEqual(inst.package, tests)
    def test_resolve_abspath(self):
@@ -234,13 +234,13 @@
    def test_resolve_absspec(self):
        from pyramid.path import PkgResourcesAssetDescriptor
        inst = self._makeOne(None)
        r = inst.resolve('pyramid.tests:test_asset.py')
        r = inst.resolve('tests:test_asset.py')
        self.assertEqual(r.__class__, PkgResourcesAssetDescriptor)
        self.assertTrue(r.exists())
    def test_resolve_relspec_with_pkg(self):
        from pyramid.path import PkgResourcesAssetDescriptor
        inst = self._makeOne('pyramid.tests')
        inst = self._makeOne('tests')
        r = inst.resolve('test_asset.py')
        self.assertEqual(r.__class__, PkgResourcesAssetDescriptor)
        self.assertTrue(r.exists())
@@ -262,7 +262,7 @@
        from pyramid.path import PkgResourcesAssetDescriptor
        return PkgResourcesAssetDescriptor
    def _makeOne(self, pkg='pyramid.tests', path='test_asset.py'):
    def _makeOne(self, pkg='tests', path='test_asset.py'):
        return self._getTargetClass()(pkg, path)
    def test_class_conforms_to_IAssetDescriptor(self):
@@ -277,7 +277,7 @@
    def test_absspec(self):
        inst = self._makeOne()
        self.assertEqual(inst.absspec(), 'pyramid.tests:test_asset.py')
        self.assertEqual(inst.absspec(), 'tests:test_asset.py')
    def test_abspath(self):
        inst = self._makeOne()
@@ -289,28 +289,28 @@
        inst.pkg_resources.resource_stream = lambda x, y: '%s:%s' % (x, y)
        s = inst.stream()
        self.assertEqual(s,
                         '%s:%s' % ('pyramid.tests', 'test_asset.py'))
                         '%s:%s' % ('tests', 'test_asset.py'))
    def test_isdir(self):
        inst = self._makeOne()
        inst.pkg_resources = DummyPkgResource()
        inst.pkg_resources.resource_isdir = lambda x, y: '%s:%s' % (x, y)
        self.assertEqual(inst.isdir(),
                         '%s:%s' % ('pyramid.tests', 'test_asset.py'))
                         '%s:%s' % ('tests', 'test_asset.py'))
    def test_listdir(self):
        inst = self._makeOne()
        inst.pkg_resources = DummyPkgResource()
        inst.pkg_resources.resource_listdir = lambda x, y: '%s:%s' % (x, y)
        self.assertEqual(inst.listdir(),
                         '%s:%s' % ('pyramid.tests', 'test_asset.py'))
                         '%s:%s' % ('tests', 'test_asset.py'))
    def test_exists(self):
        inst = self._makeOne()
        inst.pkg_resources = DummyPkgResource()
        inst.pkg_resources.resource_exists = lambda x, y: '%s:%s' % (x, y)
        self.assertEqual(inst.exists(),
                         '%s:%s' % ('pyramid.tests', 'test_asset.py'))
                         '%s:%s' % ('tests', 'test_asset.py'))
class TestFSAssetDescriptor(unittest.TestCase):
    def _getTargetClass(self):
@@ -385,7 +385,7 @@
    def test_zope_dottedname_style_resolve_absolute(self):
        typ = self._makeOne()
        result = typ._zope_dottedname_style(
            'pyramid.tests.test_path.TestDottedNameResolver', None)
            'tests.test_path.TestDottedNameResolver', None)
        self.assertEqual(result, self.__class__)
    def test_zope_dottedname_style_irrresolveable_absolute(self):
@@ -394,24 +394,24 @@
            'pyramid.test_path.nonexisting_name', None)
    def test__zope_dottedname_style_resolve_relative(self):
        import pyramid.tests
        import tests
        typ = self._makeOne()
        result = typ._zope_dottedname_style(
            '.test_path.TestDottedNameResolver', pyramid.tests)
            '.test_path.TestDottedNameResolver', tests)
        self.assertEqual(result, self.__class__)
    def test__zope_dottedname_style_resolve_relative_leading_dots(self):
        import pyramid.tests.test_path
        import tests.test_path
        typ = self._makeOne()
        result = typ._zope_dottedname_style(
            '..tests.test_path.TestDottedNameResolver', pyramid.tests)
            '..tests.test_path.TestDottedNameResolver', tests)
        self.assertEqual(result, self.__class__)
    def test__zope_dottedname_style_resolve_relative_is_dot(self):
        import pyramid.tests
        import tests
        typ = self._makeOne()
        result = typ._zope_dottedname_style('.', pyramid.tests)
        self.assertEqual(result, pyramid.tests)
        result = typ._zope_dottedname_style('.', tests)
        self.assertEqual(result, tests)
    def test__zope_dottedname_style_irresolveable_relative_is_dot(self):
        typ = self._makeOne()
@@ -428,16 +428,15 @@
            "relative name '.whatever' irresolveable without package")
    def test_zope_dottedname_style_irrresolveable_relative(self):
        import pyramid.tests
        import tests
        typ = self._makeOne()
        self.assertRaises(ImportError, typ._zope_dottedname_style,
                          '.notexisting', pyramid.tests)
                          '.notexisting', tests)
    def test__zope_dottedname_style_resolveable_relative(self):
        import pyramid
        import tests
        typ = self._makeOne()
        result = typ._zope_dottedname_style('.tests', pyramid)
        from pyramid import tests
        result = typ._zope_dottedname_style('.', tests)
        self.assertEqual(result, tests)
    def test__zope_dottedname_style_irresolveable_absolute(self):
@@ -449,32 +448,32 @@
    def test__zope_dottedname_style_resolveable_absolute(self):
        typ = self._makeOne()
        result = typ._zope_dottedname_style(
            'pyramid.tests.test_path.TestDottedNameResolver', None)
            'tests.test_path.TestDottedNameResolver', None)
        self.assertEqual(result, self.__class__)
    def test__pkg_resources_style_resolve_absolute(self):
        typ = self._makeOne()
        result = typ._pkg_resources_style(
            'pyramid.tests.test_path:TestDottedNameResolver', None)
            'tests.test_path:TestDottedNameResolver', None)
        self.assertEqual(result, self.__class__)
    def test__pkg_resources_style_irrresolveable_absolute(self):
        typ = self._makeOne()
        self.assertRaises(ImportError, typ._pkg_resources_style,
            'pyramid.tests:nonexisting', None)
            'tests:nonexisting', None)
    def test__pkg_resources_style_resolve_relative(self):
        import pyramid.tests
        import tests
        typ = self._makeOne()
        result = typ._pkg_resources_style(
            '.test_path:TestDottedNameResolver', pyramid.tests)
            '.test_path:TestDottedNameResolver', tests)
        self.assertEqual(result, self.__class__)
    def test__pkg_resources_style_resolve_relative_is_dot(self):
        import pyramid.tests
        import tests
        typ = self._makeOne()
        result = typ._pkg_resources_style('.', pyramid.tests)
        self.assertEqual(result, pyramid.tests)
        result = typ._pkg_resources_style('.', tests)
        self.assertEqual(result, tests)
    def test__pkg_resources_style_resolve_relative_nocurrentpackage(self):
        typ = self._makeOne()
@@ -495,13 +494,13 @@
    def test_resolve_using_pkgresources_style(self):
        typ = self._makeOne()
        result = typ.resolve(
            'pyramid.tests.test_path:TestDottedNameResolver')
            'tests.test_path:TestDottedNameResolver')
        self.assertEqual(result, self.__class__)
    def test_resolve_using_zope_dottedname_style(self):
        typ = self._makeOne()
        result = typ.resolve(
            'pyramid.tests.test_path:TestDottedNameResolver')
            'tests.test_path:TestDottedNameResolver')
        self.assertEqual(result, self.__class__)
    def test_resolve_missing_raises(self):
@@ -521,28 +520,28 @@
                         self.__class__)
    def test_ctor_string_module_resolveable(self):
        import pyramid.tests
        typ = self._makeOne('pyramid.tests.test_path')
        self.assertEqual(typ.package, pyramid.tests)
        import tests
        typ = self._makeOne('tests.test_path')
        self.assertEqual(typ.package, tests)
    def test_ctor_string_package_resolveable(self):
        import pyramid.tests
        typ = self._makeOne('pyramid.tests')
        self.assertEqual(typ.package, pyramid.tests)
        import tests
        typ = self._makeOne('tests')
        self.assertEqual(typ.package, tests)
    def test_ctor_string_irresolveable(self):
        self.assertRaises(ValueError, self._makeOne, 'cant.be.found')
    def test_ctor_module(self):
        import pyramid.tests
        import pyramid.tests.test_path
        typ = self._makeOne(pyramid.tests.test_path)
        self.assertEqual(typ.package, pyramid.tests)
        import tests
        from . import test_path
        typ = self._makeOne(test_path)
        self.assertEqual(typ.package, tests)
    def test_ctor_package(self):
        import pyramid.tests
        typ = self._makeOne(pyramid.tests)
        self.assertEqual(typ.package, pyramid.tests)
        import tests
        typ = self._makeOne(tests)
        self.assertEqual(typ.package, tests)
    def test_ctor_None(self):
        typ = self._makeOne(None)
tests/test_registry.py
@@ -29,7 +29,7 @@
    def test_default_package_name(self):
        registry = self._makeOne()
        self.assertEqual(registry.package_name, 'pyramid.tests')
        self.assertEqual(registry.package_name, 'tests')
    def test_registerHandler_and_notify(self):
        registry = self._makeOne()
tests/test_renderers.py
@@ -464,7 +464,7 @@
    def _registerRenderer(self):
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        renderer.string_response = 'abc'
        return renderer
@@ -485,11 +485,11 @@
        renderer.assert_(request=request)
    def test_it_with_package(self):
        import pyramid.tests
        import tests
        renderer = self._registerRenderer()
        request = testing.DummyRequest()
        result = self._callFUT('abc/def.pt', dict(a=1), request=request,
                               package=pyramid.tests)
                               package=tests)
        self.assertEqual(result, 'abc')
        renderer.assert_(a=1)
        renderer.assert_(request=request)
@@ -533,7 +533,7 @@
    def test_it_no_request(self):
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        renderer.string_response = 'abc'
        response = self._callFUT('abc/def.pt', dict(a=1))
        self.assertEqual(response.body, b'abc')
@@ -542,7 +542,7 @@
    def test_it_with_request(self):
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        renderer.string_response = 'abc'
        request = testing.DummyRequest()
        response = self._callFUT('abc/def.pt',
@@ -552,13 +552,13 @@
        renderer.assert_(request=request)
    def test_it_with_package(self):
        import pyramid.tests
        import tests
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        renderer.string_response = 'abc'
        request = testing.DummyRequest()
        response = self._callFUT('abc/def.pt', dict(a=1), request=request,
                                 package=pyramid.tests)
                                 package=tests)
        self.assertEqual(response.body, b'abc')
        renderer.assert_(a=1)
        renderer.assert_(request=request)
@@ -613,20 +613,20 @@
    def test_it_no_package(self):
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        result = self._callFUT('abc/def.pt')
        self.assertEqual(result, renderer)
    def test_it_with_package(self):
        import pyramid.tests
        import tests
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
        result = self._callFUT('abc/def.pt', package=pyramid.tests)
            'tests:abc/def.pt')
        result = self._callFUT('abc/def.pt', package=tests)
        self.assertEqual(result, renderer)
    def test_it_with_registry(self):
        renderer = self.config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        result = self._callFUT('abc/def.pt', registry=self.config.registry)
        self.assertEqual(result, renderer)
@@ -634,7 +634,7 @@
        from pyramid.config import Configurator
        isolated_config = Configurator()
        renderer = isolated_config.testing_add_renderer(
            'pyramid.tests:abc/def.pt')
            'tests:abc/def.pt')
        result = self._callFUT('abc/def.pt', registry=isolated_config.registry)
        self.assertEqual(result, renderer)
tests/test_scaffolds/test_copydir.py
@@ -9,7 +9,7 @@
        from pyramid.compat import NativeIO
        self.dirname = tempfile.mkdtemp()
        self.out = NativeIO()
        self.fixturetuple = ('pyramid.tests.test_scaffolds',
        self.fixturetuple = ('tests.test_scaffolds',
                             'fixture_scaffold')
    def tearDown(self):
@@ -34,7 +34,7 @@
        self.assertTrue(
            'Copying fixture_scaffold/+package+/__init__.py_tmpl to' in result)
        source = pkg_resources.resource_filename(
            'pyramid.tests.test_scaffolds',
            'tests.test_scaffolds',
            'fixture_scaffold/+package+/__init__.py_tmpl')
        target = os.path.join(self.dirname, 'mypackage', '__init__.py')
        with open(target, 'r') as f:
@@ -55,7 +55,7 @@
        self.assertTrue('Creating' in result)
        self.assertTrue('Copying __init__.py_tmpl to' in result)
        source = pkg_resources.resource_filename(
            'pyramid.tests.test_scaffolds',
            'tests.test_scaffolds',
            'fixture_scaffold/+package+/__init__.py_tmpl')
        target = os.path.join(self.dirname, 'mypackage', '__init__.py')
        with open(target, 'r') as f:
@@ -328,8 +328,7 @@
        from pyramid.compat import NativeIO
        self.dirname = tempfile.mkdtemp()
        self.out = NativeIO()
        self.fixturetuple = ('pyramid.tests.test_scaffolds',
                             'fixture_scaffold')
        self.fixturetuple = ('tests.test_scaffolds', 'fixture_scaffold')
        self.src_content = """\
These are not the droids
that you are looking for."""
tests/test_scripts/test_prequest.py
@@ -1,5 +1,5 @@
import unittest
from pyramid.tests.test_scripts import dummy
from . import dummy
class TestPRequestCommand(unittest.TestCase):
    def _getTargetClass(self):
tests/test_scripts/test_proutes.py
@@ -1,6 +1,6 @@
import os
import unittest
from pyramid.tests.test_scripts import dummy
from . import dummy
class DummyIntrospector(object):
@@ -160,7 +160,7 @@
        compare_to = L[-1].split()[:3]
        self.assertEqual(
            compare_to,
            ['a', '/a', 'pyramid.tests.test_scripts.test_proutes.view']
            ['a', '/a', 'tests.test_scripts.test_proutes.view']
        )
    def test_one_route_with_long_name_one_view_registered(self):
@@ -202,7 +202,7 @@
            compare_to,
            ['very_long_name_123',
             '/and_very_long_pattern_as_well',
             'pyramid.tests.test_scripts.test_proutes.view']
             'tests.test_scripts.test_proutes.view']
        )
    def test_class_view(self):
@@ -228,7 +228,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.dummy.DummyView.view', 'POST'
            'tests.test_scripts.dummy.DummyView.view', 'POST'
        ]
        self.assertEqual(compare_to, expected)
@@ -296,8 +296,8 @@
        self.assertEqual(result, 0)
        self.assertEqual(len(L), 3)
        compare_to = L[-1].split()[:3]
        view_module = 'pyramid.tests.test_scripts.dummy'
        view_str = '<pyramid.tests.test_scripts.dummy.DummyMultiView'
        view_module = 'tests.test_scripts.dummy'
        view_str = '<tests.test_scripts.dummy.DummyMultiView'
        final = '%s.%s' % (view_module, view_str)
        self.assertEqual(
@@ -337,7 +337,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1', 'POST'
            'tests.test_scripts.test_proutes.view1', 'POST'
        ]
        self.assertEqual(compare_to, expected)
@@ -364,7 +364,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1', 'POST'
            'tests.test_scripts.test_proutes.view1', 'POST'
        ]
        self.assertEqual(compare_to, expected)
@@ -392,7 +392,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1', 'POST'
            'tests.test_scripts.test_proutes.view1', 'POST'
        ]
        self.assertEqual(compare_to, expected)
@@ -420,7 +420,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1',
            'tests.test_scripts.test_proutes.view1',
            '<route', 'mismatch>'
        ]
        self.assertEqual(compare_to, expected)
@@ -446,7 +446,7 @@
        expected = [
            ['__static/', '/static/*subpath',
             'pyramid.tests.test_scripts:static/', '*'],
             'tests.test_scripts:static/', '*'],
            ['__static2/', '/static2/*subpath', path2 + os.sep, '*'],
            ['__pyramid_scaffold/', '/pyramid_scaffold/*subpath',
             'pyramid:scaffolds/starter/+package+/static/',  '*'],
@@ -531,7 +531,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1',
            'tests.test_scripts.test_proutes.view1',
            'GET'
        ]
        self.assertEqual(compare_to, expected)
@@ -561,7 +561,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1',
            'tests.test_scripts.test_proutes.view1',
            '!POST,*'
        ]
        self.assertEqual(compare_to, expected)
@@ -602,7 +602,7 @@
        compare_to = L[-1].split()
        expected = [
            'foo', '/a/b',
            'pyramid.tests.test_scripts.test_proutes.view1',
            'tests.test_scripts.test_proutes.view1',
            '!POST,*'
        ]
        self.assertEqual(compare_to, expected)
tests/test_scripts/test_pserve.py
@@ -1,6 +1,6 @@
import os
import unittest
from pyramid.tests.test_scripts import dummy
from . import dummy
here = os.path.abspath(os.path.dirname(__file__))
@@ -55,7 +55,7 @@
        inst = self._makeOne('development.ini')
        loader = self.loader('/base/path.ini')
        loader.settings = {'pserve': {
            'watch_files': 'foo\n/baz\npyramid.tests.test_scripts:*.py',
            'watch_files': 'foo\n/baz\ntests.test_scripts:*.py',
        }}
        inst.pserve_file_config(loader, global_conf={'a': '1'})
        self.assertEqual(loader.calls[0]['defaults'], {
tests/test_scripts/test_pshell.py
@@ -1,6 +1,6 @@
import os
import unittest
from pyramid.tests.test_scripts import dummy
from . import dummy
class TestPShellCommand(unittest.TestCase):
tests/test_scripts/test_ptweens.py
@@ -1,5 +1,5 @@
import unittest
from pyramid.tests.test_scripts import dummy
from . import dummy
class TestPTweensCommand(unittest.TestCase):
    def _getTargetClass(self):
tests/test_scripts/test_pviews.py
@@ -1,5 +1,5 @@
import unittest
from pyramid.tests.test_scripts import dummy
from . import dummy
class TestPViewsCommand(unittest.TestCase):
    def _getTargetClass(self):
@@ -280,7 +280,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                         '    pyramid.tests.test_scripts.dummy.DummyView')
                         '    tests.test_scripts.dummy.DummyView')
    def test_views_command_single_view_function_traversal(self):
        from pyramid.registry import Registry
@@ -299,7 +299,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                         '    pyramid.tests.test_scripts.test_pviews.view')
                         '    tests.test_scripts.test_pviews.view')
    def test_views_command_single_view_traversal_with_permission(self):
        from pyramid.registry import Registry
@@ -318,7 +318,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                         '    pyramid.tests.test_scripts.dummy.DummyView')
                         '    tests.test_scripts.dummy.DummyView')
        self.assertEqual(L[9], '    required permission = test')
    def test_views_command_single_view_traversal_with_predicates(self):
@@ -340,7 +340,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                         '    pyramid.tests.test_scripts.dummy.DummyView')
                         '    tests.test_scripts.dummy.DummyView')
        self.assertEqual(L[9], '    view predicates (predicate = x)')
    def test_views_command_single_view_route(self):
@@ -366,7 +366,7 @@
        self.assertEqual(L[10], '    route path: /a')
        self.assertEqual(L[11], '    subpath: ')
        self.assertEqual(L[15],
                   '        pyramid.tests.test_scripts.dummy.DummyView')
                   '        tests.test_scripts.dummy.DummyView')
    def test_views_command_multi_view_nested(self):
        from pyramid.registry import Registry
@@ -390,9 +390,9 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                  '    pyramid.tests.test_scripts.dummy.DummyMultiView')
                  '    tests.test_scripts.dummy.DummyMultiView')
        self.assertEqual(L[12],
                  '        pyramid.tests.test_scripts.dummy.view1.call')
                  '        tests.test_scripts.dummy.view1.call')
    def test_views_command_single_view_route_with_route_predicates(self):
        from pyramid.registry import Registry
@@ -420,7 +420,7 @@
        self.assertEqual(L[11], '    subpath: ')
        self.assertEqual(L[12], '    route predicates (predicate = x)')
        self.assertEqual(L[16],
               '        pyramid.tests.test_scripts.dummy.DummyView')
               '        tests.test_scripts.dummy.DummyView')
    def test_views_command_multiview(self):
        from pyramid.registry import Registry
@@ -441,7 +441,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                     '    pyramid.tests.test_scripts.dummy.view.call')
                     '    tests.test_scripts.dummy.view.call')
    def test_views_command_multiview_with_permission(self):
        from pyramid.registry import Registry
@@ -463,7 +463,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                       '    pyramid.tests.test_scripts.dummy.view.call')
                       '    tests.test_scripts.dummy.view.call')
        self.assertEqual(L[9], '    required permission = test')
    def test_views_command_multiview_with_predicates(self):
@@ -488,7 +488,7 @@
        self.assertEqual(L[3], '    context: context')
        self.assertEqual(L[4], '    view name: a')
        self.assertEqual(L[8],
                         '    pyramid.tests.test_scripts.dummy.view.call')
                         '    tests.test_scripts.dummy.view.call')
        self.assertEqual(L[9], '    view predicates (predicate = x)')
class Test_main(unittest.TestCase):
tests/test_session.py
@@ -687,7 +687,7 @@
    def test_loads(self):
        # generated from dumping Dummy() using protocol=2
        cstruct = b'\x80\x02cpyramid.tests.test_session\nDummy\nq\x00)\x81q\x01.'
        cstruct = b'\x80\x02ctests.test_session\nDummy\nq\x00)\x81q\x01.'
        serializer = self._makeOne()
        result = serializer.loads(cstruct)
        self.assertIsInstance(result, Dummy)
tests/test_static.py
@@ -38,21 +38,21 @@
        self.assertEqual(inst.index, 'index.html')
    def test_call_adds_slash_path_info_empty(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':''})
        context = DummyContext()
        from pyramid.httpexceptions import HTTPMovedPermanently
        self.assertRaises(HTTPMovedPermanently, inst, context, request)
    def test_path_info_slash_means_index_html(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        context = DummyContext()
        response = inst(context, request)
        self.assertTrue(b'<html>static</html>' in response.body)
    def test_oob_singledot(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/./index.html'})
        context = DummyContext()
        response = inst(context, request)
@@ -60,7 +60,7 @@
        self.assertTrue(b'<html>static</html>' in response.body)
    def test_oob_emptyelement(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'//index.html'})
        context = DummyContext()
        response = inst(context, request)
@@ -68,14 +68,14 @@
        self.assertTrue(b'<html>static</html>' in response.body)
    def test_oob_dotdotslash(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/subdir/../../minimal.pt'})
        context = DummyContext()
        from pyramid.httpexceptions import HTTPNotFound
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_oob_dotdotslash_encoded(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest(
            {'PATH_INFO':'/subdir/%2E%2E%2F%2E%2E/minimal.pt'})
        context = DummyContext()
@@ -84,7 +84,7 @@
    def test_oob_os_sep(self):
        import os
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        dds = '..' + os.sep
        request = self._makeRequest({'PATH_INFO':'/subdir/%s%sminimal.pt' %
                                     (dds, dds)})
@@ -93,21 +93,21 @@
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_resource_doesnt_exist(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/notthere'})
        context = DummyContext()
        from pyramid.httpexceptions import HTTPNotFound
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_resource_isdir(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/subdir/'})
        context = DummyContext()
        response = inst(context, request)
        self.assertTrue(b'<html>subdir</html>' in response.body)
    def test_resource_is_file(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/index.html'})
        context = DummyContext()
        response = inst(context, request)
@@ -115,7 +115,7 @@
    def test_resource_is_file_with_wsgi_file_wrapper(self):
        from pyramid.response import _BLOCK_SIZE
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/index.html'})
        class _Wrapper(object):
            def __init__(self, file, block_size=None):
@@ -131,7 +131,7 @@
        app_iter.file.close()
    def test_resource_is_file_with_cache_max_age(self):
        inst = self._makeOne('pyramid.tests:fixtures/static', cache_max_age=600)
        inst = self._makeOne('tests:fixtures/static', cache_max_age=600)
        request = self._makeRequest({'PATH_INFO':'/index.html'})
        context = DummyContext()
        response = inst(context, request)
@@ -144,7 +144,7 @@
                          'Expires', 'Last-Modified'])
    def test_resource_is_file_with_no_cache_max_age(self):
        inst = self._makeOne('pyramid.tests:fixtures/static',
        inst = self._makeOne('tests:fixtures/static',
                             cache_max_age=None)
        request = self._makeRequest({'PATH_INFO':'/index.html'})
        context = DummyContext()
@@ -158,7 +158,7 @@
            ['Content-Length', 'Content-Type', 'Last-Modified'])
    def test_resource_notmodified(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/index.html'})
        request.if_modified_since = fiveyrsfuture
        context = DummyContext()
@@ -172,14 +172,14 @@
            app_iter.close()
    def test_not_found(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/notthere.html'})
        context = DummyContext()
        from pyramid.httpexceptions import HTTPNotFound
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_gz_resource_no_content_encoding(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/arcs.svg.tgz'})
        context = DummyContext()
        response = inst(context, request)
@@ -189,7 +189,7 @@
        response.app_iter.close()
    def test_resource_no_content_encoding(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':'/index.html'})
        context = DummyContext()
        response = inst(context, request)
@@ -230,7 +230,7 @@
        self.assertEqual(inst.index, 'index.html')
    def test_call_adds_slash_path_info_empty(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest({'PATH_INFO':''})
        request.subpath = ()
        context = DummyContext()
@@ -238,7 +238,7 @@
        self.assertRaises(HTTPMovedPermanently, inst, context, request)
    def test_path_info_slash_means_index_html(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ()
        context = DummyContext()
@@ -246,7 +246,7 @@
        self.assertTrue(b'<html>static</html>' in response.body)
    def test_oob_singledot(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('.', 'index.html')
        context = DummyContext()
@@ -254,7 +254,7 @@
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_oob_emptyelement(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('', 'index.html')
        context = DummyContext()
@@ -262,7 +262,7 @@
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_oob_dotdotslash(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('subdir', '..', '..', 'minimal.pt')
        context = DummyContext()
@@ -270,7 +270,7 @@
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_oob_dotdotslash_encoded(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('subdir', '%2E%2E', '%2E%2E', 'minimal.pt')
        context = DummyContext()
@@ -279,7 +279,7 @@
    def test_oob_os_sep(self):
        import os
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        dds = '..' + os.sep
        request = self._makeRequest()
        request.subpath = ('subdir', dds, dds, 'minimal.pt')
@@ -288,7 +288,7 @@
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_resource_doesnt_exist(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('notthere,')
        context = DummyContext()
@@ -296,7 +296,7 @@
        self.assertRaises(HTTPNotFound, inst, context, request)
    def test_resource_isdir(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('subdir',)
        context = DummyContext()
@@ -304,7 +304,7 @@
        self.assertTrue(b'<html>subdir</html>' in response.body)
    def test_resource_is_file(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('index.html',)
        context = DummyContext()
@@ -312,7 +312,7 @@
        self.assertTrue(b'<html>static</html>' in response.body)
    def test_resource_is_file_with_cache_max_age(self):
        inst = self._makeOne('pyramid.tests:fixtures/static', cache_max_age=600)
        inst = self._makeOne('tests:fixtures/static', cache_max_age=600)
        request = self._makeRequest()
        request.subpath = ('index.html',)
        context = DummyContext()
@@ -326,7 +326,7 @@
                          'Expires', 'Last-Modified'])
    def test_resource_is_file_with_no_cache_max_age(self):
        inst = self._makeOne('pyramid.tests:fixtures/static',
        inst = self._makeOne('tests:fixtures/static',
                             cache_max_age=None)
        request = self._makeRequest()
        request.subpath = ('index.html',)
@@ -341,7 +341,7 @@
            ['Content-Length', 'Content-Type', 'Last-Modified'])
    def test_resource_notmodified(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.if_modified_since = fiveyrsfuture
        request.subpath = ('index.html',)
@@ -356,7 +356,7 @@
            app_iter.close()
    def test_not_found(self):
        inst = self._makeOne('pyramid.tests:fixtures/static')
        inst = self._makeOne('tests:fixtures/static')
        request = self._makeRequest()
        request.subpath = ('notthere.html',)
        context = DummyContext()
@@ -423,7 +423,7 @@
            ('css/main-test.css', {}))
    def test_it_with_absspec(self):
        fut = self._makeOne('pyramid.tests:fixtures/manifest.json')
        fut = self._makeOne('tests:fixtures/manifest.json')
        self.assertEqual(fut('foo', 'bar', {}), ('bar', {}))
        self.assertEqual(
            fut('foo', 'css/main.css', {}),
tests/test_testing.py
@@ -340,7 +340,7 @@
        self.assertEqual(config.registry, current['registry'])
        self.assertEqual(current['registry'].__class__, Registry)
        self.assertEqual(current['request'], None)
        self.assertEqual(config.package.__name__, 'pyramid.tests')
        self.assertEqual(config.package.__name__, 'tests')
        self._assertSMHook(get_current_registry)
    def test_it_with_registry(self):
tests/test_url.py
@@ -739,17 +739,17 @@
        result = request.static_url('static/foo.css')
        self.assertEqual(result, 'abc')
        self.assertEqual(info.args,
                         ('pyramid.tests:static/foo.css', request, {}) )
                         ('tests:static/foo.css', request, {}) )
    def test_static_url_abs(self):
        from pyramid.interfaces import IStaticURLInfo
        request = self._makeOne()
        info = DummyStaticURLInfo('abc')
        request.registry.registerUtility(info, IStaticURLInfo)
        result = request.static_url('pyramid.tests:static/foo.css')
        result = request.static_url('tests:static/foo.css')
        self.assertEqual(result, 'abc')
        self.assertEqual(info.args,
                         ('pyramid.tests:static/foo.css', request, {}) )
                         ('tests:static/foo.css', request, {}) )
    def test_static_url_found_abs_no_registry_on_request(self):
        from pyramid.interfaces import IStaticURLInfo
@@ -758,10 +758,10 @@
        info = DummyStaticURLInfo('abc')
        registry.registerUtility(info, IStaticURLInfo)
        del request.registry
        result = request.static_url('pyramid.tests:static/foo.css')
        result = request.static_url('tests:static/foo.css')
        self.assertEqual(result, 'abc')
        self.assertEqual(info.args,
                         ('pyramid.tests:static/foo.css', request, {}) )
                         ('tests:static/foo.css', request, {}) )
    def test_static_url_abspath_integration_with_staticurlinfo(self):
        from pyramid.interfaces import IStaticURLInfo
@@ -814,7 +814,7 @@
        result = request.static_path('static/foo.css')
        self.assertEqual(result, 'abc')
        self.assertEqual(info.args,
                         ('pyramid.tests:static/foo.css', request,
                         ('tests:static/foo.css', request,
                          {'_app_url':'/foo'})
                         )
@@ -824,10 +824,10 @@
        request.script_name = '/foo'
        info = DummyStaticURLInfo('abc')
        request.registry.registerUtility(info, IStaticURLInfo)
        result = request.static_path('pyramid.tests:static/foo.css')
        result = request.static_path('tests:static/foo.css')
        self.assertEqual(result, 'abc')
        self.assertEqual(info.args,
                         ('pyramid.tests:static/foo.css', request,
                         ('tests:static/foo.css', request,
                          {'_app_url':'/foo'})
                         )
@@ -840,7 +840,7 @@
        result = request.static_path('static/foo.css')
        self.assertEqual(result, 'abc')
        self.assertEqual(info.args,
                         ('pyramid.tests:static/foo.css', request,
                         ('tests:static/foo.css', request,
                          {'_app_url':'/foo'})
                         )
@@ -1103,7 +1103,7 @@
        request = self._makeRequest()
        result = self._callFUT('abc', request, _app_url='')
        self.assertEqual(result, 'static url')
        self.assertEqual(request.path, 'pyramid.tests:abc')
        self.assertEqual(request.path, 'tests:abc')
        self.assertEqual(request.kw, {'_app_url':''})
class Test_static_path(unittest.TestCase):
@@ -1137,7 +1137,7 @@
        request = self._makeRequest()
        result = self._callFUT('abc', request, _app_url='')
        self.assertEqual(result, 'static path')
        self.assertEqual(request.path, 'pyramid.tests:abc')
        self.assertEqual(request.path, 'tests:abc')
        self.assertEqual(request.kw, {'_app_url':''})
class Test_current_route_url(unittest.TestCase):
tests/test_util.py
@@ -299,11 +299,11 @@
    def test_new_class_keeps_parent_module_name(self):
        foo = self._makeOne()
        self.assertEqual(foo.__module__, 'pyramid.tests.test_util')
        self.assertEqual(foo.__class__.__module__, 'pyramid.tests.test_util')
        self.assertEqual(foo.__module__, 'tests.test_util')
        self.assertEqual(foo.__class__.__module__, 'tests.test_util')
        foo.set_property(lambda _: 1, name='x', reify=True)
        self.assertEqual(foo.__module__, 'pyramid.tests.test_util')
        self.assertEqual(foo.__class__.__module__, 'pyramid.tests.test_util')
        self.assertEqual(foo.__module__, 'tests.test_util')
        self.assertEqual(foo.__class__.__module__, 'tests.test_util')
class Test_WeakOrderedSet(unittest.TestCase):
    def _makeOne(self):
@@ -469,18 +469,18 @@
    def test_method(self):
        self.assertEqual(
            self._callFUT(self.test_method),
            'method test_method of class pyramid.tests.test_util.'
            'method test_method of class tests.test_util.'
            'Test_object_description')
    def test_class(self):
        self.assertEqual(
            self._callFUT(self.__class__),
            'class pyramid.tests.test_util.Test_object_description')
            'class tests.test_util.Test_object_description')
    def test_function(self):
        self.assertEqual(
            self._callFUT(dummyfunc),
            'function pyramid.tests.test_util.dummyfunc')
            'function tests.test_util.dummyfunc')
    def test_instance(self):
        inst = Dummy()
tests/test_view.py
@@ -545,7 +545,7 @@
        self.assertEqual(settings[0]['custom_predicates'], (1,))
    def test_call_with_renderer_string(self):
        import pyramid.tests
        import tests
        decorator = self._makeOne(renderer='fixtures/minimal.pt')
        venusian = DummyVenusian()
        decorator.venusian = venusian
@@ -557,10 +557,10 @@
        self.assertEqual(len(settings), 1)
        renderer = settings[0]['renderer']
        self.assertEqual(renderer, 'fixtures/minimal.pt')
        self.assertEqual(config.pkg, pyramid.tests)
        self.assertEqual(config.pkg, tests)
    def test_call_with_renderer_dict(self):
        import pyramid.tests
        import tests
        decorator = self._makeOne(renderer={'a':1})
        venusian = DummyVenusian()
        decorator.venusian = venusian
@@ -571,10 +571,10 @@
        settings = config.settings
        self.assertEqual(len(settings), 1)
        self.assertEqual(settings[0]['renderer'], {'a':1})
        self.assertEqual(config.pkg, pyramid.tests)
        self.assertEqual(config.pkg, tests)
    def test_call_with_renderer_IRendererInfo(self):
        import pyramid.tests
        import tests
        from pyramid.interfaces import IRendererInfo
        @implementer(IRendererInfo)
        class DummyRendererHelper(object):
@@ -592,7 +592,7 @@
        self.assertEqual(len(settings), 1)
        renderer = settings[0]['renderer']
        self.assertTrue(renderer is renderer_helper)
        self.assertEqual(config.pkg, pyramid.tests)
        self.assertEqual(config.pkg, tests)
    def test_call_withdepth(self):
        decorator = self._makeOne(_depth=1)
@@ -1027,7 +1027,7 @@
class DummyVenusianInfo(object):
    scope = 'notaclass'
    module = sys.modules['pyramid.tests']
    module = sys.modules['tests']
    codeinfo = 'codeinfo'
class DummyVenusian(object):
tests/test_viewderivers.py
@@ -47,7 +47,7 @@
            self.assertEqual(
                e.args[0],
                'Could not convert return value of the view callable function '
                'pyramid.tests.test_viewderivers.view into a response '
                'tests.test_viewderivers.view into a response '
                'object. The value returned was None. You may have forgotten '
                'to return a value from the view callable.'
                )
@@ -65,7 +65,7 @@
            self.assertEqual(
                e.args[0],
                "Could not convert return value of the view callable function "
                "pyramid.tests.test_viewderivers.view into a response "
                "tests.test_viewderivers.view into a response "
                "object. The value returned was {'a': 1}. You may have "
                "forgotten to define a renderer in the view configuration."
                )
@@ -85,7 +85,7 @@
            msg = e.args[0]
            self.assertTrue(msg.startswith(
                'Could not convert return value of the view callable object '
                '<pyramid.tests.test_viewderivers.'))
                '<tests.test_viewderivers.'))
            self.assertTrue(msg.endswith(
                '> into a response object. The value returned was None. You '
                'may have forgotten to return a value from the view callable.'))
@@ -129,7 +129,7 @@
                e.args[0],
                'Could not convert return value of the view callable '
                'method __call__ of '
                'class pyramid.tests.test_viewderivers.AView into a '
                'class tests.test_viewderivers.AView into a '
                'response object. The value returned was None. You may have '
                'forgotten to return a value from the view callable.'
                )
@@ -152,7 +152,7 @@
                e.args[0],
                'Could not convert return value of the view callable '
                'method theviewmethod of '
                'class pyramid.tests.test_viewderivers.AView into a '
                'class tests.test_viewderivers.AView into a '
                'response object. The value returned was None. You may have '
                'forgotten to return a value from the view callable.'
                )