I'm trying to write test code for a python function in Replit. The function is taking user input from the console. As written in the test need to pass a value to the function. Test code:
self.assertTrue(play(10) <6)
In the Function, user input needs to be taken as below(there are more codes in the function that use num and n to determine return value:
def play(n):
num = int(input("Enter the ammount"))
return num
I get the error: RuntimeError: input(): lost sys.stdin
Is there a way to test functions with user inputs in the Replit unit test as the above method is not working?