-
Notifications
You must be signed in to change notification settings - Fork 391
Description
What steps will reproduce the problem?
- Unpack the attached <noseimportbug.tgz> file
- Run it with "python -m run -v --with-doctest" (in the noseimportbug directory)
- The test failes with: AttributeError: 'NoneType' object has no attribute 'path'
What is the expected output? What do you see instead?
Expected the test to succeed as the code only calls "sys.path". However
the imported module has been set to "None"
What version of the product are you using? On what operating system?
- nose version 0.11.1
- linux and OS X
Please provide any additional information below.
The nose imported reloads a module, this is fine for test modules but
for code modules with dependencies it may fail.
In this test case the module should not even be reloaded. The nose importer
incorrectly determines the module to be not the same as the file.
In the Importer class of the "nose.importer", the "sameModule" method now has a line:
new_path = os.path.dirname(os.path.normpath(filename))
This should probably be replaced with:
new_path = os.path.dirname(os.path.normpath(os.abspath(filename)))
As it is compared with absolute paths.
Google Code Info:
Issue #: 356
Author: post4ar...@gmail.com
Created On: 2010-07-29T11:06:26.000Z
Closed On: