nedbat / coveragepy

The code coverage tool for Python
https://coverage.readthedocs.io
Apache License 2.0
3.03k stars 435 forks source link

Add something like Collector to the public API #603

Open nedbat opened 7 years ago

nedbat commented 7 years ago

Originally reported by David MacIver (Bitbucket: davidmaciver, GitHub: Unknown)


As part of Hypothesis's new coverage guided test generation, I want to be able to run the coverage collector infrastructure without worrying about saving to the file system, etc.

I am currently using a number of APIs that are clearly internal and would prefer not to be.

I don't know that the right thing to do would be to just declare the Collector API public - it has a lot of little details that made it a bit awkward to use here (e.g. file disposition types), but perhaps it would be possible to write a small user friendly wrapper around it and make that part of the public API?

I'd be happy to try to put together a pull request for this if you're amenable.


nedbat commented 4 years ago

@DRMacIver I'm not sure Hypopthesis still needs these changes. I've opened a related issue: https://github.com/nedbat/coveragepy/issues/921