Pytest在故障报告中显示参数值

时间:2019-07-21 20:50:17

标签: pytest

有时pytest -vvv在失败报告的顶部显示参数值,如下所示,但有时不显示。当它不是自动发生时,如何使它显示参数值?

=================================================================== FAILURES ===================================================================
_____________________________________________________________ test_person[person0] _____________________________________________________________

person = Person(name='Alice', hobbies=[Hobby(title='hacking')])

    @pytest.mark.parametrize("person", PERSONS)
    def test_person(person):
>       assert person == 'foo'
E       AssertionError: assert Person(name='Alice', hobbies=[Hobby(title='hacking')]) == 'foo'

../../tmp/ids.py:25: AssertionError

0 个答案:

没有答案