01/20/2023, 3:40 PM
I don’t know if it’s the way works or it’s the pants integration but the coverage doesn’t include those modules which aren’t imported by the tests. I thought it would look at all the source files and then compare it with the tests inside the test files.
So if I don’t write any tests, the coverage would be 100%? 😄
I think it’s the issue with the pants integration. I ran it outside directly using coverage and it looks at all the source files under a provided directory.


01/20/2023, 4:10 PM
Yeah, coverage expects to have a global view of all sources, which is at odds with the monorepo way of doing things incrementally (and also doesn't really scale).
We'd have to copy all the sources into the sandbox


01/20/2023, 4:11 PM
I am actually filtering currently. So it should only copy all the source files inside these directories.
So what works is setting the
option inside the config file. I am using
. So I set
Copy code
omit = ["*/tests/*"]
source = [
Actually I spoke too soon. This doesn’t work either. Not sure what’s going on since pants is also using
pytest --cov=source ..
when the filter option is provided. But the results don’t match with running pytest locally with
option. It does include all the source files inside the source directory. In case of pants that doesn’t happen.