I've got a program that's built on functions that taks user inputs inside the functions and not parameters before the function: for example, say my function is
def my_function():
a = input("a: ")
b = input("b: ")
print(a+b)
and from what I understand thus far about unit testing a function like that is harder to unit test than a function that works for example like this:
def another_function(a,b):
return(a+b)
So how do I go about testing a function that looks like my_function
, for example? It feels as if it would be easy to test manually by just entering incorrect inputs and checking for errors, but I have to write a test suite that tests all my functions automatically.