Hi Mike, Thanks for helping me figure out this problem. In case it helps, here's a copy of the pylons project I setup for testing: http://dl.dropbox.com/u/374620/myapp.tgz
I have a few more questions: 1) How can I access "app.config"? 2) Can I access "app.config" outside of a WSGI app instance? I'd like to run scripts by loading the environment but not the app (http:// pylonshq.com/snippets/running_commands_with_the_app_environment). 3) The out-of-the-box pylons project throws an error when you run nosetests on a single file: $ cd myapp/myapp/tests/functional $ nosetest test_proxy.py >>> >>> SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']]) >>> AttributeError: 'NoneType' object has no attribute 'config' Let me know if there's anything I can do to help debug/fix the issues I'm having with the runtime config. -Andres On Mar 26, 6:16 pm, Mike Orr <sluggos...@gmail.com> wrote: > On Fri, Mar 26, 2010 at 3:02 PM, andres <and...@octopart.com> wrote: > > Sorry, I should have mentioned that I'm using a brand new Pylons > > 1.0rc1 project (setup via the go-pylons.py script). The nosetests are > > being run with the out-of-the-box configuration (setup.cfg: > > [nosetests] with-pylons = test.ini) and I haven't changed > > TestController.__init__(). Basically, I just setup the framework and > > added the tests I described in my post. > > > Should the testing environment explicitly set the value of > > pylons.config to the result of load_environment()? How would you > > recommend accessing the runtime configuration from a standalone > > utility that isn't doing full application requests? > > For now, you can just use ``app.config`` without bothering with > ``pylons.config``. I tried to replicate your situation in an existing > test suite but I got an error saying pylons.url was not registered. > Dealing with these magic globals in tests is such a hassle because > they work in some places but not others and it can be difficult to pin > down what to do. That's why I've long been hoping the globals would > be superceded by something non-global in Pylons 2. > > Maybe somebody else can figure this one out. > > -- > Mike Orr <sluggos...@gmail.com> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-disc...@googlegroups.com. To unsubscribe from this group, send email to pylons-discuss+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.