nose doesn’t discover tests on Solaris

Note: this is a technical post, to help poor souls that google this :)

When using nose on Solaris machines, simply running nosetests without specifying the file names will not work if you are the root user. To fix this, you must either not be root, or pass nose the argument --exe. That’s it.

Gory details: by default, nose ignores executable files. Each file it encounters it checks with os.access(test_file, os.X_OK) to see if it’s executable. Problem is that Solaris’ access function always returns success for root, regardless of actual file permissions. This is discouraged by POSIX, but known behavior.

I hope this saves someone the 3 hours it wasted for me :)



This entry was posted on Wednesday, March 3rd, 2010 at 16:05 and is filed under Programming, techie, testing. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “nose doesn’t discover tests on Solaris”

  1. Avihu Turzion

    Kudos, it’s the first result for this problem’s search in Google :)

Leave a Reply

Your comment