按照各大论坛上命令
pytest --alluredir=<directory-with-results> --clean-alluredir
allure generate <directory-with-results> -o <directory-with-report>
(pytestdemo) F:\work\program\python\pytestdemo>pytest -s -q --alluredir report/result test_demo.py --clean-alluredir
.FF
============================================================================= FAILURES =============================================================================
____________________________________________________________________________ test_add2 _____________________________________________________________________________
def test_add2():
> assert add(2,3) ==6
E assert 5 == 6
E + where 5 = add(2, 3)
test_demo.py:8: AssertionError
____________________________________________________________________________ test_add3 _____________________________________________________________________________
def test_add3():
> assert add(2, 7) == 6
E assert 9 == 6
E + where 9 = add(2, 7)
test_demo.py:11: AssertionError
===================================================================== short test summary info ======================================================================
FAILED test_demo.py::test_add2 - assert 5 == 6
FAILED test_demo.py::test_add3 - assert 9 == 6
2 failed, 1 passed in 0.16s
(pytestdemo) F:\work\program\python\pytestdemo>allure generate ./report -o ./report/html --clean
Report successfully generated to .\report\html
浏览器打开就这样
请大家帮忙看看问题在哪里?