diff options
author | Jason Madden <jamadden@gmail.com> | 2018-10-16 09:36:08 -0500 |
---|---|---|
committer | Jason Madden <jamadden@gmail.com> | 2018-10-16 09:36:08 -0500 |
commit | 41a17e50eb506016836de01743befa0867f22814 (patch) | |
tree | 750263ca1a9d9cb0c471012e6556b24cb9a74295 | |
parent | cfaa1fa9f3bed5758b3d8c5a01959bd0ab6295ff (diff) | |
download | zope-traversing-issue10.tar.gz |
Fix deprecation warnings.issue10
Fixes #10
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CHANGES.rst | 8 | ||||
-rw-r--r-- | setup.py | 2 | ||||
-rw-r--r-- | src/zope/traversing/browser/tests.py | 15 | ||||
-rw-r--r-- | src/zope/traversing/namespace.py | 2 | ||||
-rw-r--r-- | src/zope/traversing/tests/test_conveniencefunctions.py | 7 | ||||
-rw-r--r-- | src/zope/traversing/tests/test_namespacetrversal.py | 7 |
7 files changed, 27 insertions, 15 deletions
@@ -11,5 +11,6 @@ develop-eggs/ eggs/ parts/ .coverage +.coverage.* htmlcov/ docs/_build/ diff --git a/CHANGES.rst b/CHANGES.rst index 79076a8..c99bcb4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,10 +2,12 @@ Changes ========= -4.4 (unreleased) -================ +4.3.1 (unreleased) +================== -- Nothing changed yet. +- Fix DeprecationWarnings for ``ComponentLookupError`` by + importing them from ``zope.interface.interfaces``. See `issue 10 + <https://github.com/zopefoundation/zope.traversing/issues/10>`_. 4.3 (2018-10-05) @@ -44,7 +44,7 @@ TESTS_REQUIRE = [ setup( name='zope.traversing', - version='4.4.dev0', + version='4.3.1.dev0', url='https://github.com/zopefoundation/zope.traversing', license='ZPL 2.1', author='Zope Foundation and Contributors', diff --git a/src/zope/traversing/browser/tests.py b/src/zope/traversing/browser/tests.py index 861cb9c..51c58dd 100644 --- a/src/zope/traversing/browser/tests.py +++ b/src/zope/traversing/browser/tests.py @@ -73,6 +73,9 @@ class FooLocation(object): class TestAbsoluteURL(PlacelessSetup, unittest.TestCase): + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + getattr(unittest.TestCase, 'assertRaisesRegexp')) + def setUp(self): PlacelessSetup.setUp(self) from zope.traversing.browser import AbsoluteURL, SiteAbsoluteURL @@ -306,8 +309,8 @@ class TestAbsoluteURL(PlacelessSetup, unittest.TestCase): def test_breadcrumbs_no_parent(self): view = AbsoluteURL(self, None) - with self.assertRaisesRegexp(TypeError, - "There isn't enough context"): + with self.assertRaisesRegex(TypeError, + "There isn't enough context"): view.breadcrumbs() def test_nameless_context(self): @@ -343,8 +346,8 @@ class TestAbsoluteURL(PlacelessSetup, unittest.TestCase): # First the view view = AbsoluteURL(context, request) - with self.assertRaisesRegexp(TypeError, - "There isn't enough context"): + with self.assertRaisesRegex(TypeError, + "There isn't enough context"): str(view) self.assertTrue(DummyAbsoluteURL.called) @@ -352,8 +355,8 @@ class TestAbsoluteURL(PlacelessSetup, unittest.TestCase): # Now the breadcrumbs view = AbsoluteURL(context, request) - with self.assertRaisesRegexp(TypeError, - "There isn't enough context"): + with self.assertRaisesRegex(TypeError, + "There isn't enough context"): view.breadcrumbs() self.assertTrue(DummyAbsoluteURL.called) diff --git a/src/zope/traversing/namespace.py b/src/zope/traversing/namespace.py index 8cb2527..fdea21a 100644 --- a/src/zope/traversing/namespace.py +++ b/src/zope/traversing/namespace.py @@ -67,7 +67,7 @@ import six import zope.component import zope.interface from zope.i18n.interfaces import IModifiableUserPreferredLanguages -from zope.component.interfaces import ComponentLookupError +from zope.interface.interfaces import ComponentLookupError from zope.interface import providedBy, directlyProvides from zope.location.interfaces import LocationError from zope.publisher.interfaces.browser import IBrowserSkinType diff --git a/src/zope/traversing/tests/test_conveniencefunctions.py b/src/zope/traversing/tests/test_conveniencefunctions.py index be50c6a..c0b9b6d 100644 --- a/src/zope/traversing/tests/test_conveniencefunctions.py +++ b/src/zope/traversing/tests/test_conveniencefunctions.py @@ -384,6 +384,9 @@ class TestStandalone(unittest.TestCase): # Unlike TestFunctional, we don't register gobs of # adapters, making these tests more self-contained + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + getattr(unittest.TestCase, 'assertRaisesRegexp')) + def test_getParent_no_location_info(self): from zope.traversing.api import getParent test = self @@ -395,8 +398,8 @@ class TestStandalone(unittest.TestCase): raise TypeError() context = Context() - with self.assertRaisesRegexp(TypeError, - "Not enough context"): + with self.assertRaisesRegex(TypeError, + "Not enough context"): getParent(context) self.assertTrue(context.called) diff --git a/src/zope/traversing/tests/test_namespacetrversal.py b/src/zope/traversing/tests/test_namespacetrversal.py index cfd2e31..5f91195 100644 --- a/src/zope/traversing/tests/test_namespacetrversal.py +++ b/src/zope/traversing/tests/test_namespacetrversal.py @@ -123,9 +123,12 @@ class TestView(unittest.TestCase): class TestVh(unittest.TestCase): + assertRaisesRegex = getattr(unittest.TestCase, 'assertRaisesRegex', + getattr(unittest.TestCase, 'assertRaisesRegexp')) + def test_invalid_vh(self): - with self.assertRaisesRegexp(ValueError, - 'Vhost directive should have the form'): + with self.assertRaisesRegex(ValueError, + 'Vhost directive should have the form'): namespace.vh(None, None).traverse(u'invalid name', ()) def test_suite(): |