multiversion flag and auto requiring import hook

Andrea Crotti andrea.crotti.0 at gmail.com
Thu Jan 19 08:32:18 EST 2012


...
Actually the main problem which I've been banging my head quite a few 
days alreays is this:

--8<---------------cut here---------------start------------->8---
ERROR: Failure: AttributeError ('module' object has no attribute 'walk')
----------------------------------------------------------------------
Traceback (most recent call last):
   File 
"c:\python25\lib\site-packages\nose-0.10.3n1-py2.5-win32.egg\nose\loader.
py", line 364, in loadTestsFromName
     addr.filename, addr.module)
   File 
"c:\python25\lib\site-packages\nose-0.10.3n1-py2.5-win32.egg\nose\importe
r.py", line 39, in importFromPath
     return self.importFromDir(dir_path, fqname)
   File 
"c:\python25\lib\site-packages\nose-0.10.3n1-py2.5-win32.egg\nose\importe
r.py", line 85, in importFromDir
     mod = load_module(part_fqname, fh, filename, desc)
   File "h:\git_projs\Psi\psi.devsonly\psi\devsonly\test\test_walk.py", 
line 3, i
n <module>
     import psi.devsonly.walk as w
AttributeError: 'module' object has no attribute 'walk'

--8<---------------cut here---------------end--------------->8---

On Windows using nosetests works perfectly, but using a very simple
wrapper of nose as the following:

--8<---------------cut here---------------start------------->8---
     def egg_runner(self, eggpath):
         """Run all the tests in the given egg
         """
         conf = Config()
         conf.verbosity = 3
         ep = EclipseFriendlyPlugin()
         # how do I make sure the plugin is actually loaded and doing 
something?
         plugins = [ep]
         # and with this the verbosity should be set correctly
         # should use addplugins instead if they are not "default" plugins
         TestProgram(argv=argv[:1], config=conf, defaultTest=eggpath,
                     plugins=plugins)
--8<---------------cut here---------------end--------------->8---


Gives the above output, while on Linux they both work perfectly.
I thought this was related to the AutoRequire hook, but I get the same
problem even if I disable it..

Anyone ever saw something similar?
Thanks




More information about the Python-list mailing list