Message200964
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. |
|
Date |
User |
Action |
Args |
2013-10-22 14:32:55 | pitrou | set | recipients:
+ pitrou, barry, michael.foord |
2013-10-22 14:32:55 | pitrou | set | messageid: <1382452375.52.0.637202424401.issue19352@psf.upfronthosting.co.za> |
2013-10-22 14:32:55 | pitrou | link | issue19352 messages |
2013-10-22 14:32:55 | pitrou | create | |
|