Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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!

like image 402
NT3RP Avatar asked Apr 15 '11 13:04

NT3RP


2 Answers

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.

like image 194
ashwoods Avatar answered Oct 21 '22 17:10

ashwoods


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

like image 31
user1867622 Avatar answered Oct 21 '22 17:10

user1867622