【发布时间】:2015-08-07 07:11:30
【问题描述】:
我正在尝试在我的项目中使用 tox 自动化测试。但是在使用 tox 时,我无法弄清楚 python 文件中的 test_methods 中的日志或打印在哪里。我还 grep 了整个 tox 目录的日志,但找不到它。
问题
1) 如何在 tox 中配置日志目录?
2) 日志的默认配置是什么?
任何指向文档和示例的指针?
我的 tox.ini 文件
[tox]
minversion = 1.6
skipsdist = True
[testenv]
skip_install = True
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
passenv = LANG
[testenv:test]
commands = ./test.sh --slowest --testr-args='{posargs}'
【问题讨论】:
-
我可以使用 .tox/
/bin/activate 来使用虚拟环境。然后执行 python -m testtools.run 以查看实际的日志和打印。