Skip to main content

make unittest formatted and colorful output(cross platform)

Project description

Why?

Why do I write this plugin for nose ,The reason is so sample that the nose original report is so ugly, what’s the worse, not friendly for tester, actually python tester.

How?

How to use this nose plugin: colorunit, Only tree steps you need to follow:

Install colorunit:

1.1) Install with pip

pip install nose-colorxunit

1.2)Uninstall with pip

pip uninstall nose-colorxunit

2.1) Install with source

First, active your own python virtual environment if you have.

Then on the terminal type:

python setup.py build

python setup.py install

If you just want to install it as a super user or using sudo command, please think it again.

2.2) Uninstall with source

Just go to your own python virtual environment site-packages directory, and find nose_colorxunit-..-py..egg, then delete it.

Register colorunit [Optional]

Now this is optional, just write the following code snippet into Any one of your test files if you like, for example, test_demo.py.:

import nose
from colorunit import ColorUnit
if __name__ == '__main__':
    nose.main(addplugins=[ColorUnit()])

Run the test files

nosetests --with-colorunit

Connections

Name: Lesus

Email: walkingnine@gmail.com          |

Blog: http://my.oschina.net/swuly302/blog (Chinese)

If you have some good advice or idea, Welcome to communicate with me via email or be one of contributors!

TODO

  1. Adding a decorator class or method for finding and showing these taken time over your expected taken time.

  2. Logging the output into specific file

Issues

  1. Only for Linux[Fixed v0.1.2];

  2. Only for python2., not supports python3[Fixed v0.2.0]

  3. Showing every test case taken time[Fixed v0.1.4]

  4. Why it needs to be registered again. For more informations, Please see How : Register colorunit section[Fixed v0.1.4]

Snapshot

On Ubuntu:

Sample error page

On Windows XP:

Sample error page

Thanks!

  1. Vim 7.4

  2. stackedit

  3. nose

  4. colorama

LICENSE

APACHE LICENSE VERSION 2.0

Also see LICENSE file

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nose-colorxunit-0.2.0.tar.gz (6.4 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page