gpt4 book ai didi

python - 如何配置 tox 以获取日志

转载 作者:行者123 更新时间:2023-11-28 17:36:05 24 4
gpt4 key购买 nike

我正在尝试在我的项目中使用 tox 自动化测试。但是我无法弄清楚在使用 tox 时,python 文件中的 test_methods 中的日志或打印件去了哪里。我还为日志搜索了整个 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}'

最佳答案

这不是一个真正的答案,但我最终使用了断言..所以而不是

print(type(x))

我愿意

assert type(x)==1

这给了我

E       AssertionError: assert <class 'tuple'> == 1

...所以它是一个元组..有点废话但它有效

关于python - 如何配置 tox 以获取日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30444526/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com