Brian van den Broek <[EMAIL PROTECTED]> writes: > Since the classes are for getting input interactively, a > straightforward use of doctest is not going to work. (The tests > won't run automatically.) I've come up with a way to make it work, > but I would like to know from more experienced people if there are > better ways that I am overlooking.
One suggestion I can give is to decouple the task of "get input from the user" and "validate this value against particular criteria". The former should be so simple and *stupid* in its implementation that very little can go wrong. The latter should be each of your validation classes, or some re-implementation of them, that is non-interactive and therefore easy to test. Then, the application simply uses these building blocks (that are now well-tested and reliable) to do what it does: get input, then validate that input, and possible ask for input again. -- \ "How many people here have telekenetic powers? Raise my hand." | `\ -- Emo Philips | _o__) | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list