Uhm, double negations are no good. `if expected_output is not None` reads better.