kgrandis / nose-exclude

nose-exclude is a Nose plugin that allows you to easily specify directories to be excluded from testing. [OFFICIAL]
https://github.com/kgrandis/nose-exclude
GNU Lesser General Public License v2.1
21 stars 10 forks source link

Symlinks not excluded by nose-exclude #7

Open brandones opened 9 years ago

brandones commented 9 years ago

In my GAE project, I have a directory structure like

env/lib/python2.7/site-packages/
src/
  |---- application/
  |---- lib/
  |---- tests/

where src/lib is a symlink to env/lib/python2.7/site-packages/.

When I run tests with cd src; ../env/bin/nosetests --exclude-dir=lib --with-gae, all the tests in env/lib/python2.7/site-packages/ get run. There is no error message as happens when I provide a non-existent directory to exclude-dir. Clearly, the path is being found, but is not actually being excluded.

domoritz commented 9 years ago

I'm seeing a similar issue. Coincidentally I am also using gae. Could it be related to gae?

asfaltboy commented 8 years ago

I am not using gae, however I still experience this behavior. From looking at the codes, I can see that the method wantDirectory explicitly converts any symlink to a realpath by choice.

The question is whether this is due to a feature (excluding real path will always exclude any symlinks to it too) or a limitation; I'm inclined to believe the former, which is why I've submitted PR #10 which suggest to check for both real and symlink paths in excluded dirs.