Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nosetests could not find any unit-test in Windows Partition mounted in Linux #1058

Open
wkcn opened this issue Sep 10, 2017 · 0 comments
Open

Comments

@wkcn
Copy link

wkcn commented Sep 10, 2017

Hi, there.

I mounted a windows partition or windows folder in Arch Linux.

Then I moved my project into the windows folder.

I ran the script nosetests, and it showed that Ran 0 tests, namely nose couldn't find any unit-test.

However, it works when nosetests a specific python script.

And nosetests will find all unit-test if I move my project into Linux Partition.

So, I made these tests.

  1. Move other project(like: librosa) into the windows folder then ran nosetests.
  2. Mount the windows folder in the linux which is in physics machine via ntfs-3g, then nosetests the project in the windows folder.
  3. Mount the windows folder in the linux which is in VMware Workstation via shared folder, then nosetests the project in the windows folder.

The results are all that nosetests shows Ran 0 tests.

I think the reason may be that the user permission is different between windows folder and linux folder.

I found the reason is that the user permission of an unit-test file is different on different OS.
The function def is_executable(file) in nose/utils.py wrongly recognizes an unit-test file on Windows Partition as an executable file.

def is_executable(file):
    if not os.path.exists(file):
        return False
    st = os.stat(file)
    return bool(st.st_mode & (stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH))

For a unit-test file, the permissions are below:

WINDOWS:0b1000000111111111
LINUX  :0b1000000110100100
MASK   :0b0000000001001001

Notice that the last nine bits all are 1s on the mounted Windows Partition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant