question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I tell django-nose where my tests are?

See original GitHub issue

I 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:open
  • Created 12 years ago
  • Comments:17 (4 by maintainers)

github_iconTop GitHub Comments

9reactions
ke1gcommented, Sep 7, 2012

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?

4reactions
mpurdoncommented, Oct 16, 2012

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found