Pytest返回状态代码0,即使测试失败

2024-09-28 20:51:00 发布

您现在位置:Python中文网/ 问答频道 /正文

请考虑以下批处理脚本:

call <somepath>/py.test.exe <someotherpath>/tests
if %errorlevel%==0 (
    echo Tests successful.
) else (
    echo Tests failed.
)

然而,即使pytest测试失败,我也得到Tests successful。发生什么事?在


Tags: pytestecho脚本ifpytesttestscall