Is there any way to set panic hook reliably in the test?

A post was split to a new topic: Setting a panic hook in tests