I looked into the sub nose code, and here's why.
def importFromPath(self, path, fqname): """Import a dotted-name package whose tail is at path. In other words, given foo.bar and path/to/foo/bar.py, import foo from path/to/foo then bar from path/to/foo/bar, returning bar. """
In your case, when importFromDir is called from importFromPath, 'dir' is the directory at the level above from the __init__.py directory. So why adding __init__.py to your test does the work of "import a"
source share