pytest-trio icon indicating copy to clipboard operation
pytest-trio copied to clipboard

Not sure we're propagating cancellation from fixtures in the most ideal way

Open njsmith opened this issue 7 years ago • 0 comments

As noted here: https://github.com/python-trio/pytest-trio/pull/50#issuecomment-413817328

In the course of this (and also while thinking about python-trio/trio#607), I have started to think that maybe the details of our new cancellation rules aren't quite right: I'm leaning towards saying that when a fixture crashes, we should cancel all "downstream" fixtures, but not do anything at all to independent fixtures. Right now, we only cancel the test, not other downstream fixtures... except that we also cancel all fixtures that haven't started yet, including independent ones. This means that if you have two independent fixtures that both crash during setup, you'll actually get different exceptions on different runs, randomly, depending on which one happens to run first.

njsmith avatar Aug 24 '18 11:08 njsmith