avatar Bite 246. Test print / standard output


Note this is a Test Bite and uses Python 3.7 and MutPy 0.6.1

In this Bite you test a function that prints to stdout. Check out pytest's Capturing of the stdout/stderr output how to test this.

You probably want to use the capsys / capfd fixture in your test code and you'll probably find a good use case for @pytest.mark.parametrize here too.

Have fun and keep calm and code in Python!

Login and get coding
go back Beginner level
Bitecoin 2X

235 out of 242 users completed this Bite.
Will you be the 236th person to crack this Bite?
Resolution time: ~41 min. (avg. submissions of 5-240 min.)
Our community rates this Bite 3.78 on a 1-10 difficulty scale.
» You can do it! 😌

Focus on this Bite hiding sidebars, turn on Focus Mode.

Ask for Help