I am trying to use Django-nose in my current project, but I can't figure out how to get nose to run my tests. So I started a simple Django 1.4.1 project to get to know nose. But not even on this simple test project I could get it running.
Before I go on: I know there are a ton of similar questions on Stackoverflow, like for instance this one:
How do I tell Django-nose where my tests are?
But after Googling around, reading blog posts and StackOverflow answers I still couldn't get it running.
How I set up my test project
- Create virtual environment.
pip install django django-nose nose.- Create project with
django-admin.py startproject djangonosetest. - Create an app
manage.py startapp testapp Edit settings.py:
- Set
ENGINEtodjango.db.backends.sqlite3 - Added
django_nose,testapptoINSTALLED_APPS - Added
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'.
- Set
Run
manage.py test
But all I got was this output:
nosetests --verbosity 1
Creating test database for alias 'default'...
----------------------------------------------------------------------
Ran 0 tests in 0.000s
OK
Destroying test database for alias 'default'...
But at least the default test case should have been run.
When I run python manage.py test djangonosetest.testapp.tests:SimpleTest it'll run the test. But that seems a bit overkill if I had to do it for every test file I have. But it proves that the tests can be run.
When I ran manage.py test -v 3 (high verbosity level) this showed up:
nose.selector: INFO: /Users/Jens/Pro