Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any visual tools for Python unit tests?

I'm writing quite a few unit tests and using nosetests to run them. Nose certainly makes it nice and easy to run tests, but the output can be pretty cluttered at the best of times, and a downright mess at others, depending on warnings and errors.

I was wondering if there are any visual tools that wrap nose so that the feedback cleaner. A results grid showing test names, run times and indicating success/failure status with colours would be a huge visual aide. Better still, if it could split up the error messages and tracebacks on a case by case basis, it would really cut down on the amount of clutter when a large number of tests fail on a major change.

This is starting to read like a wishlist, but does anything even close to this exist?

like image 691
Soviut Avatar asked Feb 10 '10 09:02

Soviut


2 Answers

There's a very similar question here.

It doesn't look like there's a standardized GUI for nosetests (as in, standardized for just the python interface). There seems to be a few GUI plugins for nosetests depending on which IDE you're using - a quick search brought up this link for Komodo.

However, there are many other GUI based unit testing frameworks out there for Python - have you tried PyUnit?

like image 180
Daniel May Avatar answered Sep 20 '22 02:09

Daniel May


Well, what you can do is to use the jenkins integration server, we use it with py.test and phpunit (it is really simple to use it with any other testing framework), it provides us some fancy (and useful!) graphs containing

  • Number of tests that run
  • Number of tests passing/failing
  • The stack trace for the failed tests
  • Execution times for tests
  • Code coverage for the tests
  • You can also relate it to git/svn/mercurial...

Here you have an example of how to configure hudson (for the record, jenkins is a fork of hudson, so the instructions are still valid :), in order to provide the elements from your wishlist.

An easier option is to use a IDE as PyCharm, it has integration with nosetests, and will tell you which tests passed/failed and its times, however, jenkis stores historical data.

Good luck :)

like image 26
Juan Antonio Gomez Moriano Avatar answered Sep 18 '22 02:09

Juan Antonio Gomez Moriano