I have a rather odd problem I cannot reproduce in clean room.
I have a rather simple class and method:
Line 21 – or any line before the
except – is not reported as covered. Even if it’s a print statement and see its output.
It seems to be related with the context manager because it's a) always the last line and b) when I rewrite it as https://gist.github.com/hynek/cfe2cc32f337e2676466 the coverage works just fine.
I’m sorry I can’t be more helpful but I’m confused as hell myself. The pool is from aiopg and seems to be semi-magical: https://github.com/aio-libs/aiopg/blob/master/aiopg/pool.py#L302 so dunno if that helps…