【问题标题】:GAE "Ran 0 tests" from unittest2来自 unittest2 的 GAE“运行 0 次测试”
【发布时间】:2013-11-26 11:24:33
【问题描述】:

我正在尝试按照 GAE 的 Python SDK Setting up a testing framework 部分实施单元测试。

使用他们的示例测试运行器和测试,我收到以下输出:

在 0.000 秒内运行 0 次测试

好的

我已经安装了 unittest2,我还尝试运行以下命令,但都产生了相同的响应:

python -m unittest discover ~/foldername
python -m unittest2 discover ~/foldername

我尝试从 Python 文档添加 Basic example 测试文件,但也得到了相同的结果。

在单元测试的文件夹中有和没有__init__.py 的情况下尝试了以上所有方法。

接下来我应该尝试什么来调试这个问题?

更新

我的目录结构如下:

├── app.yaml
├── myclass.py
├── bulkloader.yaml
├── myappname.py
├── index.yaml
├── testmodel.py
├── test_runner.py
└── unit_tests
    ├── demotestcase.py
    └── sample.py

包含上述链接中两个测试的内容。

【问题讨论】:

  • 你的目录结构是什么样的?文件的内部是什么样的?
  • 更新了目录结构,文件作为链接

标签: python google-app-engine unit-testing


【解决方案1】:
Usage: python -m unittest discover [options]

-s directory     Directory to start discovery ('.' default)
-p pattern       Pattern to match test files ('test*.py' default)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-06-29
    • 1970-01-01
    • 2017-10-12
    • 2017-05-30
    • 2013-01-24
    • 1970-01-01
    • 2021-10-07
    相关资源
    最近更新 更多