-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
plugin: doctestsrelated to the doctests builtin pluginrelated to the doctests builtin plugintopic: collectionrelated to the collection phaserelated to the collection phasetype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
pytest --doctest-modules __init__.py
will only collect a single doctest because of this:
Lines 768 to 781 in e986d84
# If __init__.py was the only file requested, then the matched node will be | |
# the corresponding Package, and the first yielded item will be the __init__ | |
# Module itself, so just use that. If this special case isn't taken, then all | |
# the files in the package will be yielded. | |
if argpath.basename == "__init__.py": | |
assert isinstance(matching[0], nodes.Collector) | |
try: | |
yield next(iter(matching[0].collect())) | |
except StopIteration: | |
# The package collects nothing with only an __init__.py | |
# file in it, which gets ignored by the default | |
# "python_files" option. | |
pass | |
continue |
Introduced a while back by @kchmck here: 5ac4eff
See failing tests: #8015
Metadata
Metadata
Assignees
Labels
plugin: doctestsrelated to the doctests builtin pluginrelated to the doctests builtin plugintopic: collectionrelated to the collection phaserelated to the collection phasetype: bugproblem that needs to be addressedproblem that needs to be addressed