On 08/10/16 07:18, Steven D'Aprano wrote:
> Testing code that depends on user input is always tricky. There are a
> few ways to deal with it:
>
> (5) Or you could manually monkey-patch sys.stdin as you do.
A variation on this that I have used is to read the input
from stdin as usual but
On Fri, Oct 07, 2016 at 08:26:28PM -0500, boB Stepp wrote:
> I think I have this figured out, but I want to be certain I am doing
> it both correctly and in the preferred way. I have a need for a
> get_input() function and have written my first test for this function
> as follows:
Testing code
Oops!
On Fri, Oct 7, 2016 at 8:26 PM, boB Stepp wrote:
> I think I have this figured out, but I want to be certain I am doing
> it both correctly and in the preferred way. I have a need for a
> get_input() function and have written my first test for this function
> as
I think I have this figured out, but I want to be certain I am doing
it both correctly and in the preferred way. I have a need for a
get_input() function and have written my first test for this function
as follows:
class TestGetInput(unittest.TestCase):
'''Tests for the function