pytest claims to runs in a single thread, and all my plotting is done in the main thread, my test code does spawn background threads which do complete successfully, and do not interact with matplotlib ...
I looked at the examples in the cookbook and noticed that almost all (or maybe all) are main lines. When I took my code outside the function the problem was gone. Could it be that a function somehow ...