我注意到,当我的Python单元测试包含函数顶部的文档时,框架有时会在测试输出中打印它们.通常,测试输出每行包含一个测试:
<test name> ... ok
Run Code Online (Sandbox Code Playgroud)
如果测试具有表单的文档字符串
"""
test that so and so happens
"""
Run Code Online (Sandbox Code Playgroud)
比一切都好.但是如果测试在一行上都有一个文档字符串:
"""test that so and so happens"""
Run Code Online (Sandbox Code Playgroud)
然后测试输出需要多行,并包含如下文档:
<test name>
test that so and so happens ... ok
Run Code Online (Sandbox Code Playgroud)
我无法找到这是记录在案的行为.有没有办法把它关掉?