8000 Merge pull request #134 from alalazo/fixes/coverage_combine · samuelpiltch/codecov-python@3892a1e · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Dec 17, 2018. It is now read-only.

Commit 3892a1e

Browse files
author
Steve Peak
authored
Merge pull request codecov#134 from alalazo/fixes/coverage_combine
coverage combine does not delete .coverage file if present
2 parents c30509b + ed2482b commit 3892a1e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

codecov/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,14 @@ def main(*argv, **kwargs):
657657
# Call `coverage xml` when .coverage exists
658658
# -----------------------------------------
659659
# Ran from current directory
660-
if os.path.exists(opj(os.getcwd(), '.coverage')) and not os.path.exists(opj(os.getcwd(), 'coverage.xml')):
661-
if glob.glob(opj(os.getcwd(), '.coverage.*')):
662-
write(' Mergeing coverage reports')
663-
try_to_run('coverage combine')
660+
if glob.glob(opj(os.getcwd(), '.coverage.*')):
661+
write(' Mergeing coverage reports')
662+
# The `-a` option is mandatory here. If we
663+
# have a `.coverage` in the current directory, calling
664+
# without the option would delete the previous data
665+
try_to_run('coverage combine -a')
664666

667+
if os.path.exists(opj(os.getcwd(), '.coverage')) and not os.path.exists(opj(os.getcwd(), 'coverage.xml')):
665668
write(' Generating coverage xml reports for Python')
666669
# using `-i` to ignore "No source for code" error
667670
try_to_run('coverage xml -i')

0 commit comments

Comments
 (0)
0