In exercise 3.2 of Downey's "Think Python 2" he has a function:

def do_twice(f):
    f()
    f()

As you know, I am trying to learn testing/TDD while doing these
exercises.  How do I test such a *general* function?  Should I create
a variety of arbitrary functions in my test file, call the do_twice
function with each of these made up functions and see if I get the
expected results?

I can see doing this, but since the function to be tested is so
general in nature, I do not see how I can feel confident that I am
adequately testing it.  I cannot even conceive of what might be edge
cases for this function.  Something exploring the limits of Python's
functionality?

-- 
boB
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to