【发布时间】:2020-05-30 09:34:12
【问题描述】:
if __name__ == '__main__':
if is_running_under_teamcity():
runner = TeamcityTestRunner()
else:
runner = HTMLTestRunner.HTMLTestRunner(
stream=outfile,
title='Test Report',
description='This is an example.'
)
unittest.main(testRunner=runner)
我目前正在 python 中使用 unittest 模块运行一些测试,这是我上面的当前代码。我正在 Teamcity 上部署此测试设置,第一个模块允许我将输出转换为 teamcity-messages,第二个模块创建结果的 html 报告。有没有办法在只运行一组测试的同时运行这两个跑步者?我在小步舞曲中看到的唯一选择是尝试将这两个模块组合成一个混合模块,或者使用 Teamcity 支持的另一个测试模块。但是我希望尽可能降低依赖关系
任何想法都会很棒:)
【问题讨论】:
标签: python python-3.x teamcity python-unittest runner