Hi all- Suppose I had a function like the following:
def y_n(prompt="Answer yes or no"): while True: answer = raw_input(prompt) if answer in ['y', 'Y', 'yes']: print "You said yes!" break elif answer in ['n', 'N', 'no']: print "You said no!" break else: print "%s is an invalid answer."%answer How could I go about to write an automated test for it? André _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor