Integration Testing for Exception thrown in Awake

I would like to test that a component of mine throws an exception for certain conditions during Awake(). When I use the Unity Test Tools Test Component, though, the test fails because of the exception, even though “Expect exception” and “Succeed when exception is thrown” are both checked. The test passes when I throw the same exception in Start, though.

Am I testing wrong? or perhaps implementing bad design? I can’t find documentation on the Test Component to say anything about not catching exceptions thrown during Awake().

Does anybody have any idea why this might be?

I think this is just a limitation in the integration test runner. Personally, i find the current implementation of integration tests cumbersome and confusing.

Can you describe how you’ve setup your integration test? i could try to reproduce the same structure and test it myself.

Hi again,
Sorry for the late reply!

I’ve a Test Component with:
Expect exception: true
Succeed when exception thrown: true

and a GameObject that throws an exception during the Awake() method.

The integration test fails with ‘Failed with exception’ message :hushed: