16

The documentation of coverage.py says that Many people choose to use the pytest-cov plugin, but for most purposes, it is unnecessary. So I would like to know what is the difference between these two? And which one is the most efficient ?

Thank you in advance

knia
  • 463
  • 6
  • 16
yosra
  • 702
  • 1
  • 11
  • 24

1 Answers1

16

pytest-cov uses coverage.py, so there's no different in efficiency, or basic behavior. pytest-cov auto-configures multiprocessing settings, and ferries data around if you use pytest-xdist.

Ned Batchelder
  • 364,293
  • 75
  • 561
  • 662
  • 1
    One unusual case where you'd rather use coverage directly is when you test the coverage of a pytest plugin, as discussed in [how-to-get-coverage-reporting-when-testing-a-pytest-plugin](https://stackoverflow.com/questions/62221654/how-to-get-coverage-reporting-when-testing-a-pytest-plugin) – Yonatan Jun 10 '22 at 16:08