"""
Test script for doctest.
"""

from test import support
from test.support import import_helper
import doctest
import functools
import os
import sys
import importlib
import importlib.abc
import importlib.util
import unittest
import tempfile
import types
import contextlib


def doctest_skip_if(condition):
    def decorator(func):
        if condition and support.HAVE_DOCSTRINGS:
            func.__doc__ = ">>> pass  # doctest: +SKIP"
        return func
    return decorator


# NOTE: There are some additional tests relating to interaction with
#       zipimport in the test_zipimport_support test module.
# There are also related tests in `test_doctest2` module.

######################################################################
## Sample Objects (used by test cases)
######################################################################

def sample_func(v):
    """
    Blah blah

    >>> print(sample_func(22))
    44

    Yee ha!
    """
    return v+v

class SampleClass:
    """
    >>> print(1)
    1
