Using Pytest as test framework

Hi Hiptest Team !

All my tests are written in Python and I’m using pytest as a test framework. I saw in Hiptest I can export my project in Python/Unitests format, but is there a way to export with pytest format?

The only solution currently is to push my results in hiptest creating a test run as an external test run but I can’t use Living Documentation.

Do you have any recommandations ?

Thanks.

Thomas

Hi Thomas,

I saw on pytest documentation that pytest supports running unittest-based tests out of the box. Have you tried it out?

You can also get junit result file with --junitxml=path command line option.

So you can try exporting your test run to python/unittest with hiptest-publisher, run them with pytest --junitxml=path, and then push the junit result file back to hiptest to get your test run updated along with Living Documentation.

Hi Christophe,

The fact is my python scripts don’t use Unitest format. So when I export my test run, a new file test_project.py is created.
But I don’t want to use it because all my scripts are already written in others python files.