Pot: nose

nose is my Python testing tool of choice. You can use it to very easily create test suites. While it does support the unittest module which is included with Python, it also allows for a much simple style using just methods and asserts. Put the following code into a file called test_basic.py: <notextile>def test_addition(): print 2 + 2 assert 2 + 2 == 4 def test_addition_wrong(): print 2 + 3 assert 2 + 3 == 6</notextile> Then just run nosetests in the directory where you stored this file. You’ll get an output indicating, that there is a test failure. ...

April 6, 2009 · Patrice Neff

Continuous testing with Python

Back when I did some Ruby on Rails development I was a big fan of autotest. With it I could stay in my editor while the project test suite got executed with every change. Setup Now that I’m working in Python I was looking for something similar and I was successful. You’ll need the following: Mac OS X Growl nose nosegrowl tdaemon Then you can execute tdaemon like this in your project directory: ...

February 7, 2009 · Patrice Neff