I fail at writing code

Return the mock after import, not after raising the exception...
/facepalm