Skip to content

Commit

Permalink
Add a test for docstring coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vcatlett committed Dec 7, 2023
1 parent e4e438b commit f7cf746
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .docstr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
paths: # list or string
- docstr_coverage
badge: docs # Path
exclude: .*/test # regex
verbose: 3 # int (0-4)
skip_magic: True # Boolean
skip_file_doc: True # Boolean
skip_init: True # Boolean
skip_class_def: True # Boolean
skip_private: True # Boolean
follow_links: True # Boolean
accept_empty: True # Boolean
ignore_names_file: .*/test # regex
fail_under: 90 # int
percentage_only: True # Boolean
12 changes: 12 additions & 0 deletions src/dysh/tests/test_docstr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from docstr_coverage import analyze
from glob import glob

def test_docstring_coverage():
"""
Checks that the percentage of Python functions with docstrings
is >= 0%
"""
pyfiles = glob('./**/*.py', recursive = True)
coverage_report = analyze(pyfiles)
coverage = coverage_report.count_aggregate().coverage()
assert coverage >= 0

0 comments on commit f7cf746

Please sign in to comment.