Increasing glob-like omission of coverage files #1137
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
version
in the coveragerc file with a single*version*
__init__.py
in the coveragerc file with a single*__init__*
Motivation and Context
The coveragerc file allows us to omit certain files in our test coverage calculations. However, some
__init__.py
files have slipped through, artificially increasing the coverage percentage reported by coveralls. Using glob-like notation catches all__init__
files. Introducing glob-like notation also future-proofs the code; if future modules with__init__.py
files are added, these files needn't be manually added to coveragerc. This method has already been used for other file types (e.g.tardis/montecarlo/tests/*
), so this PR simply extends that logic.How Has This Been Tested?
I've tried testing this locally by running the advanced unit tests (
python setup.py test --args="--tardis-refdata=/Users/arjunsavel/desktop/research/supernovae/tardis-refdata"
) and subsequently checking any produced .coverage files (coverage report -m
), but it seems that the coveragerc does not affect this test; files that are not included in the coveralls calculation are included in this calculation. For example, the coveralls calculation does not include any files corresponding totardis/montecarlo/tests/*
, per the coveragerc file, but these files are included in the local coverage report. I am therefore confident that*__init__*
and*version*
should work as expected.Types of changes
Checklist: