django-nose is a Django test runner that uses nose.
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.
What is new in this release:
- Django TransactionTestCases don't clean up after themselves; they leave junk in the DB and clean it up only on _pre_setup. Thus, Django makes sure these tests run last. Now django-nose does, too. This means one fewer source of failures on existing projects. (Erik Rose)
- Add support for hygienic TransactionTestCases. (Erik Rose)
- Support models that are used only for tests. Just put them in any file imported in the course of loading tests. No more crazy hacks necessary. (Erik Rose)
- Make the fixture bundler more conservative, fixing some conceivable situations in which fixtures would not appear as intended if a TransactionTestCase found its way into the middle of a bundle. (Erik Rose)
- Fix an error that would surface when using SQLAlchemy with connection pooling. (Roger Hu)
- Gracefully ignore the new --liveserver option introduced in Django 1.4; don't let it through to nose. (Adam DePue)
What is new in version 1.0:
- New fixture-bundling plugin for avoiding needless fixture setup (Erik Rose)
- Moved FastFixtureTestCase in from test-utils, so now all the fixture-bundling stuff is in one library. (Erik Rose)
- Added the REUSE_DB setting for faster startup and shutdown. (Erik Rose)
- Fixed a crash when printing options with certain verbosities. (Daniel Abel)
- Broke hard dependency on MySQL. Support PostgreSQL. (Roger Hu)
- Support SQLite, both memory- and disk-based. (Roger Hu and Erik Rose)
- Nail down versions of the package requirements. (Daniel Mizyrycki)
Requirements:
- Python
- Django
- nosetests
Comments not found