decorators
¶
Decorators for FURY tests.
|
Decorator replaces custom skip test markup in doctests. |
doctest_skip_parser¶
-
fury.decorators.
doctest_skip_parser
(func)[source]¶ Decorator replaces custom skip test markup in doctests.
Say a function has a docstring:: >>> something # skip if not HAVE_AMODULE >>> something + else >>> something # skip if HAVE_BMODULE This decorator will evaluate the expresssion after
skip if
. If this evaluates to True, then the comment is replaced by# doctest: +SKIP
. If False, then the comment is just removed. The expression is evaluated in theglobals
scope of func. For example, if the module globalHAVE_AMODULE
is False, and module globalHAVE_BMODULE
is False, the returned function will have docstring:: >>> something # doctest: +SKIP >>> something + else >>> something