Giter Club home page Giter Club logo

django-nose's Introduction

Requirements

This package is most useful when installed with:

  • Django 1.2+
  • nose

Upgrading from Django < 1.2

Django 1.2 switches to a class-based test runner. To use django-nose with Django 1.2, change your TEST_RUNNER from django_nose.run_tests to django_nose.NoseTestSuiteRunner.

django_nose.run_tests will continue to work in Django 1.2, but will raise a warning. In Django 1.3 it will stop working.

If you were using django_nose.run_gis_tests, you should also switch to django_nose.NoseTestSuiteRunner and use one of the spatial backends in your DATABASES settings.

Installation

You can get django-nose from pypi with:

pip install django-nose

The development version can be installed with:

pip install -e git://github.com/jbalogh/django-nose.git#egg=django-nose

Since django-nose extends Django's built-in test command, you should add it to your INSTALLED_APPS in settings.py:

INSTALLED_APPS = (
    ...
    'django_nose',
    ...
)

Then set TEST_RUNNER in settings.py:

TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'

Usage

See ./manage.py help test for all the options nose provides, and look to the nose docs for more help with nose.

Customization

Always Passing The Same Options

To always set the same command line options you can use a nose.cfg or setup.cfg (as usual) or you can specify them in settings.py like this:

NOSE_ARGS = ['--failed', '--stop']

Using Custom Plugins

If you need to make custom plugins, you can define each plugin class somewhere within your app and load them from settings.py like this:

NOSE_PLUGINS = [
    'yourapp.tests.plugins.SystematicDysfunctioner',
    # ...
]

Just like middleware or anything else, each string must be a dot separated, importable path to an actual class. Each plugin class will be instantiated and added to the Nose test runner.

Caveats

South installs its own test command that turns off migrations during testing. Make sure that django_nose comes after south in INSTALLED_APPS so that django_nose's test command is used.

Support for Django 1.1

If you want to use django-nose with Django 1.1, use https://github.com/jbalogh/django-nose/tree/django-1.1 or http://pypi.python.org/pypi/django-nose/0.0.3.

django-nose's People

Contributors

akaihola avatar bwinton avatar carljm avatar dcramer avatar erikrose avatar ionelmc avatar ipmb avatar jbalogh avatar miracle2k avatar outofculture avatar proppy avatar robmadole avatar rozza avatar sverrejoh avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.