| 26 | python_version = sys.version_info[:2] |
| 27 | |
| 28 | def load_tests(loader, tests, ignore): |
| 29 | tests.addTests(doctest.DocTestSuite(enum)) |
| 30 | |
| 31 | lib_tests = os.path.join(REPO_ROOT, 'Doc/library/enum.rst') |
| 32 | if os.path.exists(lib_tests): |
| 33 | tests.addTests(doctest.DocFileSuite( |
| 34 | lib_tests, |
| 35 | module_relative=False, |
| 36 | optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE, |
| 37 | )) |
| 38 | howto_tests = os.path.join(REPO_ROOT, 'Doc/howto/enum.rst') |
| 39 | if os.path.exists(howto_tests) and sys.float_repr_style == 'short': |
| 40 | tests.addTests(doctest.DocFileSuite( |
| 41 | howto_tests, |
| 42 | module_relative=False, |
| 43 | optionflags=doctest.ELLIPSIS|doctest.NORMALIZE_WHITESPACE, |
| 44 | )) |
| 45 | return tests |
| 46 | |
| 47 | def reraise_if_not_enum(*enum_types_or_exceptions): |
| 48 | from functools import wraps |