Merge ~cjwatson/lazr.restful:doctest-remove-py2-exception-module into lazr.restful:main

Proposed by Colin Watson
Status: Merged
Merged at revision: cd81ba19bcaa566376c6419e5a88368c8cb28d5a
Proposed branch: ~cjwatson/lazr.restful:doctest-remove-py2-exception-module
Merge into: lazr.restful:main
Diff against target: 522 lines (+47/-87)
11 files modified
src/lazr/restful/docs/fields.rst (+0/-4)
src/lazr/restful/docs/interface.rst (+0/-1)
src/lazr/restful/docs/multiversion.rst (+8/-9)
src/lazr/restful/docs/webservice-declarations.rst (+29/-32)
src/lazr/restful/docs/webservice.rst (+6/-10)
src/lazr/restful/example/base/tests/representation-cache.txt (+0/-1)
src/lazr/restful/example/base/tests/test_integration.py (+1/-8)
src/lazr/restful/example/base/tests/traversal.txt (+0/-1)
src/lazr/restful/example/base_extended/tests/test_integration.py (+1/-7)
src/lazr/restful/example/multiversion/tests/test_integration.py (+1/-7)
src/lazr/restful/example/wsgi/tests/test_integration.py (+1/-7)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+437162@code.launchpad.net

Commit message

Remove all uses of IGNORE_EXCEPTION_MODULE_IN_PYTHON2

Description of the change

This is no longer needed now that we require Python 3.

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/src/lazr/restful/docs/fields.rst b/src/lazr/restful/docs/fields.rst
index 869eb20..5ba2e0f 100644
--- a/src/lazr/restful/docs/fields.rst
+++ b/src/lazr/restful/docs/fields.rst
@@ -43,7 +43,6 @@ elements.
43But if the object isn't iterable, NotAContainer is raised.43But if the object isn't iterable, NotAContainer is raised.
4444
45 >>> int_collection.validate(object())45 >>> int_collection.validate(object())
46 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
47 Traceback (most recent call last):46 Traceback (most recent call last):
48 ...47 ...
49 zope.schema._bootstrapinterfaces.NotAContainer: <object...>48 zope.schema._bootstrapinterfaces.NotAContainer: <object...>
@@ -51,7 +50,6 @@ But if the object isn't iterable, NotAContainer is raised.
51If the iterable contains an invalid item, WrongContainedType is raised.50If the iterable contains an invalid item, WrongContainedType is raised.
5251
53 >>> int_collection.validate(['a', 1, 2, 'b'])52 >>> int_collection.validate(['a', 1, 2, 'b'])
54 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
55 Traceback (most recent call last):53 Traceback (most recent call last):
56 ...54 ...
57 zope.schema._bootstrapinterfaces.WrongContainedType: ...55 zope.schema._bootstrapinterfaces.WrongContainedType: ...
@@ -79,7 +77,6 @@ by value, but only check that the value provides the proper schema.
79 ... pass77 ... pass
80 >>> fake = Fake()78 >>> fake = Fake()
81 >>> reference.validate(fake)79 >>> reference.validate(fake)
82 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
83 Traceback (most recent call last):80 Traceback (most recent call last):
84 ...81 ...
85 zope.schema._bootstrapinterfaces.SchemaNotProvided: ...82 zope.schema._bootstrapinterfaces.SchemaNotProvided: ...
@@ -95,7 +92,6 @@ The Reference field supports the standard IField constraint.
9592
96 >>> fake.a_value = 'bad'93 >>> fake.a_value = 'bad'
97 >>> reference.validate(fake)94 >>> reference.validate(fake)
98 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
99 Traceback (most recent call last):95 Traceback (most recent call last):
100 ...96 ...
101 zope.schema._bootstrapinterfaces.ConstraintNotSatisfied: ...97 zope.schema._bootstrapinterfaces.ConstraintNotSatisfied: ...
diff --git a/src/lazr/restful/docs/interface.rst b/src/lazr/restful/docs/interface.rst
index afcd439..1fdf251 100644
--- a/src/lazr/restful/docs/interface.rst
+++ b/src/lazr/restful/docs/interface.rst
@@ -174,7 +174,6 @@ If the value for an overridden field is invalid, an exception will be
174raised:174raised:
175175
176 >>> copy_field(MyModel['age'], title=b'This should be unicode')176 >>> copy_field(MyModel['age'], title=b'This should be unicode')
177 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
178 Traceback (most recent call last):177 Traceback (most recent call last):
179 ...178 ...
180 zope.schema._bootstrapinterfaces.WrongType: ...179 zope.schema._bootstrapinterfaces.WrongType: ...
diff --git a/src/lazr/restful/docs/multiversion.rst b/src/lazr/restful/docs/multiversion.rst
index d3c95d3..d1f3863 100644
--- a/src/lazr/restful/docs/multiversion.rst
+++ b/src/lazr/restful/docs/multiversion.rst
@@ -408,7 +408,6 @@ you can't just adapt Contact to IEntry.
408 >>> from zope.component import getAdapter408 >>> from zope.component import getAdapter
409409
410 >>> getAdapter(C1, IEntry)410 >>> getAdapter(C1, IEntry)
411 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
412 Traceback (most recent call last):411 Traceback (most recent call last):
413 ...412 ...
414 zope.interface.interfaces.ComponentLookupError: ...413 zope.interface.interfaces.ComponentLookupError: ...
@@ -788,10 +787,10 @@ service will fail.
788787
789 >>> request = create_web_service_request('/1.0/contact_list')788 >>> request = create_web_service_request('/1.0/contact_list')
790 >>> resource = request.traverse(None)789 >>> resource = request.traverse(None)
791 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
792 Traceback (most recent call last):790 Traceback (most recent call last):
793 ...791 ...
794 zope.publisher.interfaces.NotFound: Object: <PostBetaServiceRootResource...>, name: ...'contact_list'792 zope.publisher.interfaces.NotFound:
793 Object: <PostBetaServiceRootResource...>, name: ...'contact_list'
795794
796Here's the contact list under its correct URL.795Here's the contact list under its correct URL.
797796
@@ -842,10 +841,10 @@ to traverse to its 'beta' name ('fax') will fail.
842 >>> request_10 = create_web_service_request(841 >>> request_10 = create_web_service_request(
843 ... '/1.0/contacts/Cleo Python/fax')842 ... '/1.0/contacts/Cleo Python/fax')
844 >>> field = request_10.traverse(None)843 >>> field = request_10.traverse(None)
845 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
846 Traceback (most recent call last):844 Traceback (most recent call last):
847 ...845 ...
848 zope.publisher.interfaces.NotFound: Object: <Contact object...>, name: ...'fax'846 zope.publisher.interfaces.NotFound:
847 Object: <Contact object...>, name: ...'fax'
849848
850We can invoke a named operation. Note that the name of the operation849We can invoke a named operation. Note that the name of the operation
851is now 'find' (it was 'findContacts' in 'beta'). And note that850is now 'find' (it was 'findContacts' in 'beta'). And note that
@@ -960,18 +959,18 @@ version.
960 >>> request_beta = create_web_service_request(959 >>> request_beta = create_web_service_request(
961 ... '/dev/contacts/Cleo Python/fax')960 ... '/dev/contacts/Cleo Python/fax')
962 >>> field = request_beta.traverse(None)961 >>> field = request_beta.traverse(None)
963 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
964 Traceback (most recent call last):962 Traceback (most recent call last):
965 ...963 ...
966 zope.publisher.interfaces.NotFound: Object: <Contact object...>, name: ...'fax'964 zope.publisher.interfaces.NotFound:
965 Object: <Contact object...>, name: ...'fax'
967966
968 >>> request_beta = create_web_service_request(967 >>> request_beta = create_web_service_request(
969 ... '/dev/contacts/Cleo Python/fax_number')968 ... '/dev/contacts/Cleo Python/fax_number')
970 >>> field = request_beta.traverse(None)969 >>> field = request_beta.traverse(None)
971 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
972 Traceback (most recent call last):970 Traceback (most recent call last):
973 ...971 ...
974 zope.publisher.interfaces.NotFound: Object: <Contact object...>, name: ...'fax_number'972 zope.publisher.interfaces.NotFound:
973 Object: <Contact object...>, name: ...'fax_number'
975974
976We can invoke a named operation.975We can invoke a named operation.
977976
diff --git a/src/lazr/restful/docs/webservice-declarations.rst b/src/lazr/restful/docs/webservice-declarations.rst
index be31dde..41826d7 100644
--- a/src/lazr/restful/docs/webservice-declarations.rst
+++ b/src/lazr/restful/docs/webservice-declarations.rst
@@ -1658,20 +1658,20 @@ can neither get nor set attributes.
1658 >>> _ = multiple_scopes_method_adapter.call()1658 >>> _ = multiple_scopes_method_adapter.call()
1659 multiple_scopes called1659 multiple_scopes called
1660 >>> _ = unscoped_method_adapter.call()1660 >>> _ = unscoped_method_adapter.call()
1661 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1662 Traceback (most recent call last):1661 Traceback (most recent call last):
1663 ...1662 ...
1664 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1663 zope.security.interfaces.Unauthorized: Current authentication only allows
1664 calling scoped methods.
1665 >>> print(scoped_entry_adapter.value)1665 >>> print(scoped_entry_adapter.value)
1666 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1667 Traceback (most recent call last):1666 Traceback (most recent call last):
1668 ...1667 ...
1669 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1668 zope.security.interfaces.Unauthorized: Current authentication only allows
1669 calling scoped methods.
1670 >>> scoped_entry_adapter.value = 'set by scoped user'1670 >>> scoped_entry_adapter.value = 'set by scoped user'
1671 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1672 Traceback (most recent call last):1671 Traceback (most recent call last):
1673 ...1672 ...
1674 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1673 zope.security.interfaces.Unauthorized: Current authentication only allows
1674 calling scoped methods.
16751675
1676A user with one scope can only call the methods tagged with that scope, and1676A user with one scope can only call the methods tagged with that scope, and
1677can neither get nor set attributes.1677can neither get nor set attributes.
@@ -1680,53 +1680,53 @@ can neither get nor set attributes.
1680 >>> _ = get_info_method_adapter.call()1680 >>> _ = get_info_method_adapter.call()
1681 get_info called1681 get_info called
1682 >>> _ = do_update_method_adapter.call()1682 >>> _ = do_update_method_adapter.call()
1683 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1684 Traceback (most recent call last):1683 Traceback (most recent call last):
1685 ...1684 ...
1686 zope.security.interfaces.Unauthorized: Current authentication does not allow calling this method (one of these scopes is required: 'update').1685 zope.security.interfaces.Unauthorized: Current authentication does not
1686 allow calling this method (one of these scopes is required: 'update').
1687 >>> _ = multiple_scopes_method_adapter.call()1687 >>> _ = multiple_scopes_method_adapter.call()
1688 multiple_scopes called1688 multiple_scopes called
1689 >>> _ = unscoped_method_adapter.call()1689 >>> _ = unscoped_method_adapter.call()
1690 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1691 Traceback (most recent call last):1690 Traceback (most recent call last):
1692 ...1691 ...
1693 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1692 zope.security.interfaces.Unauthorized: Current authentication only allows
1693 calling scoped methods.
1694 >>> print(scoped_entry_adapter.value)1694 >>> print(scoped_entry_adapter.value)
1695 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1696 Traceback (most recent call last):1695 Traceback (most recent call last):
1697 ...1696 ...
1698 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1697 zope.security.interfaces.Unauthorized: Current authentication only allows
1698 calling scoped methods.
1699 >>> scoped_entry_adapter.value = 'set by scoped user'1699 >>> scoped_entry_adapter.value = 'set by scoped user'
1700 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1701 Traceback (most recent call last):1700 Traceback (most recent call last):
1702 ...1701 ...
1703 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1702 zope.security.interfaces.Unauthorized: Current authentication only allows
1703 calling scoped methods.
17041704
1705 >>> config._scopes = ['update']1705 >>> config._scopes = ['update']
1706 >>> _ = get_info_method_adapter.call()1706 >>> _ = get_info_method_adapter.call()
1707 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1708 Traceback (most recent call last):1707 Traceback (most recent call last):
1709 ...1708 ...
1710 zope.security.interfaces.Unauthorized: Current authentication does not allow calling this method (one of these scopes is required: 'read').1709 zope.security.interfaces.Unauthorized: Current authentication does not
1710 allow calling this method (one of these scopes is required: 'read').
1711 >>> _ = do_update_method_adapter.call()1711 >>> _ = do_update_method_adapter.call()
1712 do_update called1712 do_update called
1713 >>> _ = multiple_scopes_method_adapter.call()1713 >>> _ = multiple_scopes_method_adapter.call()
1714 multiple_scopes called1714 multiple_scopes called
1715 >>> _ = unscoped_method_adapter.call()1715 >>> _ = unscoped_method_adapter.call()
1716 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1717 Traceback (most recent call last):1716 Traceback (most recent call last):
1718 ...1717 ...
1719 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1718 zope.security.interfaces.Unauthorized: Current authentication only allows
1719 calling scoped methods.
1720 >>> print(scoped_entry_adapter.value)1720 >>> print(scoped_entry_adapter.value)
1721 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1722 Traceback (most recent call last):1721 Traceback (most recent call last):
1723 ...1722 ...
1724 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1723 zope.security.interfaces.Unauthorized: Current authentication only allows
1724 calling scoped methods.
1725 >>> scoped_entry_adapter.value = 'set by scoped user'1725 >>> scoped_entry_adapter.value = 'set by scoped user'
1726 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1727 Traceback (most recent call last):1726 Traceback (most recent call last):
1728 ...1727 ...
1729 zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods.1728 zope.security.interfaces.Unauthorized: Current authentication only allows
1729 calling scoped methods.
17301730
1731 >>> config._scopes = None1731 >>> config._scopes = None
17321732
@@ -2843,10 +2843,12 @@ An attempt to register this module with ZCML results in an error
2843explaining the problem.2843explaining the problem.
28442844
2845 >>> register_test_module('wrongorder', WrongOrderVersions)2845 >>> register_test_module('wrongorder', WrongOrderVersions)
2846 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
2847 Traceback (most recent call last):2846 Traceback (most recent call last):
2848 ...2847 ...
2849 zope.configuration.config.ConfigurationExecutionError: ...AssertionError... Annotations on "WrongOrderVersions.method" put an earlier version on top of a later version: "beta", "2.0", "1.0". The correct order is: "beta", "1.0", "2.0"...2848 zope.configuration.config.ConfigurationExecutionError: ...AssertionError...
2849 Annotations on "WrongOrderVersions.method" put an earlier version on top of
2850 a later version: "beta", "2.0", "1.0". The correct order is: "beta", "1.0",
2851 "2.0"...
28502852
2851Here's a class in which a named operation is removed in version 1.02853Here's a class in which a named operation is removed in version 1.0
2852and then annotated without being reinstated.2854and then annotated without being reinstated.
@@ -2863,10 +2865,11 @@ and then annotated without being reinstated.
2863 ... """A method."""2865 ... """A method."""
28642866
2865 >>> register_test_module('annotatingremoved', AnnotatingARemovedMethod)2867 >>> register_test_module('annotatingremoved', AnnotatingARemovedMethod)
2866 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
2867 Traceback (most recent call last):2868 Traceback (most recent call last):
2868 ...2869 ...
2869 zope.configuration.config.ConfigurationExecutionError: ... Method "method" contains annotations for version "2.0", even though it's not published in that version. The bad annotations are: "as", "params"...2870 zope.configuration.config.ConfigurationExecutionError: ... Method "method"
2871 contains annotations for version "2.0", even though it's not published in
2872 that version. The bad annotations are: "as", "params"...
28702873
2871Mutators as named operations2874Mutators as named operations
2872----------------------------2875----------------------------
@@ -2934,7 +2937,6 @@ defines 1.0 as the last version in which mutators are published as
2934named operations.2937named operations.
29352938
2936 >>> operation_for(context, '2.0', 'set_value')2939 >>> operation_for(context, '2.0', 'set_value')
2937 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
2938 Traceback (most recent call last):2940 Traceback (most recent call last):
2939 ...2941 ...
2940 zope.interface.interfaces.ComponentLookupError: ...2942 zope.interface.interfaces.ComponentLookupError: ...
@@ -2967,13 +2969,11 @@ operations ('1.0').
29672969
2968 >>> context = Mutator20()2970 >>> context = Mutator20()
2969 >>> operation_for(context, '1.0', 'set_value')2971 >>> operation_for(context, '1.0', 'set_value')
2970 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
2971 Traceback (most recent call last):2972 Traceback (most recent call last):
2972 ...2973 ...
2973 zope.interface.interfaces.ComponentLookupError: ...2974 zope.interface.interfaces.ComponentLookupError: ...
29742975
2975 >>> operation_for(context, '2.0', 'set_value')2976 >>> operation_for(context, '2.0', 'set_value')
2976 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
2977 Traceback (most recent call last):2977 Traceback (most recent call last):
2978 ...2978 ...
2979 zope.interface.interfaces.ComponentLookupError: ...2979 zope.interface.interfaces.ComponentLookupError: ...
@@ -3018,7 +3018,6 @@ The operation is not available in 'beta', because it hasn't been
3018defined yet.3018defined yet.
30193019
3020 >>> print(operation_for(context, 'beta', 'set_value').__class__.__name__)3020 >>> print(operation_for(context, 'beta', 'set_value').__class__.__name__)
3021 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
3022 Traceback (most recent call last):3021 Traceback (most recent call last):
3023 ...3022 ...
3024 zope.interface.interfaces.ComponentLookupError: ...3023 zope.interface.interfaces.ComponentLookupError: ...
@@ -3038,7 +3037,6 @@ The operation is not available in 3.0, the version in which it becomes
3038a mutator.3037a mutator.
30393038
3040 >>> operation_for(context, '3.0', 'set_value')3039 >>> operation_for(context, '3.0', 'set_value')
3041 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
3042 Traceback (most recent call last):3040 Traceback (most recent call last):
3043 ...3041 ...
3044 zope.interface.interfaces.ComponentLookupError: ...3042 zope.interface.interfaces.ComponentLookupError: ...
@@ -3152,7 +3150,6 @@ Back when last_version_with_mutator_named_operations was '1.0', the
31523150
3153 >>> context = BetaMutator2()3151 >>> context = BetaMutator2()
3154 >>> operation_for(context, 'beta', 'set_value')3152 >>> operation_for(context, 'beta', 'set_value')
3155 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
3156 Traceback (most recent call last):3153 Traceback (most recent call last):
3157 ...3154 ...
3158 zope.interface.interfaces.ComponentLookupError: ...3155 zope.interface.interfaces.ComponentLookupError: ...
diff --git a/src/lazr/restful/docs/webservice.rst b/src/lazr/restful/docs/webservice.rst
index 477b762..d4fd3eb 100644
--- a/src/lazr/restful/docs/webservice.rst
+++ b/src/lazr/restful/docs/webservice.rst
@@ -688,10 +688,10 @@ But the invariant will complain if that isn't true.
688 >>> verifyObject(IAuthorEntry, InvalidAuthorEntry(A1, request))688 >>> verifyObject(IAuthorEntry, InvalidAuthorEntry(A1, request))
689 True689 True
690 >>> IAuthorEntry.validateInvariants(InvalidAuthorEntry(A1, request))690 >>> IAuthorEntry.validateInvariants(InvalidAuthorEntry(A1, request))
691 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
692 Traceback (most recent call last):691 Traceback (most recent call last):
693 ...692 ...
694 zope.interface.exceptions.Invalid: InvalidAuthorEntry doesn't provide its ICookbookEntry schema.693 zope.interface.exceptions.Invalid: InvalidAuthorEntry doesn't provide its
694 ICookbookEntry schema.
695695
696Other entries are defined similarly.696Other entries are defined similarly.
697697
@@ -1772,7 +1772,6 @@ an error.
1772 ... "Baked beans")1772 ... "Baked beans")
1773 >>> get_request = create_web_service_request(private_recipe_url)1773 >>> get_request = create_web_service_request(private_recipe_url)
1774 >>> recipe_resource = get_request.traverse(app)1774 >>> recipe_resource = get_request.traverse(app)
1775 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1776 Traceback (most recent call last):1775 Traceback (most recent call last):
1777 ...1776 ...
1778 zope.security.interfaces.Unauthorized: (<Recipe object...>, 'dish', ...)1777 zope.security.interfaces.Unauthorized: (<Recipe object...>, 'dish', ...)
@@ -1883,7 +1882,7 @@ A newly created cookbook has no cover.
1883 >>> cover_url = quote('/beta/cookbooks/The Joy of Cooking/cover')1882 >>> cover_url = quote('/beta/cookbooks/The Joy of Cooking/cover')
1884 >>> get_request = create_web_service_request(cover_url)1883 >>> get_request = create_web_service_request(cover_url)
1885 >>> file_resource = get_request.traverse(app)1884 >>> file_resource = get_request.traverse(app)
1886 >>> file_resource() # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON21885 >>> file_resource()
1887 Traceback (most recent call last):1886 Traceback (most recent call last):
1888 ...1887 ...
1889 zope.publisher.interfaces.NotFound: ... name: 'cover'1888 zope.publisher.interfaces.NotFound: ... name: 'cover'
@@ -1922,7 +1921,7 @@ The cover can be deleted with DELETE.
19221921
1923 >>> get_request = create_web_service_request(cover_url)1922 >>> get_request = create_web_service_request(cover_url)
1924 >>> file_resource = get_request.traverse(app)1923 >>> file_resource = get_request.traverse(app)
1925 >>> file_resource() # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON21924 >>> file_resource()
1926 Traceback (most recent call last):1925 Traceback (most recent call last):
1927 ...1926 ...
1928 zope.publisher.interfaces.NotFound: ... name: 'cover'1927 zope.publisher.interfaces.NotFound: ... name: 'cover'
@@ -1949,7 +1948,6 @@ NotFound exception.
1949Requesting a non-existent top-level collection:1948Requesting a non-existent top-level collection:
19501949
1951 >>> create_web_service_request('/beta/nosuchcollection').traverse(app)1950 >>> create_web_service_request('/beta/nosuchcollection').traverse(app)
1952 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1953 Traceback (most recent call last):1951 Traceback (most recent call last):
1954 ...1952 ...
1955 zope.publisher.interfaces.NotFound: ... name: ...'nosuchcollection'1953 zope.publisher.interfaces.NotFound: ... name: ...'nosuchcollection'
@@ -1957,7 +1955,6 @@ Requesting a non-existent top-level collection:
1957Requesting a non-existent cookbook:1955Requesting a non-existent cookbook:
19581956
1959 >>> create_web_service_request('/beta/cookbooks/104').traverse(app)1957 >>> create_web_service_request('/beta/cookbooks/104').traverse(app)
1960 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1961 Traceback (most recent call last):1958 Traceback (most recent call last):
1962 ...1959 ...
1963 zope.publisher.interfaces.NotFound: ... name: ...'104'1960 zope.publisher.interfaces.NotFound: ... name: ...'104'
@@ -1966,7 +1963,6 @@ Requesting a non-existent comment:
19661963
1967 >>> create_web_service_request(1964 >>> create_web_service_request(
1968 ... '/beta/cookbooks/The%20Joy%20of%20Cooking/comments/10').traverse(app)1965 ... '/beta/cookbooks/The%20Joy%20of%20Cooking/comments/10').traverse(app)
1969 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
1970 Traceback (most recent call last):1966 Traceback (most recent call last):
1971 ...1967 ...
1972 zope.publisher.interfaces.NotFound: ... name: ...'comments/10'1968 zope.publisher.interfaces.NotFound: ... name: ...'comments/10'
@@ -2139,10 +2135,10 @@ Now you don't.
21392135
2140 >>> resource = create_web_service_request(2136 >>> resource = create_web_service_request(
2141 ... recipe_url, method='GET').traverse(app)2137 ... recipe_url, method='GET').traverse(app)
2142 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
2143 Traceback (most recent call last):2138 Traceback (most recent call last):
2144 ...2139 ...
2145 zope.publisher.interfaces.NotFound: ... name: ...'recipes/Foies de voilaille en aspic'2140 zope.publisher.interfaces.NotFound: ... name: ...'recipes/Foies de
2141 voilaille en aspic'
21462142
21472143
2148Within a template2144Within a template
diff --git a/src/lazr/restful/example/base/tests/representation-cache.txt b/src/lazr/restful/example/base/tests/representation-cache.txt
index d67ee0b..a38bba8 100644
--- a/src/lazr/restful/example/base/tests/representation-cache.txt
+++ b/src/lazr/restful/example/base/tests/representation-cache.txt
@@ -13,7 +13,6 @@ installed; in fact, this is the only test that uses one.
13 >>> from zope.component import getUtility13 >>> from zope.component import getUtility
14 >>> from lazr.restful.interfaces import IRepresentationCache14 >>> from lazr.restful.interfaces import IRepresentationCache
15 >>> getUtility(IRepresentationCache)15 >>> getUtility(IRepresentationCache)
16 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
17 Traceback (most recent call last):16 Traceback (most recent call last):
18 ...17 ...
19 zope.interface.interfaces.ComponentLookupError: ...18 zope.interface.interfaces.ComponentLookupError: ...
diff --git a/src/lazr/restful/example/base/tests/test_integration.py b/src/lazr/restful/example/base/tests/test_integration.py
index f0bbbb1..fc5e0a4 100644
--- a/src/lazr/restful/example/base/tests/test_integration.py
+++ b/src/lazr/restful/example/base/tests/test_integration.py
@@ -9,7 +9,6 @@ import doctest
9from pkg_resources import resource_filename9from pkg_resources import resource_filename
1010
11from van.testing.layer import zcml_layer, wsgi_intercept_layer11from van.testing.layer import zcml_layer, wsgi_intercept_layer
12from zope.testing import renormalizing
1312
14from lazr.restful.example.base.root import CookbookServiceRootResource13from lazr.restful.example.base.root import CookbookServiceRootResource
15from lazr.restful.testing.webservice import (14from lazr.restful.testing.webservice import (
@@ -28,9 +27,6 @@ DOCTEST_FLAGS = (
28)27)
2928
3029
31checker = renormalizing.OutputChecker()
32
33
34class FunctionalLayer:30class FunctionalLayer:
35 allow_teardown = False31 allow_teardown = False
36 zcml = os.path.abspath(resource_filename("lazr.restful", "ftesting.zcml"))32 zcml = os.path.abspath(resource_filename("lazr.restful", "ftesting.zcml"))
@@ -56,10 +52,7 @@ def load_tests(loader, tests, pattern):
56 if name.endswith(".txt")52 if name.endswith(".txt")
57 )53 )
58 suite = doctest.DocFileSuite(54 suite = doctest.DocFileSuite(
59 *doctest_files,55 *doctest_files, optionflags=DOCTEST_FLAGS, encoding="UTF-8"
60 optionflags=DOCTEST_FLAGS,
61 encoding="UTF-8",
62 checker=checker,
63 )56 )
64 suite.layer = WSGILayer57 suite.layer = WSGILayer
65 tests.addTest(suite)58 tests.addTest(suite)
diff --git a/src/lazr/restful/example/base/tests/traversal.txt b/src/lazr/restful/example/base/tests/traversal.txt
index 8b25884..a00169a 100644
--- a/src/lazr/restful/example/base/tests/traversal.txt
+++ b/src/lazr/restful/example/base/tests/traversal.txt
@@ -21,7 +21,6 @@ If the object cannot be found, publishTraverse raises a NotFound
21error.21error.
2222
23 >>> container.publishTraverse(request, "nosuchname")23 >>> container.publishTraverse(request, "nosuchname")
24 ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2
25 Traceback (most recent call last):24 Traceback (most recent call last):
26 ...25 ...
27 zope.publisher.interfaces.NotFound: ... name: 'nosuchname'26 zope.publisher.interfaces.NotFound: ... name: 'nosuchname'
diff --git a/src/lazr/restful/example/base_extended/tests/test_integration.py b/src/lazr/restful/example/base_extended/tests/test_integration.py
index 866c905..c189634 100644
--- a/src/lazr/restful/example/base_extended/tests/test_integration.py
+++ b/src/lazr/restful/example/base_extended/tests/test_integration.py
@@ -9,7 +9,6 @@ import doctest
9from pkg_resources import resource_filename9from pkg_resources import resource_filename
1010
11from van.testing.layer import zcml_layer, wsgi_intercept_layer11from van.testing.layer import zcml_layer, wsgi_intercept_layer
12from zope.testing import renormalizing
1312
14from lazr.restful.example.base.tests.test_integration import (13from lazr.restful.example.base.tests.test_integration import (
15 CookbookWebServiceTestPublication,14 CookbookWebServiceTestPublication,
@@ -18,9 +17,6 @@ from lazr.restful.example.base.tests.test_integration import (
18from lazr.restful.testing.webservice import WebServiceApplication17from lazr.restful.testing.webservice import WebServiceApplication
1918
2019
21checker = renormalizing.OutputChecker()
22
23
24class FunctionalLayer:20class FunctionalLayer:
25 allow_teardown = False21 allow_teardown = False
26 zcml = os.path.abspath(22 zcml = os.path.abspath(
@@ -43,9 +39,7 @@ wsgi_intercept_layer(WSGILayer)
43def load_tests(loader, tests, pattern):39def load_tests(loader, tests, pattern):
44 """See `zope.testing.testrunner`."""40 """See `zope.testing.testrunner`."""
45 doctest_files = ["../README.txt"]41 doctest_files = ["../README.txt"]
46 suite = doctest.DocFileSuite(42 suite = doctest.DocFileSuite(*doctest_files, optionflags=DOCTEST_FLAGS)
47 *doctest_files, optionflags=DOCTEST_FLAGS, checker=checker
48 )
49 suite.layer = WSGILayer43 suite.layer = WSGILayer
50 tests.addTest(suite)44 tests.addTest(suite)
51 return tests45 return tests
diff --git a/src/lazr/restful/example/multiversion/tests/test_integration.py b/src/lazr/restful/example/multiversion/tests/test_integration.py
index ee04982..d36db07 100644
--- a/src/lazr/restful/example/multiversion/tests/test_integration.py
+++ b/src/lazr/restful/example/multiversion/tests/test_integration.py
@@ -10,7 +10,6 @@ from pkg_resources import resource_filename
1010
11from van.testing.layer import zcml_layer, wsgi_intercept_layer11from van.testing.layer import zcml_layer, wsgi_intercept_layer
12from zope.component import getUtility12from zope.component import getUtility
13from zope.testing import renormalizing
1413
15from lazr.restful.example.multiversion.root import (14from lazr.restful.example.multiversion.root import (
16 MultiversionWebServiceRootResource,15 MultiversionWebServiceRootResource,
@@ -25,9 +24,6 @@ DOCTEST_FLAGS = (
25)24)
2625
2726
28checker = renormalizing.OutputChecker()
29
30
31class FunctionalLayer:27class FunctionalLayer:
32 zcml = os.path.abspath(28 zcml = os.path.abspath(
33 resource_filename("lazr.restful.example.multiversion", "site.zcml")29 resource_filename("lazr.restful.example.multiversion", "site.zcml")
@@ -56,9 +52,7 @@ def load_tests(loader, tests, pattern):
56 for name in os.listdir(os.path.dirname(__file__))52 for name in os.listdir(os.path.dirname(__file__))
57 if name.endswith(".txt")53 if name.endswith(".txt")
58 )54 )
59 suite = doctest.DocFileSuite(55 suite = doctest.DocFileSuite(*doctest_files, optionflags=DOCTEST_FLAGS)
60 *doctest_files, optionflags=DOCTEST_FLAGS, checker=checker
61 )
62 suite.layer = WSGILayer56 suite.layer = WSGILayer
63 tests.addTest(suite)57 tests.addTest(suite)
64 return tests58 return tests
diff --git a/src/lazr/restful/example/wsgi/tests/test_integration.py b/src/lazr/restful/example/wsgi/tests/test_integration.py
index cc02ba7..84b2017 100644
--- a/src/lazr/restful/example/wsgi/tests/test_integration.py
+++ b/src/lazr/restful/example/wsgi/tests/test_integration.py
@@ -10,7 +10,6 @@ from pkg_resources import resource_filename
1010
11from van.testing.layer import zcml_layer, wsgi_intercept_layer11from van.testing.layer import zcml_layer, wsgi_intercept_layer
12from zope.component import getUtility12from zope.component import getUtility
13from zope.testing import renormalizing
1413
15from lazr.restful.example.wsgi.root import WSGIExampleWebServiceRootResource14from lazr.restful.example.wsgi.root import WSGIExampleWebServiceRootResource
16from lazr.restful.interfaces import IWebServiceConfiguration15from lazr.restful.interfaces import IWebServiceConfiguration
@@ -23,9 +22,6 @@ DOCTEST_FLAGS = (
23)22)
2423
2524
26checker = renormalizing.OutputChecker()
27
28
29class FunctionalLayer:25class FunctionalLayer:
30 zcml = os.path.abspath(26 zcml = os.path.abspath(
31 resource_filename("lazr.restful.example.wsgi", "site.zcml")27 resource_filename("lazr.restful.example.wsgi", "site.zcml")
@@ -54,9 +50,7 @@ def load_tests(loader, tests, pattern):
54 for name in os.listdir(os.path.dirname(__file__))50 for name in os.listdir(os.path.dirname(__file__))
55 if name.endswith(".txt")51 if name.endswith(".txt")
56 )52 )
57 suite = doctest.DocFileSuite(53 suite = doctest.DocFileSuite(*doctest_files, optionflags=DOCTEST_FLAGS)
58 *doctest_files, optionflags=DOCTEST_FLAGS, checker=checker
59 )
60 suite.layer = WSGILayer54 suite.layer = WSGILayer
61 tests.addTest(suite)55 tests.addTest(suite)
62 return tests56 return tests

Subscribers

People subscribed via source and target branches