When running my application with paster, I clearly see main() taking
two parameters --

$ paster serve --reload development.ini
Starting subprocess with file monitor
> .../myapp/__init__.py(93)main()
-> engine = engine_from_config(settings, 'sqlalchemy.')
(Pdb) l
 89     def main(global_config, **settings):
 90         import pdb; pdb.set_trace()
 91  ->     engine = engine_from_config(settings, 'sqlalchemy.')
(Pdb) global_config
{'__file__': '.../myapp/development.ini', 'here': '.../myapp/'}
(Pdb) settings
{'debug_templates': 'true', ..., 'sqlalchemy.echo': 'true'}

However, my functional test --

class TestHome(unittest.TestCase):
    def setUp(self):
        from myapp import main
        settings = {'sqlalchemy.echo': 'true'}
        app = main({}, settings)

fails to start with the following error --

  File ".../myapp/tests/functional_tests/test_functional_home.py",
line 6, in setUp
    app = main({}, settings)
TypeError: main() takes exactly 1 argument (2 given)

Any pointer will be greatly appreciated!

Jerry

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