Skip to content

Commit 3b624cf

Browse files
authored
Merge pull request #93 from billsacks/work_on_coverage
Run a single coverage command rather than two separate commands I was finding that, even with the '--append' flag, some of the coverage results were getting overwritten in the second run, resulting in a too-low coverage report. This turns out to have no effect on the reported coverage on master, but it fixes the coverage report for #90: without this change, some lines that are covered only by unit tests are listed as uncovered in the final coverage report (at least, I think that's what was going on). User interface changes?: No Fixes: None Testing: test removed: changed 'make coverage' operation unit tests: system tests: manual testing:
2 parents 144f7d9 + 2562830 commit 3b624cf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PYLINT_ARGS=-j 2 --rcfile=.pylint.rc
3939

4040
# code coverage
4141
COVERAGE=coverage
42-
COVERAGE_ARGS=--rcfile=.coveragerc --append
42+
COVERAGE_ARGS=--rcfile=.coveragerc
4343

4444
# source files
4545
SRC = \
@@ -92,10 +92,13 @@ lint : FORCE
9292
stylint : style lint
9393

9494
.PHONY : coverage
95+
# Need to use a single coverage run with a single pattern rather than
96+
# using two separate commands with separate patterns for test_unit_*.py
97+
# and test_sys_*.py: The latter clobbers some results from the first
98+
# run, even if we use the --append flag to 'coverage run'.
9599
coverage : FORCE
96100
$(PYPATH) $(COVERAGE) erase
97-
$(PYPATH) $(COVERAGE) run $(COVERAGE_ARGS) $(TEST_ARGS) --pattern 'test_unit_*.py'
98-
$(PYPATH) $(COVERAGE) run $(COVERAGE_ARGS) $(TEST_ARGS) --pattern 'test_sys_*.py'
101+
$(PYPATH) $(COVERAGE) run $(COVERAGE_ARGS) $(TEST_ARGS) --pattern 'test_*.py'
99102
$(PYPATH) $(COVERAGE) html
100103

101104
#

0 commit comments

Comments
 (0)