Skip to content

Commit d0bd01b

Browse files
turturicaturturica
authored andcommitted
Collect any tests from a package's __init__.py
1 parent 4d8903f commit d0bd01b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/_pytest/python.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@ def isinitpath(self, path):
596596
def collect(self):
597597
this_path = self.fspath.dirpath()
598598
pkg_prefix = None
599+
yield Module(this_path.join("__init__.py"), self)
599600
for path in this_path.visit(rec=self._recurse, bf=True, sort=True):
600601
# we will visit our own __init__.py file, in which case we skip it
601602
if path.basename == "__init__.py" and path.dirpath() == this_path:

0 commit comments

Comments
 (0)