See if something in https://github.com/viniciusban/web2py.test helps you.
On Wed, Jun 26, 2013 at 3:21 PM, Ian W. Scott <scotti...@gmail.com> wrote: > I'm trying to use WebClient in a pytest suite and getting an error that I > don't understand. I try to connect like this: > > client = WebClient('http://127.0.0.1:8000/paideia/default/', > postbacks=True) > client.get('index') > > But client.get('index') throws an error. The error arises in urllib2.py line > 1184: > > URLError: <urlopen error [Errno 111] Connection refused> > > I assume this means that the rocket server isn't running properly. But I > can't quite see what the problem is. I set up the test suite like this: > > 1. from the command-line I launch web2py in the app "paideia" and execute > the test launcher (runtest.py) in that web2py environment: > > python ~/web/web2py/web2py.py -S --ip=127.0.0.1 --port=8000 > --password=password paideia -M -R applications/paideia/bin/runtest.py > > 2. In runtest.py I call pytest programmatically: > > import pytest > pytest.main(path/to/test/dir/) > > 3. Pytest then finds my test suite file (there's only one so far) and runs > the test, running into the error when I try to access default/index via the > webclient. > > The strange thing is that the web2py environment seems to be there. I have > access to current and to db. But the http connection seems to fail. > > Any help would be greatly appreciated! > > Ian > > -- > > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.