Assert that calls function instead of throwing if the assert fails