Skip to content

Commit

Permalink
Merge pull request #545 from GavinHuttley/develop
Browse files Browse the repository at this point in the history
DEV: infer doc file type from suffix if single file provided
  • Loading branch information
GavinHuttley committed Feb 23, 2020
2 parents 3ca9c14 + 035b22b commit 078f7a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/doctest_rsts.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def main(file_paths, just, exclude, exit_on_first, suffix, verbose):
if "," in file_paths:
file_paths = file_paths.split(",")
elif pathlib.Path(file_paths).is_file():
p = pathlib.Path(file_paths)
assert p.suffix.lower() in ".rst.ipynb", f"Unknown format suffix '{p.suffix}'"
suffix = p.suffix[1:]
file_paths = [file_paths]
else:
file_paths = list(pathlib.Path(file_paths).glob(f"*.{suffix}"))
Expand Down

0 comments on commit 078f7a8

Please sign in to comment.