You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@imcleod - I'm working with SHA: 3f2d0d9 and seeing the following stack trace when running the test_cacheManager tests.
Traceback (most recent call last):
File "/usr/lib64/python2.7/unittest/case.py", line 369, in run
testMethod()
File "/usr/lib/python2.7/site-packages/nose/loader.py", line 413, in loadTestsFromName
addr.filename, addr.module)
File "/usr/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/usr/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/root/sloranz/src/novaimagebuilder/tests/test_cacheManager.py", line 25, in <module>
sys.modules['StackEnvironment'] = sys.modules.pop('MockStackEnvironment')
KeyError: 'MockStackEnvironment'
Rather than messing with the loaded modules, I'm proposing that we change CacheManager so that one can set the stack environment. This requires no conditional logic in the CacheManager class or any other real class and is something that would be set by the unit test.
This was dependent on the test runner being used. For whatever reason, I had PyCharm setup to use python unittest for all tests but nose for the single test. Switching to utrunner instead of noserunner fixed my issue without having to muck around with the python path.
The current tree was done as a POC and there are some redundant cut-and-pasted sections that could use some cleaning up.
The text was updated successfully, but these errors were encountered: