Wannabe Coder
Wannabe Coder

Reputation: 1497

Django Test Discovery Issues

When I run this command, no tests are being run.

python manage.py test

I always have to specify 'app1.tests' or 'app2.tests' in order for the tests of the specific app to be run. Obviously, that is very tiresome if I have lots of apps.

How exactly do I get manage.py to run all tests across all apps? All my test methods start with "test_", and I already tried specifying --pattern=test*py. Afterwards, I also went with using django-nose and followed this, but nothing is working. My project uses Django 1.8 and the directory structure looks something like this:

../project/
├── app1
│   ├── __init__.py
│   ├── admin.py
│   ├── models.py
│   ├── tests
│   │   ├── __init__.py
│   │   ├── test_models.py
│   │   ├── test_views.py
│   │   └── test_admin.py
│   ├── urls.py
│   └── views.py
├── app2
│   ├── __init__.py
│   ├── admin.py
│   ├── models.py
│   ├── tests
│   │   ├── __init__.py
│   │   ├── test_models.py
│   │   ├── test_views.py
│   │   └── test_admin.py
│   ├── urls.py
│   └── views.py
├── manage.py
└── project
    ├── __init__.py
    ├── settings.py
    ├── urls.py
    └── wsgi.py

Hope you guys can point me in the right direction.

Upvotes: 1

Views: 183

Answers (1)

f43d65
f43d65

Reputation: 2302

Try to use --pattern="test*" (no py at the end).

Upvotes: 1

Related Questions