Collect any tests from a package's __init__.py

This commit is contained in:
turturica 2018-08-09 18:06:38 -07:00
parent 4d8903fd0b
commit d0bd01beca
1 changed files with 1 additions and 0 deletions

View File

@ -596,6 +596,7 @@ class Package(Module):
def collect(self): def collect(self):
this_path = self.fspath.dirpath() this_path = self.fspath.dirpath()
pkg_prefix = None pkg_prefix = None
yield Module(this_path.join("__init__.py"), self)
for path in this_path.visit(rec=self._recurse, bf=True, sort=True): for path in this_path.visit(rec=self._recurse, bf=True, sort=True):
# we will visit our own __init__.py file, in which case we skip it # we will visit our own __init__.py file, in which case we skip it
if path.basename == "__init__.py" and path.dirpath() == this_path: if path.basename == "__init__.py" and path.dirpath() == this_path: