[py-dev] conftest global scope

meme dough memedough at gmail.com
Sun May 1 11:15:16 CEST 2011


pytest-cov has an issue ticket that conftest global scope has no
coverage reported.

I don't think it will be possible to cover though.  My understanding
is that conftest file is local plugin which pytest will load quite

It then can have hooks in conftest like to add args or change args.

Coverage starts at session start hook which I think most appropriate.
The hooks in conftest (like configure) could change things to turn
coverage on / off or set coverage paths.  So starting coverage any
earlier than session start may not be good.

Is this correct with conftest?  It is not reloaded is it?  It gets
loaded early and hooks in it called to modify pytest operations.  So
no way we could get coverage at conftest global scope anyway?


More information about the Pytest-dev mailing list