Skip to content

Added documentation to the doctests.py #1271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doctests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,27 @@

# Note loader and ignore are required arguments for unittest even if unused.
def load_tests(loader, tests, ignore):
"""
Locates and returns a collection of unittests in a TestSuite object
Parameters
----------
loader :
A required but unused parameter.
tests :
A unittest TestSuite object for collecting the needed test cases.
ignore :
A required but unused parameter.
Returns
-------
tests :
A unittest TestSuite object that holds test cases.
"""
for root, dirs, files in os.walk("."):
for f in files:
if f.endswith(".rst"):
tests.addTests(
doctest.DocFileSuite(
# ELLIPSIS option tells doctest to ignore portions of the verification value.
os.path.join(root, f), optionflags=doctest.ELLIPSIS
)
)
Expand Down