Friday 27 July 2012

Django, Meet Nose

At Glasses Direct, we use nose to run our tests, as it gives us all sorts of nice things like test functions and XUnit-compatible output (which Jenkins loves).  As the majority of our projects use Django, we use django-nose to integrate nose into our Django projects.  This gives us all of that nose loveliness when using manage.py test.
The process for setting this up is simple:
  1. Install django-nose and nose however you normally do (I would use pip install django_nose nose).
  2. Add 'django_nose' to INSTALLED_APPS.
  3. Add TEST_RUNNER = 'django_nose.NoseTestSuiteRunner' to your settings.
  4. Run manage.py test -s to check that nose is being used (the standard manage.py test doesn't have this option).
  5. Read manage.py test -h and nose docs to learn about the exciting things you can do with nose.
I've added a few more nose-related things to my blogging backlog, so I'll get to those eventually.

3 comments:

  1. Yep, we do the same where I work. If you care about coverage it's also possible to output coverage info in XML (using the nosexcover plugin) for Jenkins to consume.

    ReplyDelete
  2. Yep, we do the same where I work. If you care about coverage it's also possible to output coverage info in XML (using the nosexcover plugin) for Jenkins to consume. ابی

    معین

    ReplyDelete
  3. Jackpot City additionally be|can be} available in an absolute TON lf languages, including English, dansk, Deutsch, Francais, Nederlands, Norsk and Espanol. 먹튀프렌즈 Even although we also talked about that there aren’t that many alternative groupings of video games aside from Jackpots, Video Poker, Table Games, and Slots, these are literally enough as they're. Since net site} exhibits as many as 8 video games per line, you can to|you probably can} simply view plenty of the video games quickly, with out having to scroll, and scroll, and scroll. Something we’re positive you’ll also like is truth that|the truth that} all of the video games load on the similar time so that you don’t need to hold prompting the positioning to show out|to indicate} you more.

    ReplyDelete