1"""Decorators marks that a doctest should be skipped.
2
3The IPython.testing.decorators module triggers various extra imports, including
4numpy and sympy if they're present. Since this decorator is used in core parts
5of IPython, it's in a separate module so that running IPython doesn't trigger
6those imports."""
7from __future__ import annotations
8
9from typing import Any
10
11# Copyright (C) IPython Development Team
12# Distributed under the terms of the Modified BSD License.
13
14
15def skip_doctest(f: Any) -> Any:
16 """Decorator - mark a function or method for skipping its doctest.
17
18 This decorator allows you to mark a function whose docstring you wish to
19 omit from testing, while preserving the docstring for introspection, help,
20 etc."""
21 f.__skip_doctest__ = True
22 return f