20

I've been seeing and reading about a lot of people using nose to run their Django tests. I haven't been able to figure out the added benefits of using Nose to run my Django tests. If someone could fill me in on what nose is and how it adds more to a Django project, it would be helpful.

I haven't been able to find a good document/article outlining these points.

Thank you

Mridang Agarwalla
  • 43,201
  • 71
  • 221
  • 382
  • 3
    Reading http://webamused.wordpress.com/2010/04/07/tutorial-testing-efficiently-with-nose-nose-exclude-and-django-nose/ looks like it might get you off to a good start. – Dominic Rodger Oct 21 '11 at 08:04

2 Answers2

3

I was curious about this too and it seems that the main advantage of django-nose using the python nose library is "Test Discovery".

In addition, from http://readthedocs.org/docs/nose/en/latest/testing.html

you can also write simple test functions, as well as test classes that are not subclasses of unittest.TestCase. nose also supplies a number of helpful functions for writing timed tests, testing for exceptions, and other common use cases. See Writing tests and Testing tools for more.

From what I understand from other python developers on freenode irc, Trial test runner on Twisted Framework have these similar features like nose.

I am still not entirely convinced about using django-nose for django development but am giving a shot and report back if I find out more!

Calvin Cheng
  • 35,640
  • 39
  • 116
  • 167
2

There are a lot more features overall, but I think one major reason people use nose/djano_nose is that it allows you to very easily do code coverage.

python manage.py test myapp --with-coverage --cover-package=myapp
Evan R.
  • 3,277
  • 3
  • 16
  • 14