20

What is the best tutorial you know out there for getting started with PyUnit?

(On Google I tend to find mostly fragmented hints and tricks and not much in terms of guides)

Samuel Lampa
  • 4,336
  • 5
  • 42
  • 63
  • 1
    Just a note if you are a beginner with unit tests in Python: have you considered [nose](http://somethingaboutorange.com/mrl/projects/nose/1.0.0/)? Personally, I prefer it to pyunit. And the documentation is excellent. Main disadvantage is it's not in the standard library. – ire_and_curses Mar 15 '11 at 16:21
  • As I understand, nose is rather an interactive tool, than suited for automated testing. Also, I'm using Eclipse (PyDev), and heard that PyUnit should have better integration with it. (But thanks anyway, will take a closer look ...) – Samuel Lampa Mar 15 '11 at 16:26
  • Not sure what you mean. I use it for automated testing, in the same way as pyunit. You may be right about the PyDev integration though. – ire_and_curses Mar 15 '11 at 16:35
  • I've now tested both, and both works nice with PyDev. Nose has a more easy and allowing syntax though, and seem to work better if you want to use it on the command line, so I have been sticking with nose! Thanks for the tip! :) – Samuel Lampa Nov 28 '12 at 12:31

2 Answers2

16

Steve Purcell has written a good one here

chvck
  • 829
  • 10
  • 18
7

here is also a good one (from python documantation): http://docs.python.org/2/library/unittest.html

Jacob Jedryszek
  • 6,365
  • 10
  • 34
  • 39