Permalink
Browse files

Exclude indirect-doctests from coverage

Indirect doctests are not part of coverage -- that is they
need to be looked into. Hence they should not account for
"documented" members.
  • Loading branch information...
1 parent fcab4b6 commit b923139c58d1ce090c479e1e36ccb52570ad1524 Sanket Agarwal committed Mar 16, 2012
Showing with 6 additions and 8 deletions.
  1. +6 −8 bin/coverage_doctest.py
View
@@ -185,11 +185,10 @@ def process_function(name, c_name, b_obj, mod_path, f_sk, f_md, f_mdt, f_idt, f_
add_md = True
elif not '>>>' in obj.__doc__:
add_mdt = True
- else:
- # Indirect doctest
- if _is_indirect(name, obj.__doc__):
+ elif _is_indirect(name, obj.__doc__):
add_idt = True
- f_doctest = True
+ else: f_doctest = True
+
function = True
if add_md or add_mdt or add_idt:
@@ -229,12 +228,11 @@ def process_class(c_name, obj, c_md, c_mdt, c_idt, c_has_doctest):
full_name = "LINE %d: %s" % (line_no, c_name)
if not obj.__doc__: c_md.append(full_name)
elif not '>>>' in obj.__doc__: c_mdt.append(full_name)
- else:
+ elif _is_indirect(c_name, obj.__doc__):
+ c_idt.append(full_name)
+ else: # indirect doctest
c_dt = True
c_has_doctest.append(full_name)
- # indirect doctest
- if _is_indirect(c_name, obj.__doc__):
- c_idt.append(full_name)
return c_dt, c
def coverage(module_path, verbose=False):

0 comments on commit b923139

Please sign in to comment.