Testing functions that raise exceptions