How does django-nose differ from the default Django test-runner
我一直在看到和读到很多人使用鼻子来运行Django测试的信息。 我还无法弄清楚使用Nose运行Django测试的额外好处。 如果有人可以告诉我什么是鼻子,以及鼻子如何增加Django项目的价值,那将是有帮助的。
我一直找不到一个很好的文档/文章来概述这些观点。
谢谢
我对此也很好奇,似乎使用python鼻子库的django-nose的主要优点是"测试发现"。
另外,来自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.
据我从freenode irc上的其他python开发人员那里了解到,Twisted Framework上的Trial测试运行程序具有类似于鼻子的这些功能。
我仍然不完全相信要使用django-nose进行django开发,但是如果发现更多信息,可以给我报告一下!
总体上还有很多功能,但是我认为人们使用鼻子/ djano_nose的主要原因之一是它使您可以非常轻松地进行代码覆盖。
1 | python manage.py test myapp --with-coverage --cover-package=myapp |