Skip to content

Running coverage combine twice deletes all coverage data #516

@nedbat

Description

@nedbat

Originally reported by John Vandenberg (Bitbucket: jayvdb, GitHub: jayvdb)


If combine is run twice, it replaces the coverage data with an empty coverage file, rather silently.

This can happen when two coverage related tools are used consecutively, and both think they are able to (and should) run coverage combine before analysing the coverage data. Both tools will execute without error, but the second tool be analysing empty coverage data.

On the first coverage combine run, the multiple partial coverage files are merged into one coverage file (and the partial coverage files removed)

On the second coverage combine run, there are no partial coverage files, so a single empty coverage file is created, as of v4.2.

This is a specific case of https://bitbucket.org/ned/coveragepy/issues/412/coverage-combine-should-error-if-no, and possibly also related to https://bitbucket.org/ned/coveragepy/issues/511/version-42-coverage-combine-empties .

If there are no .coverage.* files, there is nothing to combine, and it should cause an error.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions