You are viewing a single comment's thread. Return to all comments →
This is a "gotcha" challenge. The test cases are not good examples of the gotcha that they're trying to get ya with.
Try this (pytest) test case and you'll see what the problem is:
def test_1(capsys): print_from_stream(3) captured = capsys.readouterr() assert captured.out.split() == ["0", "2", "4"] print_from_stream(3) captured = capsys.readouterr() assert captured.out.split() == ["0", "2", "4"]
Seems like cookies are disabled on this browser, please enable them to open this website
Default Arguments
You are viewing a single comment's thread. Return to all comments →
This is a "gotcha" challenge. The test cases are not good examples of the gotcha that they're trying to get ya with.
Try this (pytest) test case and you'll see what the problem is: