A number of students really wanted to test their mailroom user interaction code -- great instinct!
I promised them (in my class, anyway) that we would learn to mock the input() function when we got to advanced testing -- and it's a nice demo of mocking anyway.
A number of students really wanted to test their mailroom user interaction code -- great instinct!
I promised them (in my class, anyway) that we would learn to mock the input() function when we got to advanced testing -- and it's a nice demo of mocking anyway.
So: an exercise or example -- how to mock input()