pytest重新运行失败,但显示先前的断言

时间:2020-07-05 05:57:04

标签: pytest

运行pytest-rerunfailures时,我想查看有关失败/重新运行测试的断言信息。有没有办法看这些断言?

例如,我有test_abc@pytest.mark.flaky(reruns=2, reruns_delay=2)。这就是我所看到的:

python -m pytest -s -v -m "abc"

tests/discovery/test_a::test_abc 
RERUN  (<-- would like to see what failed / asserted)
tests/discovery/test_a::test_abc
PASSED
==================================================================================================== rerun test summary info =====================================================================================================
RERUN 
tests/discovery/test_a::test_abc

====================================================================================================== 315 tests deselected ======================================================================================================
======================================================================================= 1 passed, 315 deselected, 1 rerun in 27.25 seconds =======================================================================================

我还在pytest参数中尝试过-vv

如果pytest-rerunfailures不这样做,还有其他解决方案吗?

0 个答案:

没有答案