Great tutorial series :D. Thanks for writing such a useful content.
I just would like to make a little suggestion regarding the assertion of the captured print output.
You're using
assert"<SOME_STRING>"incaptured.out
The in statement verifies whether captured.out contains <SOME_STRING>, which means that if <SOME_STRING> is aa and the captured.out was aaaaaa the test would pass.
I would suggest to change that assertion to
assert"<SOME_STRING>\n"==captured.out
What do you say?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hey, @wangonya
Great tutorial series :D. Thanks for writing such a useful content.
I just would like to make a little suggestion regarding the assertion of the captured
print
output.You're using
The
in
statement verifies whethercaptured.out
contains<SOME_STRING>
, which means that if<SOME_STRING>
isaa
and thecaptured.out
wasaaaaaa
the test would pass.I would suggest to change that assertion to
What do you say?