pytest-cov icon indicating copy to clipboard operation
pytest-cov copied to clipboard

add lcov as output format

Open alexises opened this issue 2 years ago • 2 comments

I'm currently try to setup automatic code coverage into vscode. the only available plugin require that coverage output is set as lcov format.

This format support had been integrated recently into coverage lib : https://coverage.readthedocs.io/en/6.3.2/cmd.html#lcov-reporting-coverage-lcov and I need it into pytest-cov for a good integration

This feature seen to be quite simple to implement :

  • from def validate_report(arg): we should add the new format into file_choices
  • from def summary(self, stream): on engine, we should add a block for lcov format like the one for xml on line 193-197

I'm not sure if it's fullfill all the needed work, but it's a good start

alexises avatar May 23 '22 21:05 alexises

You don't need to add anything to pytest-cov. Just run coverage lcov after you run pytest.

nedbat avatar May 23 '22 21:05 nedbat

Technically it's work, but with the integration with vscode it's require one manual step.

My main interrogation is why it could be an issue to add another output format. Let the code as this break expectation that all format supported inside coverage library is supported inside pytest-cov

alexises avatar May 24 '22 18:05 alexises