Whereas assert in Python is ideal to verify wether certain function calls return an expected output for a given input, could it also be used to check for results printed on screen (i.e., in procedures that return no results but only have side efffects like printing stuff on screen)? The context of this question is how to write such automated tests that I would like to include in an automated grader tool.
Since expect the answer to this question to be: assert does not serve this purpose; what other trick could I use then to check the screen output produced by a procedure?
You could redirect the standard output to a file and then compare it's content for validity.
Is there an easy way to use asserts in Python to check for results printed on screen