unit tests fail because site packages are used

Bug #1082002 reported by Mark McLoughlin
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
High
Mark McLoughlin
Grizzly
Fix Released
High
Mark McLoughlin

Bug Description

On my machine at least, if I check out oslo-incubator and do:

  $> tox

I get:

 WARNING:test command found but not installed in testenv
 ..

 ERROR: Failure: ImportError (No module named mock)
----------------------------------------------------------------------
 Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/site-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/markmc/git/openstack/oslo-incubator/tests/unit/middleware/test_context.py", line 20, in <module>
    import mock
 ImportError: No module named mock

this fixes it:

  $> bash -c '. .tox/py27/bin/activate && pip install --upgrade nose'

I suspect tox being configured with sitepackages=True is the issue

Revision history for this message
Mark McLoughlin (markmc) wrote :
Changed in oslo:
status: Confirmed → In Progress
Changed in oslo:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → grizzly-2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.