有没有办法将 Django 的单元测试挂接到 eclipse 中的 PyUnit 中?
过去几周我一直致力于 Django 项目,进展相当顺利。我使用 Django 的 unittest
库来测试所有内容,结果显示在控制台中。
然而,经过一些研究,看起来 pydev 为 PyUnit
提供了工具。我使用 Eclipse,我以为我只能将单元测试通过管道传输到 PyUnit 中,但我在这方面没有任何运气,也没有找到这样做的文档。
如何在 Eclipse 的 PyUnit 视图中运行单元测试?
目前,我使用以下命令在 Eclipse 中运行所有测试:
manage.py test
谢谢!
I've been working on a Django project for the past few weeks now, and it's been fairly smooth sailing. I use Django's unittest
library to test everything, and the result show up in the console.
However, after doing some research, it looks like pydev provides facilities for PyUnit
. I use Eclipse, and I thought I would just just be able to pipe the unit tests into PyUnit, but I haven't had any luck in either that or finding documentation to do so.
How do I have my unit tests run in the PyUnit view in eclipse?
Currently, I run all of my test within eclipse using the following:
manage.py test
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议使用 Nose 进行 django 测试。
Pydev 允许您选择您的测试运行器,并且它支持nose。
我会让 stack 解释原因以及如何集成nose with eclipse 用于交互式调试。
我也会添加 django-nose 。
I would recommend using Nose for your django tests.
Pydev allows you to choose your test runner, and it has support for nose.
I'll let stack explain why and how to integrate nose with eclipse for interactive debugging.
And i'll throw in the django-nose too.
这是一个适配器,可让您从命令行使用 django-nose 包中的鼻子插件。然后,您可以通过鼻子通过 Eclipse PyUnit 窗口运行 django 测试。
https://github.com/jenniferlianne/django_nose_adapter
Here's an adapter that lets you use the nose plugin from the django-nose package from the command line. Then you can run your django tests through the Eclipse PyUnit window via nose.
https://github.com/jenniferlianne/django_nose_adapter