1# PYTHON_ARGCOMPLETE_OK

2"""pytest: unit and functional testing with Python."""

3 from _pytest import __version__

4 from _pytest import version_tuple

5 from _pytest._code import ExceptionInfo

6 from _pytest.assertion import register_assert_rewrite

7 from _pytest.cacheprovider import Cache

8 from _pytest.capture import CaptureFixture

9 from _pytest.config import cmdline

10 from _pytest.config import Config

11 from _pytest.config import console_main

12 from _pytest.config import ExitCode

13 from _pytest.config import hookimpl

14 from _pytest.config import hookspec

15 from _pytest.config import main

16 from _pytest.config import PytestPluginManager

17 from _pytest.config import UsageError

18 from _pytest.config.argparsing import OptionGroup

19 from _pytest.config.argparsing import Parser

20 from _pytest.debugging import pytestPDB as __pytestPDB

21 from _pytest.doctest import DoctestItem

22 from _pytest.fixtures import fixture

23 from _pytest.fixtures import FixtureLookupError

24 from _pytest.fixtures import FixtureRequest

25 from _pytest.fixtures import yield_fixture

26 from _pytest.freeze_support import freeze_includes

27 from _pytest.legacypath import TempdirFactory

28 from _pytest.legacypath import Testdir

29 from _pytest.logging import LogCaptureFixture

30 from _pytest.main import Session

31 from _pytest.mark import Mark

32 from _pytest.mark import MARK_GEN as mark

33 from _pytest.mark import MarkDecorator

34 from _pytest.mark import MarkGenerator

35 from _pytest.mark import param

36 from _pytest.monkeypatch import MonkeyPatch

37 from _pytest.nodes import Collector

38 from _pytest.nodes import File

39 from _pytest.nodes import Item

40 from _pytest.outcomes import exit

41 from _pytest.outcomes import fail

42 from _pytest.outcomes import importorskip

43 from _pytest.outcomes import skip

44 from _pytest.outcomes import xfail

45 from _pytest.pytester import HookRecorder

46 from _pytest.pytester import LineMatcher

47 from _pytest.pytester import Pytester

48 from _pytest.pytester import RecordedHookCall

49 from _pytest.pytester import RunResult

50 from _pytest.python import Class

51 from _pytest.python import Function

52 from _pytest.python import Metafunc

53 from _pytest.python import Module

54 from _pytest.python import Package

55 from _pytest.python_api import approx

56 from _pytest.python_api import raises

57 from _pytest.recwarn import deprecated_call

58 from _pytest.recwarn import WarningsRecorder

59 from _pytest.recwarn import warns

60 from _pytest.reports import CollectReport

61 from _pytest.reports import TestReport

62 from _pytest.runner import CallInfo

63 from _pytest.stash import Stash

64 from _pytest.stash import StashKey

65 from _pytest.tmpdir import TempPathFactory

66 from _pytest.warning_types import PytestAssertRewriteWarning

67 from _pytest.warning_types import PytestCacheWarning

68 from _pytest.warning_types import PytestCollectionWarning

69 from _pytest.warning_types import PytestConfigWarning

70 from _pytest.warning_types import PytestDeprecationWarning

71 from _pytest.warning_types import PytestExperimentalApiWarning

72 from _pytest.warning_types import PytestRemovedIn8Warning

73 from _pytest.warning_types import PytestReturnNotNoneWarning

74 from _pytest.warning_types import PytestUnhandledCoroutineWarning

75 from _pytest.warning_types import PytestUnhandledThreadExceptionWarning

76 from _pytest.warning_types import PytestUnknownMarkWarning

77 from _pytest.warning_types import PytestUnraisableExceptionWarning

78 from _pytest.warning_types import PytestWarning

79

80 set_trace = __pytestPDB.set_trace

81

82

83__all__ = [

84 "__version__",

85 "approx",

86 "Cache",

87 "CallInfo",

88 "CaptureFixture",

89 "Class",

90 "cmdline",

91 "Collector",

92 "CollectReport",

93 "Config",

94 "console_main",

95 "deprecated_call",

96 "DoctestItem",

97 "exit",

98 "ExceptionInfo",

99 "ExitCode",

100 "fail",

101 "File",

102 "fixture",

103 "FixtureLookupError",

104 "FixtureRequest",

105 "freeze_includes",

106 "Function",

107 "hookimpl",

108 "HookRecorder",

109 "hookspec",

110 "importorskip",

111 "Item",

112 "LineMatcher",

113 "LogCaptureFixture",

114 "main",

115 "mark",

116 "Mark",

117 "MarkDecorator",

118 "MarkGenerator",

119 "Metafunc",

120 "Module",

121 "MonkeyPatch",

122 "OptionGroup",

123 "Package",

124 "param",

125 "Parser",

126 "PytestAssertRewriteWarning",

127 "PytestCacheWarning",

128 "PytestCollectionWarning",

129 "PytestConfigWarning",

130 "PytestDeprecationWarning",

131 "PytestExperimentalApiWarning",

132 "PytestRemovedIn8Warning",

133 "PytestReturnNotNoneWarning",

134 "Pytester",

135 "PytestPluginManager",

136 "PytestUnhandledCoroutineWarning",

137 "PytestUnhandledThreadExceptionWarning",

138 "PytestUnknownMarkWarning",

139 "PytestUnraisableExceptionWarning",

140 "PytestWarning",

141 "raises",

142 "RecordedHookCall",

143 "register_assert_rewrite",

144 "RunResult",

145 "Session",

146 "set_trace",

147 "skip",

148 "Stash",

149 "StashKey",

150 "version_tuple",

151 "TempdirFactory",

152 "TempPathFactory",

153 "Testdir",

154 "TestReport",

155 "UsageError",

156 "WarningsRecorder",

157 "warns",

158 "xfail",

159 "yield_fixture",

160]

161

162

163 def __getattr__(name: str) -> object:

164 if name == "Instance":

165 # The import emits a deprecation warning.

166 from _pytest.python import Instance

167

168 return Instance

169 raise AttributeError(f"module {__name__} has no attribute {name}")