Fixed two asserts in test when raising an exception

They were inside the with, so they were never executed. (Thanks to the cov plugin for this one)