diff options
author | Georg Brandl <georg@python.org> | 2008-09-13 09:45:59 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-09-13 09:45:59 +0000 |
commit | afa63e57d8a0ba73784007f405e3cd39d1f1e542 (patch) | |
tree | 9bd78d12dd1b69636d94316792697867dfd9a986 /sphinx/ext/coverage.py | |
parent | 063283a1be7fc5a9288825dcecaa7358390e59a7 (diff) | |
download | sphinx-git-afa63e57d8a0ba73784007f405e3cd39d1f1e542.tar.gz |
Add test for coverage builder and fix an AttributeError in it.
Diffstat (limited to 'sphinx/ext/coverage.py')
-rw-r--r-- | sphinx/ext/coverage.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py index 98b291316..f03dbc1e2 100644 --- a/sphinx/ext/coverage.py +++ b/sphinx/ext/coverage.py @@ -73,10 +73,9 @@ class CoverageBuilder(Builder): self.build_py_coverage() self.write_py_coverage() - if self.c_sourcefiles: - self.c_undoc = {} - self.build_c_coverage() - self.write_c_coverage() + self.c_undoc = {} + self.build_c_coverage() + self.write_c_coverage() def build_c_coverage(self): # Fetch all the info from the header files @@ -216,8 +215,9 @@ class CoverageBuilder(Builder): op.writelines(' - %s\n' % x for x in methods) op.write('\n') - write_header(op, 'Modules that failed to import') - op.writelines(' * %s -- %s\n' % x for x in failed) + if failed: + write_header(op, 'Modules that failed to import') + op.writelines(' * %s -- %s\n' % x for x in failed) finally: op.close() |