7

Today I ran a bunch of doctests using Python 2.6 on a Ubuntu 9.10 with nose :

nosetests --with-doctest
Ran 0 tests in 0.001s

OK

WTF? I had tests in that files, why didn't that work?

I changed permission to 644:

sudo chmod 644 * -R
nosetests --with-doctest
Ran 11 test in 0.004s

FAILED (errors=1)

Changing it back to 777:

sudo chmod 777 * -R
nosetests --with-doctest
Ran 0 tests in 0.001s

OK

Why is that? Using 644, I can't even edit my files!

Rudu
  • 15,682
  • 4
  • 47
  • 63
Bite code
  • 578,959
  • 113
  • 301
  • 329

1 Answers1

11

Try the --exe flag:

$ nosetests --help

...    

--exe               Look for tests in python modules that are executable.
                    Normal behavior is to exclude executable modules,
                    since they may not be import-safe [NOSE_INCLUDE_EXE]
codeape
  • 97,830
  • 24
  • 159
  • 188
  • 1
    I would love to understand why --exe isnt the default behavior. It took a while to discover this issue! Argh! – Jaskirat Aug 11 '11 at 19:10