datacamp/pythonwhat

The easy way to extract the message associated with "TestFail"

sayakpaul opened this issue · 2 comments

Hi.

When a test fails (i.e. the submission code does not conform to the solution code) I get a long error stack. So, instead of that if I directly want to navigate to the message associated with TestFail what would be the easy way to do that?
image

You would wrap your code in a try-catch to handle the TestFail exception and extract the information you want from the exception.

Sure. That sounds good.