Introduction
capsys helps you catch what your program prints so you can check if it shows the right messages.
You want to test if a function prints the correct greeting message.
You need to check error messages printed to the console during a test.
You want to verify output from a script without changing the code.
You want to capture print output to avoid cluttering test results.