pytest.exit 含义 使用 含义 exit: 退出测试进程。 源码: msg: 就是我们退出测试进程时显示的信息。 returncode: 当退出pytest时返回的一个状态码,为 int 类型。 使用 def sum(x): return x + 1 def test_sum1(): print(