开发者

Why an error in nosetests and not in Eclipse?

I'm using a third-party library which needs urlfetch from google.appengine.api. It is imported into the executing tests using this line:

from google.appengine.api import urlfetch

The google_appengine directory is on my PYTHONPATH, and i开发者_StackOverflow社区f I execute my unit tests directly from Eclipse, I see no errors. However, if I use nosetests, I see this:

File "/home/wraith/dev/sdks/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 54, in CreateRPC
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "urlfetch"

Someone had a similar issue, but I am using Python 2.5 and I tried to execute nosetests from the google_appengine directory using --where and providing the path to my unit test directory and I see the same result.

Why is this fine in Eclipse but fail in nosetests?


Calls to App Engine APIs are handled by API proxy modules. In the dev_appserver, local, development versions of these are set up for you, but if you try and run your code directly from the command line, they're not set up.

You can set them up yourself something like this, or you can just use nosegae.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜