bpo-33833: Fix ProactorSocketTransport AssertionError by twisteroidambassador · Pull Request #7632 · python/cpython

@twisteroidambassador

@twisteroidambassador

@1st1

Can we have a unittest for this?

@twisteroidambassador

Can we have a unittest for this?

It may require a bit of advanced Mock() magic. The preconditions are somewhat complex, and the exception is raised in a done_callback, so usually it just goes to the log and nowhere else.

@1st1

It may require a bit of advanced Mock() magic. The preconditions are somewhat complex

Yeah, let's not add more complex mock tests. But if it's possible to recreate the preconditions with a functional test it would be enormously helpful.

and the exception is raised in a done_callback, so usually it just goes to the log and nowhere else.

We have assertLogs or something like that :)

@twisteroidambassador

@twisteroidambassador

@twisteroidambassador

Now we have a unit test and blurb.

(I am reminded of this joke when writing the test:

Patient: "Doctor, it hurts when I do this."
Doctor: "Don't do that.")