[pytest-dev] Creating a complex PyTest program, wondering about the best way to handle collection errors, etc.

Floris Bruynooghe flub at devork.be
Fri Apr 27 16:06:05 EDT 2018


Hi Nick,

On Tue 24 Apr 2018 at 07:03 -0500, Nicholas Williams wrote:

> Wow. After carefully reading the pytest-cov plugin (only) code and the
> PyTest code that powers loading plugins, I figured it out. The plugin was
> getting loaded before pytest-cov started the Coverage analyzer. Since the
> plugin had module-level imports from other parts of our project, that meant
> that most of the project was imported (and, so, module-level imports and
> code and class definitions had already executed) before Coverage
> started.

Nice you figured this annoying issue out while I was ignoring my mail
for a while... :)  This is a bit brittle but unavoidable unfortunately.

> Thanks again for your help!

Glad my vague pointers proved useful!

Cheers,
Floris


More information about the pytest-dev mailing list