Albert-Jan Roskam <fo...@yahoo.com.dmarc.invalid> writes: > Don't postpone writing unittests (don't use doctest). They really give > you focus and confidence (peace of mind!).
Excellent advice. Write unit tests as a way of documenting what you want the function to do, and also to document what the function did wrong in that bug you just found :-) (Although, I'd modify the above to: do use doctest, but *not* for unit tests. Use doctest only for testing code examples you already have in your documentation, it's good for that.) > If you also use version control, you can automatically run all tests > before each commit. There's no “if” there. Use a distributed version control system (Mercurial is good and is written in Python), and always make small easily-described commits while working. -- \ “Visitors are expected to complain at the office between the | `\ hours of 9 and 11 a.m. daily.” —hotel, Athens | _o__) | Ben Finney _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor