Skip to content

Commit 8a8b1f6

Browse files
committed
eager import
1 parent 9815b69 commit 8a8b1f6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/pytest/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from _pytest.warning_types import PytestUnhandledCoroutineWarning
4545
from _pytest.warning_types import PytestUnknownMarkWarning
4646
from _pytest.warning_types import PytestWarning
47+
from pytest import collect
4748

4849

4950
set_trace = __pytestPDB.set_trace
@@ -54,6 +55,7 @@
5455
"approx",
5556
"Class",
5657
"cmdline",
58+
"collect",
5759
"Collector",
5860
"deprecated_call",
5961
"exit",

testing/test_meta.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,11 @@ def test_no_warnings(module):
3939
"-c", "import {}".format(module),
4040
))
4141
# fmt: on
42+
43+
44+
def test_pytest_collect_attribute(_sys_snapshot):
45+
del sys.modules["pytest"]
46+
47+
import pytest
48+
49+
assert pytest.collect

0 commit comments

Comments
 (0)