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
Directories ending in ".py" crash nose #526
Comments
This might be related to #19, I've linked it there as well |
@brcooley try any directory with a period... I think it is the period that is truly crashing node, not necessarily ending in ".py" Let me know if you find any workarounds... this is an unfortunate issue for me |
@madisona I don't seem to have any issues when I use something like "dotted.dir" for my directory name, even with a file "dotted.dir.py". What seems to cause it is that nose looks for files ending in .py, and then tries to import them for test discovery. I think a simple rename as you suggest in issue 19 is the best bet for the time being. |
I looked a little bit into this. Apparently loader.py calls importer.py to try to load the directory as if it was a source file that contains tests. |
…rectories that end with .py but are not Python packages should not be parsed as if they are modules. Fixes nose-devs#526
Sounds good, closing in favor of #625 |
Directories that end with .py but are not Python packages should not be parsed as if they are modules. getpackage now verifies that the path is either a .py file or a package. This fixes nose-devs#526
Directories that end with .py but are not Python packages should not be parsed as if they are modules. getpackage now verifies that the path is either a .py file or a package. This fixes nose-devs#526
Windows 7-x64, Python 3.2.3
When running
nosetests-3.2.exe
in a directory that ends in ".py", nose can't find any tests, and throws anImportError
saying that it can't find a module with the name of the directory. This occurs whether there is a python file with the same name or not.REPRO:
Create directory ending in .py
cd into directory, create test__.py file with at least one test__ function
Run
nosetests-3.2.exe
EXPECTED OUTPUT:
.
----------------------------------------------------------------------
Ran 1 test in 0.001s
I've also have a full log, but the problem seems to lie in importer.py
The text was updated successfully, but these errors were encountered: