Collect any tests from a package's __init__.py
This commit is contained in:
parent
4d8903fd0b
commit
d0bd01beca
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue