Python3 exception managing in tests as well