How do I tell django-nose where my tests are?
See original GitHub issueI have my tests for a Django application in a tests directory:
my_project/apps/my_app/
├── __init__.py
├── tests
│ ├── __init__.py
│ ├── field_tests.py
│ └── storage_tests.py
├── urls.py
├── utils.py
└── views.py
The Django test runner requires that I put a suite() function in the __init__.py
file of my application’s tests directory. That function returns the test cases that will run when I do
$ python manage.py test my_app
I installed django-nose. When I try to run the tests with django-nose, 0 tests are run: $ python manage.py test my_app
If I point directly at the test module, the tests are run: $ python manage.py test my_project.apps.my_app.tests.storage_tests
Why does django-nose’s test runner not find my tests? What must I do?
Issue Analytics
- State:
- Created 12 years ago
- Comments:17 (4 by maintainers)
Top Results From Across the Web
How do I tell django-nose where my tests are? - Stack Overflow
If you use django-nose you can use a simple selector: from nose.selector import Selector from nose.plugins import Plugin import os import django.test class ......
Read more >How do I tell django-nose where my tests are? · Issue #34
The Django test runner requires that I put a suite() function in the __init__.py file of my application's tests directory.
Read more >Django : How do I tell django-nose where my tests are? - YouTube
Question / answer owners are mentioned in the video. Trademarks are property of respective owners and stackexchange. Information credits to stackoverflow, ...
Read more >Usage — django-nose 1.4.6 documentation
The day-to-day use of django-nose is mostly transparent; just run ./manage.py test as usual. See ./manage.py help test for all the options nose...
Read more >Django tests with nose and coverage | by Zac Kwan - Medium
The following guide would help us run test using django-nose . It give us more option to run test either by apps, modules...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It is worth trying setting the environment variable NOSE_INCLUDE_EXE to a non-empty string.
While (at least currently) this is set by default on win32 and cli, and on *nix systems the tests.py file should get made without execute permissions, it is possible that if a site were created on a Windows box and copied to something else, you could wind up with the execute bits set (I’ve seen that - don’t remember the details). Setting execute permissions on tests.py on a linux system certainly prevents the test from running, and using:
export NOSE_INCLUDE_EXE=1
makes it run again. If the OP is still having the problem, could he please try this?
export NOSE_INCLUDE_EXE=1
worked for me. In addition, I wasn’t aware that there was a level 3 (level 2 appeared to make no difference) to the verbosity so once I tried running the tests I was able to see several .py is executable; skipped results.Thanks everyone