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,346
  • 4
  • 45
  • 63
e-satis
  • 551,433
  • 107
  • 289
  • 326
  • Needing-less to say, the file owner is me. – e-satis Mar 04 '10 at 09:41
  • Wow, I posted that 1h ago and it's already the first entry in Google for "nose permission 644". I don't know what amaze me the most: how SO much is becoming famous, or how much Google is becoming fast. – e-satis Mar 04 '10 at 10:33
  • 1
    Why can you not edit your files? 644 == -rw-r--r-- – codeape Mar 04 '10 at 11:13

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
  • 94,365
  • 23
  • 147
  • 176
  • 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