diff options
author | reybog90 <reybog90@o2.pl> | 2019-10-30 20:04:20 +0100 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-11-01 06:36:13 -0400 |
commit | 9b11268c358040abf7384702c3bc0e863ab753c5 (patch) | |
tree | e657af6f7eb583354f41c455bee639aaaf9a39fa /coverage/html.py | |
parent | 49e06d33ea63d8e3e44ab5b69d713783551dfaa9 (diff) | |
download | python-coveragepy-git-9b11268c358040abf7384702c3bc0e863ab753c5.tar.gz |
Optionally skip empty files in reports
Diffstat (limited to 'coverage/html.py')
-rw-r--r-- | coverage/html.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/coverage/html.py b/coverage/html.py index 4a0e1a33..e3b814c5 100644 --- a/coverage/html.py +++ b/coverage/html.py @@ -282,6 +282,12 @@ class HtmlReporter(object): file_be_gone(html_path) return + if self.config.skip_empty: + # Don't report on empty files. + if nums.n_statements == 0: + file_be_gone(html_path) + return + # Find out if the file on disk is already correct. if self.incr.can_skip_file(self.data, fr, rootname): self.file_summaries.append(self.incr.index_info(rootname)) |