This is because pytest-cov doesn't actually start coverage measurement until pytest_sessionstart.
I think it could perhaps be fixed by starting coverage measurement instead in pytest_load_initial_conftests, but a few things about this make me nervous:
-
If people are setting up their coverage options via some method other than command-line args (e.g. modifying the config in another hook or plugin) it would no longer take effect soon enough.
-
I'm not familiar with the distributed-coverage aspect of pytest-cov and cov-core, so I'm not sure what implications there might be there.