Usually testing frameworks have an assertThrows() or something like that,, but this is not an official python unit test, so my suggestion would be to just put `assert(0) # Should raise InsufficientFunds` on the line after the conn.sendtoaddress.