Let’s say I have a function that is just used to print some information on the screen, like:
function printStuff(x) print("Round(x=$(x)) = $(round(x,digits=2)) ") nothing end
As this function is used in a larger code base, I would like to add a test that checks that the function prints without any errors (e.g. that the function still works after a new Julia version is released).
I could add
@test printStuff(4.1123) == nothing
to my unit tests.
However, I would like to prevent the function from actually printing to the screen. Is there any way to do this?