@@ -73,6 +73,10 @@ def _make_validation_func_callable(vf_definition # type: ValidationFuncDefiniti
7373
7474 If `vf_definition` is a single <validation_func> callable, it is returned directly (no wrapping)
7575
76+ >>> import sys, pytest
77+ >>> if sys.version_info < (3, 0):
78+ ... pytest.skip('doctest skipped in python 2 because exception namespace is different but details matter')
79+
7680 >>> def vf(x): return x + 1 == 0
7781 >>> assert _make_validation_func_callable(vf) is vf
7882
@@ -85,7 +89,7 @@ def _make_validation_func_callable(vf_definition # type: ValidationFuncDefiniti
8589 >>> vf_with_details('hello')
8690 Traceback (most recent call last):
8791 ...
88- MyFailure: blah. Function [vf] raised [TypeError: can...
92+ valid8.common_syntax. MyFailure: blah. Function [vf] raised [TypeError: can...
8993
9094 Notes:
9195
@@ -176,6 +180,10 @@ def _make_validation_func_callables(*vf_definition # type: OneOrSeveralVFDefini
176180 and a tuple containing the results will be returned. See `_make_validation_func_callable` for details on the
177181 supported tuples to use.
178182
183+ >>> import sys, pytest
184+ >>> if sys.version_info < (3, 0):
185+ ... pytest.skip('doctest skipped in python 2 because exception namespace is different but details matter')
186+
179187 >>> # two dummy validation callables
180188 >>> def is_big(x): return x > 10
181189 >>> def is_minus_1(x): return x + 1 == 0
@@ -191,7 +199,7 @@ def _make_validation_func_callables(*vf_definition # type: OneOrSeveralVFDefini
191199 >>> several_vfs[1]('hello')
192200 Traceback (most recent call last):
193201 ...
194- MyFailure: not minus 1!. Function [is_minus_1] raised [TypeError: can...
202+ valid8.common_syntax. MyFailure: not minus 1!. Function [is_minus_1] raised [TypeError: can...
195203
196204 If a single `vf_definition` is provided AND it is a non-tuple iterable (typically a list),
197205 `_make_validation_func_callables(vf_definition)` is equivalent to `_make_validation_func_callables(*vf_definition)`
@@ -209,7 +217,7 @@ def _make_validation_func_callables(*vf_definition # type: OneOrSeveralVFDefini
209217 >>> vfs[0](2)
210218 Traceback (most recent call last):
211219 ...
212- WrappingFailure : x should be big. Function [is_big] returned [False] for value 2.
220+ valid8.base.ValidationFailed : x should be big. Function [is_big] returned [False] for value 2.
213221
214222 :param vf_definition: the base validation function or list of base validation functions to use. A callable, a
215223 tuple(callable, help_msg_str), a tuple(callable, failure_type), tuple(callable, help_msg_str, failure_type)
0 commit comments