Nosetests could not find any unit-test in Windows Partition mounted in Linux
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.
- Move other project(like: librosa) into the windows folder then ran
nosetests. - Mount the windows folder in the linux which is in physics machine via
ntfs-3g, thennoseteststhe project in the windows folder. - Mount the windows folder in the linux which is in VMware Workstation via shared folder, then
noseteststhe 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.