Reporting Test result using simple html file

Dahun Yoo·2022년 2월 2일
0

Introduce to Pytest

목록 보기
4/6

Pytest를 사용하였을 때의 확인할 수 있는 간단한 html보고서를 사용합니다.

Install

pytest-html 이라는 매우 단순한 라이브러리가 있습니다.
pip install pytest-html 을 이용하여 설치해줍니다.

Execute test and report

pytest를 실행할 때, 옵션을 넣어 실행합니다.
pytest --html="results.html"

경로를 별도로 지정해서 실행할 수도 있습니다.


Report to XML

XML형식으로 리포트하는 것도 가능합니다.
pytest --junitxml="results.xml"

이때, junitxml 옵션을 이용하여 생성하면, jenkins의 post-build 동작에서
publish JUnit test result report 옵션도 이용할 수 있습니다.

profile
QA Engineer

3개의 댓글

comment-user-thumbnail
2024년 3월 11일

안녕하세요.

좋은 글 잘 읽었습니다. Pytest-xdist로 pytest-bdd 스텝 파일을 실행할 때 pytest-html에서 실행 파일 모두의 결과를 취합할 수 있는 지 궁금합니다.

2개의 답글