diff options
| -rw-r--r-- | CHANGES.txt | 4 | ||||
| -rw-r--r-- | pyramid/configuration.py | 60 | ||||
| -rw-r--r-- | pyramid/tests/test_configuration.py | 31 | ||||
| -rw-r--r-- | pyramid/tests/test_path.py | 6 |
4 files changed, 7 insertions, 94 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index bbe723476..b93a02193 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -183,6 +183,10 @@ Backwards Incompatibilities ``pyramid.renderers.render()`` or ``pyramid.renderers.render_to_response`` respectively instead of these functions. +- The ``pyramid.configuration`` module was removed. It had been deprecated + since Pyramid 1.0 and printed a deprecation warning upon its use. Use + ``pyramid.config`` instead. + Dependencies ------------ diff --git a/pyramid/configuration.py b/pyramid/configuration.py deleted file mode 100644 index 802c10d1f..000000000 --- a/pyramid/configuration.py +++ /dev/null @@ -1,60 +0,0 @@ -from pyramid.config import Configurator as BaseConfigurator -from pyramid.exceptions import ConfigurationError # API -from pyramid.config import DEFAULT_RENDERERS -from pyramid.path import caller_package - -from zope.deprecation import deprecated - -ConfigurationError = ConfigurationError # pyflakes - -deprecated( - 'ConfigurationError', - 'pyramid.configuration.ConfigurationError is deprecated as of ' - 'Pyramid 1.0. Use ``pyramid.config.ConfigurationError`` instead.') - -class Configurator(BaseConfigurator): - def __init__(self, - registry=None, - package=None, - settings=None, - root_factory=None, - authentication_policy=None, - authorization_policy=None, - renderers=DEFAULT_RENDERERS, - debug_logger=None, - locale_negotiator=None, - request_factory=None, - renderer_globals_factory=None, - default_permission=None, - session_factory=None, - autocommit=True, - route_prefix=None, - introspection=True, - ): - if package is None: - package = caller_package() - BaseConfigurator.__init__( - self, - registry=registry, - package=package, - settings=settings, - root_factory=root_factory, - authentication_policy=authentication_policy, - authorization_policy=authorization_policy, - renderers=renderers, - debug_logger=debug_logger, - locale_negotiator=locale_negotiator, - request_factory=request_factory, - renderer_globals_factory=renderer_globals_factory, - default_permission=default_permission, - session_factory=session_factory, - autocommit=autocommit, - route_prefix=route_prefix, - introspection=introspection, - ) - -deprecated( - 'Configurator', - 'pyramid.configuration.Configurator is deprecated as of Pyramid 1.0. Use' - '``pyramid.config.Configurator`` with ``autocommit=True`` instead.') - diff --git a/pyramid/tests/test_configuration.py b/pyramid/tests/test_configuration.py deleted file mode 100644 index 0a98bcb5c..000000000 --- a/pyramid/tests/test_configuration.py +++ /dev/null @@ -1,31 +0,0 @@ -import unittest - -class ConfiguratorTests(unittest.TestCase): - def setUp(self): - from zope.deprecation import __show__ - __show__.off() - - def tearDown(self): - from zope.deprecation import __show__ - __show__.on() - - def _makeOne(self, *arg, **kw): - from pyramid.configuration import Configurator - return Configurator(*arg, **kw) - - def test_autocommit_true(self): - config = self._makeOne() - self.assertEqual(config.autocommit, True) - - def test_package_is_not_None(self): - import pyramid - config = self._makeOne(package='pyramid') - self.assertEqual(config.package, pyramid) - - def test_with_package(self): - import pyramid - config = self._makeOne() - newconfig = config.with_package('pyramid') - self.assertEqual(newconfig.package, pyramid) - - diff --git a/pyramid/tests/test_path.py b/pyramid/tests/test_path.py index ccc56fb0d..a07ebeffa 100644 --- a/pyramid/tests/test_path.py +++ b/pyramid/tests/test_path.py @@ -138,9 +138,9 @@ class TestPackageOf(unittest.TestCase): self.assertEqual(result, tests) def test_it_module(self): - import pyramid.tests.test_configuration + import pyramid.tests.test_path from pyramid import tests - package = DummyPackageOrModule(pyramid.tests.test_configuration) + package = DummyPackageOrModule(pyramid.tests.test_path) result = self._callFUT(package) self.assertEqual(result, tests) @@ -395,7 +395,7 @@ class TestDottedNameResolver(unittest.TestCase): self.assertEqual(result, self.__class__) def test__zope_dottedname_style_resolve_relative_leading_dots(self): - import pyramid.tests.test_configuration + import pyramid.tests.test_path typ = self._makeOne() result = typ._zope_dottedname_style( '..tests.test_path.TestDottedNameResolver', pyramid.tests) |
