Is there a way to hook Django's unittest into PyUnit in eclipse?

旧城冷巷雨未停 提交于 2019-12-20 10:49:12

问题


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!


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/5677386/is-there-a-way-to-hook-djangos-unittest-into-pyunit-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!