Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Skip classes (and their members) if it starts with underscore

  • Loading branch information...
commit 3c1b1e60ffe6b9a295d7c59fe8bcf4fe69a3edad 1 parent 12f7a48
@snktagarwal authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 bin/coverage_doctest.py
View
9 bin/coverage_doctest.py
@@ -250,12 +250,17 @@ def process_function(name, c_name, b_obj, mod_path, f_sk, f_md, f_mdt, f_idt, f_
return f_doctest, function
-def process_class(c_name, obj, c_md, c_mdt, c_idt, c_has_doctest):
+def process_class(c_name, obj, c_sk, c_md, c_mdt, c_idt, c_has_doctest):
""" Extracts information about the class regarding documentation.
It is assumed that the function calling this subroutine has already
checked that the class is valid. """
+ # Skip class case
+ if c_name.startswith('_'):
+ c_sk.append(c_name)
+ return False, False, None
+
c = False
c_dt = False
# Get the line number of class
@@ -340,7 +345,7 @@ def coverage(module_path, verbose=False):
elif inspect.isclass(obj):
# Process the class first
- c_dt, c, source = process_class(member, obj, c_md, c_mdt, c_idt, c_has_doctest)
+ c_dt, c, source = process_class(member, obj, c_skipped, c_md, c_mdt, c_idt, c_has_doctest)
if not c: continue
else: classes += 1
if c_dt: c_doctests += 1
Please sign in to comment.
Something went wrong with that request. Please try again.