pytest nested test suites reporting, like pycharm

27 views Asked by At

I have a testcase folder structure like this:

Root/
- test_A.py
- Functional/
     - test_func1.py
     - test_func2.py

When I run the test folder Root in pycharm, I get a hierarchical output file (html or xml, depending on what you request. When opening those files, you can clearly see nested suites.

I wanted to achieve the same thing with pytest out of the box. But when running the folder with pytest, I always get a flatlist of all testcases inside, no more nested suites.

I already spend multiple hours scavenging the web to try to find a solution, but either I can't describe my problem with the correct words, or I'm the only one that want's to achieve this outside of pycharm.

All help is welcome.

Pycharm showcase

I fail to create a hierarchical report directly via pytest. I'm open to add extra pytest plugins, or write some hooks, but I need some directions.

0

There are 0 answers