Merge ~cjwatson/lazr.restful:doctest-remove-py2-exception-module into lazr.restful:main
- Git
- lp:~cjwatson/lazr.restful
- doctest-remove-py2-exception-module
- Merge into 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) |
Related bugs: |
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_
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
1 | diff --git a/src/lazr/restful/docs/fields.rst b/src/lazr/restful/docs/fields.rst | |||
2 | index 869eb20..5ba2e0f 100644 | |||
3 | --- a/src/lazr/restful/docs/fields.rst | |||
4 | +++ b/src/lazr/restful/docs/fields.rst | |||
5 | @@ -43,7 +43,6 @@ elements. | |||
6 | 43 | But if the object isn't iterable, NotAContainer is raised. | 43 | But if the object isn't iterable, NotAContainer is raised. |
7 | 44 | 44 | ||
8 | 45 | >>> int_collection.validate(object()) | 45 | >>> int_collection.validate(object()) |
9 | 46 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
10 | 47 | Traceback (most recent call last): | 46 | Traceback (most recent call last): |
11 | 48 | ... | 47 | ... |
12 | 49 | zope.schema._bootstrapinterfaces.NotAContainer: <object...> | 48 | zope.schema._bootstrapinterfaces.NotAContainer: <object...> |
13 | @@ -51,7 +50,6 @@ But if the object isn't iterable, NotAContainer is raised. | |||
14 | 51 | If the iterable contains an invalid item, WrongContainedType is raised. | 50 | If the iterable contains an invalid item, WrongContainedType is raised. |
15 | 52 | 51 | ||
16 | 53 | >>> int_collection.validate(['a', 1, 2, 'b']) | 52 | >>> int_collection.validate(['a', 1, 2, 'b']) |
17 | 54 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
18 | 55 | Traceback (most recent call last): | 53 | Traceback (most recent call last): |
19 | 56 | ... | 54 | ... |
20 | 57 | zope.schema._bootstrapinterfaces.WrongContainedType: ... | 55 | zope.schema._bootstrapinterfaces.WrongContainedType: ... |
21 | @@ -79,7 +77,6 @@ by value, but only check that the value provides the proper schema. | |||
22 | 79 | ... pass | 77 | ... pass |
23 | 80 | >>> fake = Fake() | 78 | >>> fake = Fake() |
24 | 81 | >>> reference.validate(fake) | 79 | >>> reference.validate(fake) |
25 | 82 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
26 | 83 | Traceback (most recent call last): | 80 | Traceback (most recent call last): |
27 | 84 | ... | 81 | ... |
28 | 85 | zope.schema._bootstrapinterfaces.SchemaNotProvided: ... | 82 | zope.schema._bootstrapinterfaces.SchemaNotProvided: ... |
29 | @@ -95,7 +92,6 @@ The Reference field supports the standard IField constraint. | |||
30 | 95 | 92 | ||
31 | 96 | >>> fake.a_value = 'bad' | 93 | >>> fake.a_value = 'bad' |
32 | 97 | >>> reference.validate(fake) | 94 | >>> reference.validate(fake) |
33 | 98 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
34 | 99 | Traceback (most recent call last): | 95 | Traceback (most recent call last): |
35 | 100 | ... | 96 | ... |
36 | 101 | zope.schema._bootstrapinterfaces.ConstraintNotSatisfied: ... | 97 | zope.schema._bootstrapinterfaces.ConstraintNotSatisfied: ... |
37 | diff --git a/src/lazr/restful/docs/interface.rst b/src/lazr/restful/docs/interface.rst | |||
38 | index afcd439..1fdf251 100644 | |||
39 | --- a/src/lazr/restful/docs/interface.rst | |||
40 | +++ b/src/lazr/restful/docs/interface.rst | |||
41 | @@ -174,7 +174,6 @@ If the value for an overridden field is invalid, an exception will be | |||
42 | 174 | raised: | 174 | raised: |
43 | 175 | 175 | ||
44 | 176 | >>> copy_field(MyModel['age'], title=b'This should be unicode') | 176 | >>> copy_field(MyModel['age'], title=b'This should be unicode') |
45 | 177 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
46 | 178 | Traceback (most recent call last): | 177 | Traceback (most recent call last): |
47 | 179 | ... | 178 | ... |
48 | 180 | zope.schema._bootstrapinterfaces.WrongType: ... | 179 | zope.schema._bootstrapinterfaces.WrongType: ... |
49 | diff --git a/src/lazr/restful/docs/multiversion.rst b/src/lazr/restful/docs/multiversion.rst | |||
50 | index d3c95d3..d1f3863 100644 | |||
51 | --- a/src/lazr/restful/docs/multiversion.rst | |||
52 | +++ b/src/lazr/restful/docs/multiversion.rst | |||
53 | @@ -408,7 +408,6 @@ you can't just adapt Contact to IEntry. | |||
54 | 408 | >>> from zope.component import getAdapter | 408 | >>> from zope.component import getAdapter |
55 | 409 | 409 | ||
56 | 410 | >>> getAdapter(C1, IEntry) | 410 | >>> getAdapter(C1, IEntry) |
57 | 411 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
58 | 412 | Traceback (most recent call last): | 411 | Traceback (most recent call last): |
59 | 413 | ... | 412 | ... |
60 | 414 | zope.interface.interfaces.ComponentLookupError: ... | 413 | zope.interface.interfaces.ComponentLookupError: ... |
61 | @@ -788,10 +787,10 @@ service will fail. | |||
62 | 788 | 787 | ||
63 | 789 | >>> request = create_web_service_request('/1.0/contact_list') | 788 | >>> request = create_web_service_request('/1.0/contact_list') |
64 | 790 | >>> resource = request.traverse(None) | 789 | >>> resource = request.traverse(None) |
65 | 791 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
66 | 792 | Traceback (most recent call last): | 790 | Traceback (most recent call last): |
67 | 793 | ... | 791 | ... |
69 | 794 | zope.publisher.interfaces.NotFound: Object: <PostBetaServiceRootResource...>, name: ...'contact_list' | 792 | zope.publisher.interfaces.NotFound: |
70 | 793 | Object: <PostBetaServiceRootResource...>, name: ...'contact_list' | ||
71 | 795 | 794 | ||
72 | 796 | Here's the contact list under its correct URL. | 795 | Here's the contact list under its correct URL. |
73 | 797 | 796 | ||
74 | @@ -842,10 +841,10 @@ to traverse to its 'beta' name ('fax') will fail. | |||
75 | 842 | >>> request_10 = create_web_service_request( | 841 | >>> request_10 = create_web_service_request( |
76 | 843 | ... '/1.0/contacts/Cleo Python/fax') | 842 | ... '/1.0/contacts/Cleo Python/fax') |
77 | 844 | >>> field = request_10.traverse(None) | 843 | >>> field = request_10.traverse(None) |
78 | 845 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
79 | 846 | Traceback (most recent call last): | 844 | Traceback (most recent call last): |
80 | 847 | ... | 845 | ... |
82 | 848 | zope.publisher.interfaces.NotFound: Object: <Contact object...>, name: ...'fax' | 846 | zope.publisher.interfaces.NotFound: |
83 | 847 | Object: <Contact object...>, name: ...'fax' | ||
84 | 849 | 848 | ||
85 | 850 | We can invoke a named operation. Note that the name of the operation | 849 | We can invoke a named operation. Note that the name of the operation |
86 | 851 | is now 'find' (it was 'findContacts' in 'beta'). And note that | 850 | is now 'find' (it was 'findContacts' in 'beta'). And note that |
87 | @@ -960,18 +959,18 @@ version. | |||
88 | 960 | >>> request_beta = create_web_service_request( | 959 | >>> request_beta = create_web_service_request( |
89 | 961 | ... '/dev/contacts/Cleo Python/fax') | 960 | ... '/dev/contacts/Cleo Python/fax') |
90 | 962 | >>> field = request_beta.traverse(None) | 961 | >>> field = request_beta.traverse(None) |
91 | 963 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
92 | 964 | Traceback (most recent call last): | 962 | Traceback (most recent call last): |
93 | 965 | ... | 963 | ... |
95 | 966 | zope.publisher.interfaces.NotFound: Object: <Contact object...>, name: ...'fax' | 964 | zope.publisher.interfaces.NotFound: |
96 | 965 | Object: <Contact object...>, name: ...'fax' | ||
97 | 967 | 966 | ||
98 | 968 | >>> request_beta = create_web_service_request( | 967 | >>> request_beta = create_web_service_request( |
99 | 969 | ... '/dev/contacts/Cleo Python/fax_number') | 968 | ... '/dev/contacts/Cleo Python/fax_number') |
100 | 970 | >>> field = request_beta.traverse(None) | 969 | >>> field = request_beta.traverse(None) |
101 | 971 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
102 | 972 | Traceback (most recent call last): | 970 | Traceback (most recent call last): |
103 | 973 | ... | 971 | ... |
105 | 974 | zope.publisher.interfaces.NotFound: Object: <Contact object...>, name: ...'fax_number' | 972 | zope.publisher.interfaces.NotFound: |
106 | 973 | Object: <Contact object...>, name: ...'fax_number' | ||
107 | 975 | 974 | ||
108 | 976 | We can invoke a named operation. | 975 | We can invoke a named operation. |
109 | 977 | 976 | ||
110 | diff --git a/src/lazr/restful/docs/webservice-declarations.rst b/src/lazr/restful/docs/webservice-declarations.rst | |||
111 | index be31dde..41826d7 100644 | |||
112 | --- a/src/lazr/restful/docs/webservice-declarations.rst | |||
113 | +++ b/src/lazr/restful/docs/webservice-declarations.rst | |||
114 | @@ -1658,20 +1658,20 @@ can neither get nor set attributes. | |||
115 | 1658 | >>> _ = multiple_scopes_method_adapter.call() | 1658 | >>> _ = multiple_scopes_method_adapter.call() |
116 | 1659 | multiple_scopes called | 1659 | multiple_scopes called |
117 | 1660 | >>> _ = unscoped_method_adapter.call() | 1660 | >>> _ = unscoped_method_adapter.call() |
118 | 1661 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
119 | 1662 | Traceback (most recent call last): | 1661 | Traceback (most recent call last): |
120 | 1663 | ... | 1662 | ... |
122 | 1664 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1663 | zope.security.interfaces.Unauthorized: Current authentication only allows |
123 | 1664 | calling scoped methods. | ||
124 | 1665 | >>> print(scoped_entry_adapter.value) | 1665 | >>> print(scoped_entry_adapter.value) |
125 | 1666 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
126 | 1667 | Traceback (most recent call last): | 1666 | Traceback (most recent call last): |
127 | 1668 | ... | 1667 | ... |
129 | 1669 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1668 | zope.security.interfaces.Unauthorized: Current authentication only allows |
130 | 1669 | calling scoped methods. | ||
131 | 1670 | >>> scoped_entry_adapter.value = 'set by scoped user' | 1670 | >>> scoped_entry_adapter.value = 'set by scoped user' |
132 | 1671 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
133 | 1672 | Traceback (most recent call last): | 1671 | Traceback (most recent call last): |
134 | 1673 | ... | 1672 | ... |
136 | 1674 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1673 | zope.security.interfaces.Unauthorized: Current authentication only allows |
137 | 1674 | calling scoped methods. | ||
138 | 1675 | 1675 | ||
139 | 1676 | A user with one scope can only call the methods tagged with that scope, and | 1676 | A user with one scope can only call the methods tagged with that scope, and |
140 | 1677 | can neither get nor set attributes. | 1677 | can neither get nor set attributes. |
141 | @@ -1680,53 +1680,53 @@ can neither get nor set attributes. | |||
142 | 1680 | >>> _ = get_info_method_adapter.call() | 1680 | >>> _ = get_info_method_adapter.call() |
143 | 1681 | get_info called | 1681 | get_info called |
144 | 1682 | >>> _ = do_update_method_adapter.call() | 1682 | >>> _ = do_update_method_adapter.call() |
145 | 1683 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
146 | 1684 | Traceback (most recent call last): | 1683 | Traceback (most recent call last): |
147 | 1685 | ... | 1684 | ... |
149 | 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 |
150 | 1686 | allow calling this method (one of these scopes is required: 'update'). | ||
151 | 1687 | >>> _ = multiple_scopes_method_adapter.call() | 1687 | >>> _ = multiple_scopes_method_adapter.call() |
152 | 1688 | multiple_scopes called | 1688 | multiple_scopes called |
153 | 1689 | >>> _ = unscoped_method_adapter.call() | 1689 | >>> _ = unscoped_method_adapter.call() |
154 | 1690 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
155 | 1691 | Traceback (most recent call last): | 1690 | Traceback (most recent call last): |
156 | 1692 | ... | 1691 | ... |
158 | 1693 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1692 | zope.security.interfaces.Unauthorized: Current authentication only allows |
159 | 1693 | calling scoped methods. | ||
160 | 1694 | >>> print(scoped_entry_adapter.value) | 1694 | >>> print(scoped_entry_adapter.value) |
161 | 1695 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
162 | 1696 | Traceback (most recent call last): | 1695 | Traceback (most recent call last): |
163 | 1697 | ... | 1696 | ... |
165 | 1698 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1697 | zope.security.interfaces.Unauthorized: Current authentication only allows |
166 | 1698 | calling scoped methods. | ||
167 | 1699 | >>> scoped_entry_adapter.value = 'set by scoped user' | 1699 | >>> scoped_entry_adapter.value = 'set by scoped user' |
168 | 1700 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
169 | 1701 | Traceback (most recent call last): | 1700 | Traceback (most recent call last): |
170 | 1702 | ... | 1701 | ... |
172 | 1703 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1702 | zope.security.interfaces.Unauthorized: Current authentication only allows |
173 | 1703 | calling scoped methods. | ||
174 | 1704 | 1704 | ||
175 | 1705 | >>> config._scopes = ['update'] | 1705 | >>> config._scopes = ['update'] |
176 | 1706 | >>> _ = get_info_method_adapter.call() | 1706 | >>> _ = get_info_method_adapter.call() |
177 | 1707 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
178 | 1708 | Traceback (most recent call last): | 1707 | Traceback (most recent call last): |
179 | 1709 | ... | 1708 | ... |
181 | 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 |
182 | 1710 | allow calling this method (one of these scopes is required: 'read'). | ||
183 | 1711 | >>> _ = do_update_method_adapter.call() | 1711 | >>> _ = do_update_method_adapter.call() |
184 | 1712 | do_update called | 1712 | do_update called |
185 | 1713 | >>> _ = multiple_scopes_method_adapter.call() | 1713 | >>> _ = multiple_scopes_method_adapter.call() |
186 | 1714 | multiple_scopes called | 1714 | multiple_scopes called |
187 | 1715 | >>> _ = unscoped_method_adapter.call() | 1715 | >>> _ = unscoped_method_adapter.call() |
188 | 1716 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
189 | 1717 | Traceback (most recent call last): | 1716 | Traceback (most recent call last): |
190 | 1718 | ... | 1717 | ... |
192 | 1719 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1718 | zope.security.interfaces.Unauthorized: Current authentication only allows |
193 | 1719 | calling scoped methods. | ||
194 | 1720 | >>> print(scoped_entry_adapter.value) | 1720 | >>> print(scoped_entry_adapter.value) |
195 | 1721 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
196 | 1722 | Traceback (most recent call last): | 1721 | Traceback (most recent call last): |
197 | 1723 | ... | 1722 | ... |
199 | 1724 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1723 | zope.security.interfaces.Unauthorized: Current authentication only allows |
200 | 1724 | calling scoped methods. | ||
201 | 1725 | >>> scoped_entry_adapter.value = 'set by scoped user' | 1725 | >>> scoped_entry_adapter.value = 'set by scoped user' |
202 | 1726 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
203 | 1727 | Traceback (most recent call last): | 1726 | Traceback (most recent call last): |
204 | 1728 | ... | 1727 | ... |
206 | 1729 | zope.security.interfaces.Unauthorized: Current authentication only allows calling scoped methods. | 1728 | zope.security.interfaces.Unauthorized: Current authentication only allows |
207 | 1729 | calling scoped methods. | ||
208 | 1730 | 1730 | ||
209 | 1731 | >>> config._scopes = None | 1731 | >>> config._scopes = None |
210 | 1732 | 1732 | ||
211 | @@ -2843,10 +2843,12 @@ An attempt to register this module with ZCML results in an error | |||
212 | 2843 | explaining the problem. | 2843 | explaining the problem. |
213 | 2844 | 2844 | ||
214 | 2845 | >>> register_test_module('wrongorder', WrongOrderVersions) | 2845 | >>> register_test_module('wrongorder', WrongOrderVersions) |
215 | 2846 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
216 | 2847 | Traceback (most recent call last): | 2846 | Traceback (most recent call last): |
217 | 2848 | ... | 2847 | ... |
219 | 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... |
220 | 2849 | Annotations on "WrongOrderVersions.method" put an earlier version on top of | ||
221 | 2850 | a later version: "beta", "2.0", "1.0". The correct order is: "beta", "1.0", | ||
222 | 2851 | "2.0"... | ||
223 | 2850 | 2852 | ||
224 | 2851 | Here's a class in which a named operation is removed in version 1.0 | 2853 | Here's a class in which a named operation is removed in version 1.0 |
225 | 2852 | and then annotated without being reinstated. | 2854 | and then annotated without being reinstated. |
226 | @@ -2863,10 +2865,11 @@ and then annotated without being reinstated. | |||
227 | 2863 | ... """A method.""" | 2865 | ... """A method.""" |
228 | 2864 | 2866 | ||
229 | 2865 | >>> register_test_module('annotatingremoved', AnnotatingARemovedMethod) | 2867 | >>> register_test_module('annotatingremoved', AnnotatingARemovedMethod) |
230 | 2866 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
231 | 2867 | Traceback (most recent call last): | 2868 | Traceback (most recent call last): |
232 | 2868 | ... | 2869 | ... |
234 | 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" |
235 | 2871 | contains annotations for version "2.0", even though it's not published in | ||
236 | 2872 | that version. The bad annotations are: "as", "params"... | ||
237 | 2870 | 2873 | ||
238 | 2871 | Mutators as named operations | 2874 | Mutators as named operations |
239 | 2872 | ---------------------------- | 2875 | ---------------------------- |
240 | @@ -2934,7 +2937,6 @@ defines 1.0 as the last version in which mutators are published as | |||
241 | 2934 | named operations. | 2937 | named operations. |
242 | 2935 | 2938 | ||
243 | 2936 | >>> operation_for(context, '2.0', 'set_value') | 2939 | >>> operation_for(context, '2.0', 'set_value') |
244 | 2937 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
245 | 2938 | Traceback (most recent call last): | 2940 | Traceback (most recent call last): |
246 | 2939 | ... | 2941 | ... |
247 | 2940 | zope.interface.interfaces.ComponentLookupError: ... | 2942 | zope.interface.interfaces.ComponentLookupError: ... |
248 | @@ -2967,13 +2969,11 @@ operations ('1.0'). | |||
249 | 2967 | 2969 | ||
250 | 2968 | >>> context = Mutator20() | 2970 | >>> context = Mutator20() |
251 | 2969 | >>> operation_for(context, '1.0', 'set_value') | 2971 | >>> operation_for(context, '1.0', 'set_value') |
252 | 2970 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
253 | 2971 | Traceback (most recent call last): | 2972 | Traceback (most recent call last): |
254 | 2972 | ... | 2973 | ... |
255 | 2973 | zope.interface.interfaces.ComponentLookupError: ... | 2974 | zope.interface.interfaces.ComponentLookupError: ... |
256 | 2974 | 2975 | ||
257 | 2975 | >>> operation_for(context, '2.0', 'set_value') | 2976 | >>> operation_for(context, '2.0', 'set_value') |
258 | 2976 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
259 | 2977 | Traceback (most recent call last): | 2977 | Traceback (most recent call last): |
260 | 2978 | ... | 2978 | ... |
261 | 2979 | zope.interface.interfaces.ComponentLookupError: ... | 2979 | zope.interface.interfaces.ComponentLookupError: ... |
262 | @@ -3018,7 +3018,6 @@ The operation is not available in 'beta', because it hasn't been | |||
263 | 3018 | defined yet. | 3018 | defined yet. |
264 | 3019 | 3019 | ||
265 | 3020 | >>> print(operation_for(context, 'beta', 'set_value').__class__.__name__) | 3020 | >>> print(operation_for(context, 'beta', 'set_value').__class__.__name__) |
266 | 3021 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
267 | 3022 | Traceback (most recent call last): | 3021 | Traceback (most recent call last): |
268 | 3023 | ... | 3022 | ... |
269 | 3024 | zope.interface.interfaces.ComponentLookupError: ... | 3023 | zope.interface.interfaces.ComponentLookupError: ... |
270 | @@ -3038,7 +3037,6 @@ The operation is not available in 3.0, the version in which it becomes | |||
271 | 3038 | a mutator. | 3037 | a mutator. |
272 | 3039 | 3038 | ||
273 | 3040 | >>> operation_for(context, '3.0', 'set_value') | 3039 | >>> operation_for(context, '3.0', 'set_value') |
274 | 3041 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
275 | 3042 | Traceback (most recent call last): | 3040 | Traceback (most recent call last): |
276 | 3043 | ... | 3041 | ... |
277 | 3044 | zope.interface.interfaces.ComponentLookupError: ... | 3042 | zope.interface.interfaces.ComponentLookupError: ... |
278 | @@ -3152,7 +3150,6 @@ Back when last_version_with_mutator_named_operations was '1.0', the | |||
279 | 3152 | 3150 | ||
280 | 3153 | >>> context = BetaMutator2() | 3151 | >>> context = BetaMutator2() |
281 | 3154 | >>> operation_for(context, 'beta', 'set_value') | 3152 | >>> operation_for(context, 'beta', 'set_value') |
282 | 3155 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
283 | 3156 | Traceback (most recent call last): | 3153 | Traceback (most recent call last): |
284 | 3157 | ... | 3154 | ... |
285 | 3158 | zope.interface.interfaces.ComponentLookupError: ... | 3155 | zope.interface.interfaces.ComponentLookupError: ... |
286 | diff --git a/src/lazr/restful/docs/webservice.rst b/src/lazr/restful/docs/webservice.rst | |||
287 | index 477b762..d4fd3eb 100644 | |||
288 | --- a/src/lazr/restful/docs/webservice.rst | |||
289 | +++ b/src/lazr/restful/docs/webservice.rst | |||
290 | @@ -688,10 +688,10 @@ But the invariant will complain if that isn't true. | |||
291 | 688 | >>> verifyObject(IAuthorEntry, InvalidAuthorEntry(A1, request)) | 688 | >>> verifyObject(IAuthorEntry, InvalidAuthorEntry(A1, request)) |
292 | 689 | True | 689 | True |
293 | 690 | >>> IAuthorEntry.validateInvariants(InvalidAuthorEntry(A1, request)) | 690 | >>> IAuthorEntry.validateInvariants(InvalidAuthorEntry(A1, request)) |
294 | 691 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
295 | 692 | Traceback (most recent call last): | 691 | Traceback (most recent call last): |
296 | 693 | ... | 692 | ... |
298 | 694 | zope.interface.exceptions.Invalid: InvalidAuthorEntry doesn't provide its ICookbookEntry schema. | 693 | zope.interface.exceptions.Invalid: InvalidAuthorEntry doesn't provide its |
299 | 694 | ICookbookEntry schema. | ||
300 | 695 | 695 | ||
301 | 696 | Other entries are defined similarly. | 696 | Other entries are defined similarly. |
302 | 697 | 697 | ||
303 | @@ -1772,7 +1772,6 @@ an error. | |||
304 | 1772 | ... "Baked beans") | 1772 | ... "Baked beans") |
305 | 1773 | >>> get_request = create_web_service_request(private_recipe_url) | 1773 | >>> get_request = create_web_service_request(private_recipe_url) |
306 | 1774 | >>> recipe_resource = get_request.traverse(app) | 1774 | >>> recipe_resource = get_request.traverse(app) |
307 | 1775 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
308 | 1776 | Traceback (most recent call last): | 1775 | Traceback (most recent call last): |
309 | 1777 | ... | 1776 | ... |
310 | 1778 | zope.security.interfaces.Unauthorized: (<Recipe object...>, 'dish', ...) | 1777 | zope.security.interfaces.Unauthorized: (<Recipe object...>, 'dish', ...) |
311 | @@ -1883,7 +1882,7 @@ A newly created cookbook has no cover. | |||
312 | 1883 | >>> cover_url = quote('/beta/cookbooks/The Joy of Cooking/cover') | 1882 | >>> cover_url = quote('/beta/cookbooks/The Joy of Cooking/cover') |
313 | 1884 | >>> get_request = create_web_service_request(cover_url) | 1883 | >>> get_request = create_web_service_request(cover_url) |
314 | 1885 | >>> file_resource = get_request.traverse(app) | 1884 | >>> file_resource = get_request.traverse(app) |
316 | 1886 | >>> file_resource() # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | 1885 | >>> file_resource() |
317 | 1887 | Traceback (most recent call last): | 1886 | Traceback (most recent call last): |
318 | 1888 | ... | 1887 | ... |
319 | 1889 | zope.publisher.interfaces.NotFound: ... name: 'cover' | 1888 | zope.publisher.interfaces.NotFound: ... name: 'cover' |
320 | @@ -1922,7 +1921,7 @@ The cover can be deleted with DELETE. | |||
321 | 1922 | 1921 | ||
322 | 1923 | >>> get_request = create_web_service_request(cover_url) | 1922 | >>> get_request = create_web_service_request(cover_url) |
323 | 1924 | >>> file_resource = get_request.traverse(app) | 1923 | >>> file_resource = get_request.traverse(app) |
325 | 1925 | >>> file_resource() # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | 1924 | >>> file_resource() |
326 | 1926 | Traceback (most recent call last): | 1925 | Traceback (most recent call last): |
327 | 1927 | ... | 1926 | ... |
328 | 1928 | zope.publisher.interfaces.NotFound: ... name: 'cover' | 1927 | zope.publisher.interfaces.NotFound: ... name: 'cover' |
329 | @@ -1949,7 +1948,6 @@ NotFound exception. | |||
330 | 1949 | Requesting a non-existent top-level collection: | 1948 | Requesting a non-existent top-level collection: |
331 | 1950 | 1949 | ||
332 | 1951 | >>> create_web_service_request('/beta/nosuchcollection').traverse(app) | 1950 | >>> create_web_service_request('/beta/nosuchcollection').traverse(app) |
333 | 1952 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
334 | 1953 | Traceback (most recent call last): | 1951 | Traceback (most recent call last): |
335 | 1954 | ... | 1952 | ... |
336 | 1955 | zope.publisher.interfaces.NotFound: ... name: ...'nosuchcollection' | 1953 | zope.publisher.interfaces.NotFound: ... name: ...'nosuchcollection' |
337 | @@ -1957,7 +1955,6 @@ Requesting a non-existent top-level collection: | |||
338 | 1957 | Requesting a non-existent cookbook: | 1955 | Requesting a non-existent cookbook: |
339 | 1958 | 1956 | ||
340 | 1959 | >>> create_web_service_request('/beta/cookbooks/104').traverse(app) | 1957 | >>> create_web_service_request('/beta/cookbooks/104').traverse(app) |
341 | 1960 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
342 | 1961 | Traceback (most recent call last): | 1958 | Traceback (most recent call last): |
343 | 1962 | ... | 1959 | ... |
344 | 1963 | zope.publisher.interfaces.NotFound: ... name: ...'104' | 1960 | zope.publisher.interfaces.NotFound: ... name: ...'104' |
345 | @@ -1966,7 +1963,6 @@ Requesting a non-existent comment: | |||
346 | 1966 | 1963 | ||
347 | 1967 | >>> create_web_service_request( | 1964 | >>> create_web_service_request( |
348 | 1968 | ... '/beta/cookbooks/The%20Joy%20of%20Cooking/comments/10').traverse(app) | 1965 | ... '/beta/cookbooks/The%20Joy%20of%20Cooking/comments/10').traverse(app) |
349 | 1969 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
350 | 1970 | Traceback (most recent call last): | 1966 | Traceback (most recent call last): |
351 | 1971 | ... | 1967 | ... |
352 | 1972 | zope.publisher.interfaces.NotFound: ... name: ...'comments/10' | 1968 | zope.publisher.interfaces.NotFound: ... name: ...'comments/10' |
353 | @@ -2139,10 +2135,10 @@ Now you don't. | |||
354 | 2139 | 2135 | ||
355 | 2140 | >>> resource = create_web_service_request( | 2136 | >>> resource = create_web_service_request( |
356 | 2141 | ... recipe_url, method='GET').traverse(app) | 2137 | ... recipe_url, method='GET').traverse(app) |
357 | 2142 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
358 | 2143 | Traceback (most recent call last): | 2138 | Traceback (most recent call last): |
359 | 2144 | ... | 2139 | ... |
361 | 2145 | zope.publisher.interfaces.NotFound: ... name: ...'recipes/Foies de voilaille en aspic' | 2140 | zope.publisher.interfaces.NotFound: ... name: ...'recipes/Foies de |
362 | 2141 | voilaille en aspic' | ||
363 | 2146 | 2142 | ||
364 | 2147 | 2143 | ||
365 | 2148 | Within a template | 2144 | Within a template |
366 | diff --git a/src/lazr/restful/example/base/tests/representation-cache.txt b/src/lazr/restful/example/base/tests/representation-cache.txt | |||
367 | index d67ee0b..a38bba8 100644 | |||
368 | --- a/src/lazr/restful/example/base/tests/representation-cache.txt | |||
369 | +++ b/src/lazr/restful/example/base/tests/representation-cache.txt | |||
370 | @@ -13,7 +13,6 @@ installed; in fact, this is the only test that uses one. | |||
371 | 13 | >>> from zope.component import getUtility | 13 | >>> from zope.component import getUtility |
372 | 14 | >>> from lazr.restful.interfaces import IRepresentationCache | 14 | >>> from lazr.restful.interfaces import IRepresentationCache |
373 | 15 | >>> getUtility(IRepresentationCache) | 15 | >>> getUtility(IRepresentationCache) |
374 | 16 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
375 | 17 | Traceback (most recent call last): | 16 | Traceback (most recent call last): |
376 | 18 | ... | 17 | ... |
377 | 19 | zope.interface.interfaces.ComponentLookupError: ... | 18 | zope.interface.interfaces.ComponentLookupError: ... |
378 | diff --git a/src/lazr/restful/example/base/tests/test_integration.py b/src/lazr/restful/example/base/tests/test_integration.py | |||
379 | index f0bbbb1..fc5e0a4 100644 | |||
380 | --- a/src/lazr/restful/example/base/tests/test_integration.py | |||
381 | +++ b/src/lazr/restful/example/base/tests/test_integration.py | |||
382 | @@ -9,7 +9,6 @@ import doctest | |||
383 | 9 | from pkg_resources import resource_filename | 9 | from pkg_resources import resource_filename |
384 | 10 | 10 | ||
385 | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer |
386 | 12 | from zope.testing import renormalizing | ||
387 | 13 | 12 | ||
388 | 14 | from lazr.restful.example.base.root import CookbookServiceRootResource | 13 | from lazr.restful.example.base.root import CookbookServiceRootResource |
389 | 15 | from lazr.restful.testing.webservice import ( | 14 | from lazr.restful.testing.webservice import ( |
390 | @@ -28,9 +27,6 @@ DOCTEST_FLAGS = ( | |||
391 | 28 | ) | 27 | ) |
392 | 29 | 28 | ||
393 | 30 | 29 | ||
394 | 31 | checker = renormalizing.OutputChecker() | ||
395 | 32 | |||
396 | 33 | |||
397 | 34 | class FunctionalLayer: | 30 | class FunctionalLayer: |
398 | 35 | allow_teardown = False | 31 | allow_teardown = False |
399 | 36 | zcml = os.path.abspath(resource_filename("lazr.restful", "ftesting.zcml")) | 32 | zcml = os.path.abspath(resource_filename("lazr.restful", "ftesting.zcml")) |
400 | @@ -56,10 +52,7 @@ def load_tests(loader, tests, pattern): | |||
401 | 56 | if name.endswith(".txt") | 52 | if name.endswith(".txt") |
402 | 57 | ) | 53 | ) |
403 | 58 | suite = doctest.DocFileSuite( | 54 | suite = doctest.DocFileSuite( |
408 | 59 | *doctest_files, | 55 | *doctest_files, optionflags=DOCTEST_FLAGS, encoding="UTF-8" |
405 | 60 | optionflags=DOCTEST_FLAGS, | ||
406 | 61 | encoding="UTF-8", | ||
407 | 62 | checker=checker, | ||
409 | 63 | ) | 56 | ) |
410 | 64 | suite.layer = WSGILayer | 57 | suite.layer = WSGILayer |
411 | 65 | tests.addTest(suite) | 58 | tests.addTest(suite) |
412 | diff --git a/src/lazr/restful/example/base/tests/traversal.txt b/src/lazr/restful/example/base/tests/traversal.txt | |||
413 | index 8b25884..a00169a 100644 | |||
414 | --- a/src/lazr/restful/example/base/tests/traversal.txt | |||
415 | +++ b/src/lazr/restful/example/base/tests/traversal.txt | |||
416 | @@ -21,7 +21,6 @@ If the object cannot be found, publishTraverse raises a NotFound | |||
417 | 21 | error. | 21 | error. |
418 | 22 | 22 | ||
419 | 23 | >>> container.publishTraverse(request, "nosuchname") | 23 | >>> container.publishTraverse(request, "nosuchname") |
420 | 24 | ... # doctest: +IGNORE_EXCEPTION_MODULE_IN_PYTHON2 | ||
421 | 25 | Traceback (most recent call last): | 24 | Traceback (most recent call last): |
422 | 26 | ... | 25 | ... |
423 | 27 | zope.publisher.interfaces.NotFound: ... name: 'nosuchname' | 26 | zope.publisher.interfaces.NotFound: ... name: 'nosuchname' |
424 | diff --git a/src/lazr/restful/example/base_extended/tests/test_integration.py b/src/lazr/restful/example/base_extended/tests/test_integration.py | |||
425 | index 866c905..c189634 100644 | |||
426 | --- a/src/lazr/restful/example/base_extended/tests/test_integration.py | |||
427 | +++ b/src/lazr/restful/example/base_extended/tests/test_integration.py | |||
428 | @@ -9,7 +9,6 @@ import doctest | |||
429 | 9 | from pkg_resources import resource_filename | 9 | from pkg_resources import resource_filename |
430 | 10 | 10 | ||
431 | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer |
432 | 12 | from zope.testing import renormalizing | ||
433 | 13 | 12 | ||
434 | 14 | from lazr.restful.example.base.tests.test_integration import ( | 13 | from lazr.restful.example.base.tests.test_integration import ( |
435 | 15 | CookbookWebServiceTestPublication, | 14 | CookbookWebServiceTestPublication, |
436 | @@ -18,9 +17,6 @@ from lazr.restful.example.base.tests.test_integration import ( | |||
437 | 18 | from lazr.restful.testing.webservice import WebServiceApplication | 17 | from lazr.restful.testing.webservice import WebServiceApplication |
438 | 19 | 18 | ||
439 | 20 | 19 | ||
440 | 21 | checker = renormalizing.OutputChecker() | ||
441 | 22 | |||
442 | 23 | |||
443 | 24 | class FunctionalLayer: | 20 | class FunctionalLayer: |
444 | 25 | allow_teardown = False | 21 | allow_teardown = False |
445 | 26 | zcml = os.path.abspath( | 22 | zcml = os.path.abspath( |
446 | @@ -43,9 +39,7 @@ wsgi_intercept_layer(WSGILayer) | |||
447 | 43 | def load_tests(loader, tests, pattern): | 39 | def load_tests(loader, tests, pattern): |
448 | 44 | """See `zope.testing.testrunner`.""" | 40 | """See `zope.testing.testrunner`.""" |
449 | 45 | doctest_files = ["../README.txt"] | 41 | doctest_files = ["../README.txt"] |
453 | 46 | suite = doctest.DocFileSuite( | 42 | suite = doctest.DocFileSuite(*doctest_files, optionflags=DOCTEST_FLAGS) |
451 | 47 | *doctest_files, optionflags=DOCTEST_FLAGS, checker=checker | ||
452 | 48 | ) | ||
454 | 49 | suite.layer = WSGILayer | 43 | suite.layer = WSGILayer |
455 | 50 | tests.addTest(suite) | 44 | tests.addTest(suite) |
456 | 51 | return tests | 45 | return tests |
457 | diff --git a/src/lazr/restful/example/multiversion/tests/test_integration.py b/src/lazr/restful/example/multiversion/tests/test_integration.py | |||
458 | index ee04982..d36db07 100644 | |||
459 | --- a/src/lazr/restful/example/multiversion/tests/test_integration.py | |||
460 | +++ b/src/lazr/restful/example/multiversion/tests/test_integration.py | |||
461 | @@ -10,7 +10,6 @@ from pkg_resources import resource_filename | |||
462 | 10 | 10 | ||
463 | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer |
464 | 12 | from zope.component import getUtility | 12 | from zope.component import getUtility |
465 | 13 | from zope.testing import renormalizing | ||
466 | 14 | 13 | ||
467 | 15 | from lazr.restful.example.multiversion.root import ( | 14 | from lazr.restful.example.multiversion.root import ( |
468 | 16 | MultiversionWebServiceRootResource, | 15 | MultiversionWebServiceRootResource, |
469 | @@ -25,9 +24,6 @@ DOCTEST_FLAGS = ( | |||
470 | 25 | ) | 24 | ) |
471 | 26 | 25 | ||
472 | 27 | 26 | ||
473 | 28 | checker = renormalizing.OutputChecker() | ||
474 | 29 | |||
475 | 30 | |||
476 | 31 | class FunctionalLayer: | 27 | class FunctionalLayer: |
477 | 32 | zcml = os.path.abspath( | 28 | zcml = os.path.abspath( |
478 | 33 | resource_filename("lazr.restful.example.multiversion", "site.zcml") | 29 | resource_filename("lazr.restful.example.multiversion", "site.zcml") |
479 | @@ -56,9 +52,7 @@ def load_tests(loader, tests, pattern): | |||
480 | 56 | for name in os.listdir(os.path.dirname(__file__)) | 52 | for name in os.listdir(os.path.dirname(__file__)) |
481 | 57 | if name.endswith(".txt") | 53 | if name.endswith(".txt") |
482 | 58 | ) | 54 | ) |
486 | 59 | suite = doctest.DocFileSuite( | 55 | suite = doctest.DocFileSuite(*doctest_files, optionflags=DOCTEST_FLAGS) |
484 | 60 | *doctest_files, optionflags=DOCTEST_FLAGS, checker=checker | ||
485 | 61 | ) | ||
487 | 62 | suite.layer = WSGILayer | 56 | suite.layer = WSGILayer |
488 | 63 | tests.addTest(suite) | 57 | tests.addTest(suite) |
489 | 64 | return tests | 58 | return tests |
490 | diff --git a/src/lazr/restful/example/wsgi/tests/test_integration.py b/src/lazr/restful/example/wsgi/tests/test_integration.py | |||
491 | index cc02ba7..84b2017 100644 | |||
492 | --- a/src/lazr/restful/example/wsgi/tests/test_integration.py | |||
493 | +++ b/src/lazr/restful/example/wsgi/tests/test_integration.py | |||
494 | @@ -10,7 +10,6 @@ from pkg_resources import resource_filename | |||
495 | 10 | 10 | ||
496 | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer | 11 | from van.testing.layer import zcml_layer, wsgi_intercept_layer |
497 | 12 | from zope.component import getUtility | 12 | from zope.component import getUtility |
498 | 13 | from zope.testing import renormalizing | ||
499 | 14 | 13 | ||
500 | 15 | from lazr.restful.example.wsgi.root import WSGIExampleWebServiceRootResource | 14 | from lazr.restful.example.wsgi.root import WSGIExampleWebServiceRootResource |
501 | 16 | from lazr.restful.interfaces import IWebServiceConfiguration | 15 | from lazr.restful.interfaces import IWebServiceConfiguration |
502 | @@ -23,9 +22,6 @@ DOCTEST_FLAGS = ( | |||
503 | 23 | ) | 22 | ) |
504 | 24 | 23 | ||
505 | 25 | 24 | ||
506 | 26 | checker = renormalizing.OutputChecker() | ||
507 | 27 | |||
508 | 28 | |||
509 | 29 | class FunctionalLayer: | 25 | class FunctionalLayer: |
510 | 30 | zcml = os.path.abspath( | 26 | zcml = os.path.abspath( |
511 | 31 | resource_filename("lazr.restful.example.wsgi", "site.zcml") | 27 | resource_filename("lazr.restful.example.wsgi", "site.zcml") |
512 | @@ -54,9 +50,7 @@ def load_tests(loader, tests, pattern): | |||
513 | 54 | for name in os.listdir(os.path.dirname(__file__)) | 50 | for name in os.listdir(os.path.dirname(__file__)) |
514 | 55 | if name.endswith(".txt") | 51 | if name.endswith(".txt") |
515 | 56 | ) | 52 | ) |
519 | 57 | suite = doctest.DocFileSuite( | 53 | suite = doctest.DocFileSuite(*doctest_files, optionflags=DOCTEST_FLAGS) |
517 | 58 | *doctest_files, optionflags=DOCTEST_FLAGS, checker=checker | ||
518 | 59 | ) | ||
520 | 60 | suite.layer = WSGILayer | 54 | suite.layer = WSGILayer |
521 | 61 | tests.addTest(suite) | 55 | tests.addTest(suite) |
522 | 62 | return tests | 56 | return tests |