python - Django-nose 奇怪的输出

标签 python django nose

我正在为我的 django 项目尝试不同的测试工具。我也是 django 和 python 的新手。 我已经在我的 virtualenv 上安装了 django 和 django-nose。我按照 django-nose 文档中的要求编辑了 settings.py 文件。当我使用命令 python manage.py test app 运行测试时,我得到以下输出:

Creating test database for alias 'default'...

....

DEBUG 2012-12-17 01:04:20,647 generic (10716) generic.py:261 execute "SET FOREIG
N_KEY_CHECKS=0;" with params "[]"
DEBUG 2012-12-17 01:04:20,661 generic (10716) generic.py:261 execute "SET FOREIG
N_KEY_CHECKS=0;" with params "[]"

....

............F.F.............EEEEEE.EEEEEEE

有很多类似的行开头都是DEBUG,我用这4个点来表示它们。毕竟这些行后面的测试报告看起来很正常。

所以问题是,我的设置有具体问题吗?还是正常的 Nose 输出?

app/
    tests/
        __init__.py
        test_one.py
        test_two.py

存储我的测试的位置。 init 包含测试套件。

Py.test 运行我的测试没有任何问题。

感谢您的回答。

最佳答案

我发现这是来自运行southnose同时。

如果可以的话,您可以注释掉south。如果这不起作用,请查看这个巧妙的解决方案:

http://pypede.wordpress.com/2012/06/17/disable-south-debug-logging-when-testing-apps-with-nose-in-django/

我的输出类似,但略有不同:

execute "SET FOREIGN_KEY_CHECKS=0;" with params "[]"
execute "SET FOREIGN_KEY_CHECKS=0;" with params "[]"
...
execute "SET FOREIGN_KEY_CHECKS=0;" with params "[]"
execute "SET FOREIGN_KEY_CHECKS=0;" with params "[]"

关于python - Django-nose 奇怪的输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13906865/

相关文章:

python - 如何从 Tweepy 获取正确的日期和时间?

python - 高效的 p​​andas between() 用于多个值中的任何一个

python - Django 模块未找到错误,但它已被删除并删除所有引用

python - 使用 Python 覆盖率对测试结果进行分组

python - 无法绘制图表 : matplotlib is needed for plotting

python - django-socketio:无属性 'response_headers_list'

python - Django 寻找不同项目的 URL

python - 如何让nosetests使用点语法?

python - 模拟 flask.request 在 python nosetests

python - 在 tkinter 中更改滚动条的外观(使用 ttk 样式)