22"""
33pytest: unit and functional testing with Python.
44"""
5+
6+
7+ # else we are imported
8+
9+ from _pytest .config import (
10+ main , UsageError , _preloadplugins , cmdline ,
11+ hookspec , hookimpl
12+ )
13+ from _pytest .fixtures import fixture , yield_fixture
14+ from _pytest .assertion import register_assert_rewrite
15+ from _pytest .freeze_support import freeze_includes
16+ from _pytest import __version__
17+ from _pytest .debugging import pytestPDB as __pytestPDB
18+ from _pytest .recwarn import warns , deprecated_call
19+ from _pytest .runner import fail , skip , importorskip , exit
20+ from _pytest .mark import MARK_GEN as mark
21+ from _pytest .skipping import xfail
22+ from _pytest .main import Item , Collector , File , Session
23+ from _pytest .fixtures import fillfixtures as _fillfuncargs
24+ from _pytest .python import (
25+ raises , approx ,
26+ Module , Class , Instance , Function , Generator ,
27+ )
28+
29+ set_trace = __pytestPDB .set_trace
30+
531__all__ = [
632 'main' ,
733 'UsageError' ,
2248 'importorskip' ,
2349 'exit' ,
2450 'mark' ,
25-
51+ 'approx' ,
2652 '_fillfuncargs' ,
2753
2854 'Item' ,
2955 'File' ,
3056 'Collector' ,
3157 'Session' ,
58+ 'Module' ,
59+ 'Class' ,
60+ 'Instance' ,
61+ 'Function' ,
62+ 'Generator' ,
63+ 'raises' ,
3264
3365
3466]
3567
36- if __name__ == '__main__' : # if run as a script or by 'python -m pytest'
68+ if __name__ == '__main__' :
69+ # if run as a script or by 'python -m pytest'
3770 # we trigger the below "else" condition by the following import
3871 import pytest
3972 raise SystemExit (pytest .main ())
73+ else :
4074
41- # else we are imported
42-
43- from _pytest .config import (
44- main , UsageError , _preloadplugins , cmdline ,
45- hookspec , hookimpl
46- )
47- from _pytest .fixtures import fixture , yield_fixture
48- from _pytest .assertion import register_assert_rewrite
49- from _pytest .freeze_support import freeze_includes
50- from _pytest import __version__
51- from _pytest .debugging import pytestPDB as __pytestPDB
52- from _pytest .recwarn import warns , deprecated_call
53- from _pytest .runner import fail , skip , importorskip , exit
54- from _pytest .mark import MARK_GEN as mark
55- from _pytest .skipping import xfail
56- from _pytest .main import Item , Collector , File , Session
57- from _pytest .fixtures import fillfixtures as _fillfuncargs
58- from _pytest .python import (
59- raises , approx ,
60- Module , Class , Instance , Function , Generator ,
61- )
62-
63-
64- set_trace = __pytestPDB .set_trace
65-
66-
67- from _pytest .compat import _setup_collect_fakemodule
68- _preloadplugins () # to populate pytest.* namespace so help(pytest) works
69- _setup_collect_fakemodule ()
75+ from _pytest .compat import _setup_collect_fakemodule
76+ _preloadplugins () # to populate pytest.* namespace so help(pytest) works
77+ _setup_collect_fakemodule ()
0 commit comments