【发布时间】:2012-09-10 14:39:02
【问题描述】:
在我们的项目中,我们一直使用 ant 命令来运行项目的单元测试。这个 ant 命令只是调用一个 manage.py 文件(它本质上将 GAE 和 django 联系在一起)。
示例用法:python manage.py test
from appengine_django import InstallAppengineHelperForDjango
InstallAppengineHelperForDjango(version='1.2')
from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError:
import sys
sys.stderr.write("""Error: Can't find the file 'settings.py' in the directory containing %r.
It appears you've customized things.
You'll have to run django-admin.py, passing it your settings module.
(If the file settings.py does indeed exist, it's causing an ImportError somehow.)
""" % __file__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(settings)
在 IDE 方面,出于提高开发人员工作效率的愿望,团队已转而使用 pycharm。但是,我们无法让 pycharm 的单元测试运行程序正常工作。
Pycharms 尝试运行测试导致错误:
找不到 Google App Engine SDK!
跑步者的调用方式如下:
python \pycharm\django_test_manage.py" 测试可见性
在pycharm项目设置中:
- 已添加并启用 google app engine sdk
- 我已尝试扩展 python 解释器以包含 GAE 的路径
- 修改 django_test_manage.py 文件以包含 GAE 的路径
所有结果都以 App Engine SDK 错误结束。我忽略了一些微不足道的事情吗?
【问题讨论】:
标签: python unit-testing google-app-engine pycharm