Surely you fixed this problem
I had similar problems,. and changing this lines

import <my project name here>.lib.helpers as h
import <my project name here>.lib.model as model

to their relative form

import helpers as h
import model

worked for me,

I guess this problem is triggered by a circular import of modules when nose
executesthe pylons

Good luck
  Agustin




On Tue, Apr 8, 2008 at 6:07 AM, Dunk Fordyce <[EMAIL PROTECTED]>
wrote:

>
> hello,
>
> Im trying to write some unittests however I get this strange error
> when running them:
>
> ======================================================================
> ERROR: Failure: AttributeError ('module' object has no attribute 'helpers')
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>  File
> "/usr/lib/python2.5/site-packages/nose-0.10.1-py2.5.egg/nose/loader.py",
> line 364, in loadTestsFromName
>    addr.filename, addr.module)
>  File
> "/usr/lib/python2.5/site-packages/nose-0.10.1-py2.5.egg/nose/importer.py",
> line 39, in importFromPath
>    return self.importFromDir(dir_path, fqname)
>  File
> "/usr/lib/python2.5/site-packages/nose-0.10.1-py2.5.egg/nose/importer.py",
> line 84, in importFromDir
>    mod = load_module(part_fqname, fh, filename, desc)
>  File "myproj/tests/__init__.py", line 33, in <module>
>    cmd.run([test_file])
>  File
> "/usr/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/appinstall.py",
> line 68, in run
>    return super(AbstractInstallCommand, self).run(new_args)
>  File
> "/usr/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/command.py",
> line 213, in run
>    result = self.command()
>  File
> "/usr/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/appinstall.py",
> line 456, in command
>    self, config_file, section, self.sysconfig_install_vars(installer))
>  File
> "/usr/lib/python2.5/site-packages/PasteScript-1.6.2-py2.5.egg/paste/script/appinstall.py",
> line 600, in setup_config
>    mod.setup_config(command, filename, section, vars)
>  File "/home/dunk/projects/myproj/myproj/websetup.py", line 101, in
> setup_config
>    load_environment(conf.global_conf, conf.local_conf)
>  File "myproj/config/environment.py", line 33, in load_environment
>    config['pylons.h'] = myproj.lib.helpers
> AttributeError: 'module' object has no attribute 'helpers'
>
> I cant see how this is possible as its already imported the module
> fine at the top of environment.py....
>
> Any clues?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to