On May 30, 11:04 am, Evgeny <[email protected]> wrote:
> To make pylons.config be available not only in context or request, but
> within other tests as well.
>
> I've added two lines to tests/__init__.py:
> import pylons
> pylons.config.push_thread_config(pylons.test.pylonsapp.config)
>
> This is a workaround for my tests to pass after migration to Pylons
> 0.9.7

This is similar to my workaround, which is, simplified:

# environment.py
def load_environment(global_conf, app_conf):
    if testing:
        pylons.config._push_object(config)
    return config

The recommendation of setting `app.config = config` in middleware.py
doesn't work for all cases (e.g., when you have filter middleware
defined in a config file).

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