This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients barry, michael.foord, pitrou
Date 2013-10-22.14:32:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1382452375.52.0.637202424401.issue19352@psf.upfronthosting.co.za>
In-reply-to
Content
unittest.loader has the following snippet:

                    if realpath.lower() != fullpath_noext.lower():
                        module_dir = os.path.dirname(realpath)
                        mod_name = os.path.splitext(os.path.basename(full_path))[0]
                        expected_dir = os.path.dirname(full_path)
                        msg = ("%r module incorrectly imported from %r. Expected %r. "
                               "Is this module globally installed?")


Unfortunately, this will break with virtualenv on Ubuntu, which creates
a "local" directory full of symlinks. You end with this kind of error message:

======================================================================
ERROR: __main__ (unittest.loader.LoadTestsFailure)
----------------------------------------------------------------------
ImportError: 'test_asyncagi' module incorrectly imported from '/home/antoine/obelus/.tox/py27/local/lib/python2.7/site-packages/obelus/test'. Expected '/home/antoine/obelus/.tox/py27/lib/python2.7/site-packages/obelus/test'. Is this module globally installed?


Instead of (rather stupidly) calling lower(), realpath() and normcase()
should be called instead, to make sure the canonical paths are compared.
History
Date User Action Args
2013-10-22 14:32:55pitrousetrecipients: + pitrou, barry, michael.foord
2013-10-22 14:32:55pitrousetmessageid: <1382452375.52.0.637202424401.issue19352@psf.upfronthosting.co.za>
2013-10-22 14:32:55pitroulinkissue19352 messages
2013-10-22 14:32:55pitroucreate