This one time, at band camp, Jamie Wilkinson wrote:
>When I run nosetests as per the documentation, I get errors that suggest
>that the model wasn't loaded properly, which I believe is simply because
>nosetests doesn't know about the paste config and thus can't properly
>instantiate the model.

>  File "/home/jaq/lib/python2.3/Pylons-0.8-py2.3.egg/pylons/database.py", line 
> 124, in set_hub
>    dburi = CONFIG.current_conf()['app'].get("%s.dburi" % self.packagename, 
> None)
>TypeError: unsubscriptable object

Further to this, some printf debugging shows me that directly after the
loadapp being called in TestController, CONFIG is None:


class TestController(TestCase):
    def __init__(self, *args):
        wsgiapp = loadapp('config:development.ini', relative_to=conf_dir)
        self.app = paste.fixture.TestApp(wsgiapp)
        from paste.deploy.config import CONFIG
        print "CONFIG is %s" % CONFIG.current_conf()
        TestCase.__init__(self, *args)

% nosetests
booty% nosetests
EEEEEEEEEEECONFIG is None
...

So, somewhere along the way I think paste.deploy.config is being imported
before loadapp gets a chance to set the value of CONFIG and so it is already
imported without a value in the current namespace.

For reference, I'm using the following versions of the relevant libraries:

Pylons-0.8-py2.3.egg
nose-0.8.7.2-py2.3.egg
PasteScript-0.5.1-py2.3.egg
PasteDeploy-0.5-py2.3.egg
Paste-0.5-py2.3.egg

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to