Closed virdok closed 2 months ago
Attention: Patch coverage is 80.00000%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 70.66%. Comparing base (
fbaa07e
) to head (be082f8
). Report is 5 commits behind head on develop.
Files | Patch % | Lines |
---|---|---|
pytest_reportportal/service.py | 80.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@virdok Thanks!
Is there any expected date to release this fix in master in a new version? @HardNorth
Description
A framework exists above Pytest which is called Tavern. It is using YAML files to execute API tests. During the execution of the tests in this framework and due to the difference it has in the structure of the test suites in respect to BDD for example, some changes were needed as some exceptions were thrown and the integration of the pytest execution with Reportportal was not possible / blocked.
Points of failure
Original name attribute
The first point of failure is due to the fact that the Tavern framework do not use the
originalname
in the test item. This change fixes the issue with theoriginalname
checking if its existing in the item as an attribute.If the
originalname
attribute does not exist then instead of using theitem.name
defined in this if / else statement, it was throwing the following error:Parent attribute
In the line 467 a check for the parent attribute has been added. The reason of this is the item structure of the Tavern framework in comparison with the rest of the Pytest Item structure. After getting the first time the parent object in line 461, then the Tavern framework does not have at all parents set. (Although it depends somehow to the test implementation, but always after the root object, parent is NoneType).
Falling in this case the framework throws the following exception:
So in the line 467 we check if parent attribute exists so as to step into it otherwise breaks the loop. If the loop is not broken at this point it ends up having an infinite loop.
Parent name
In the line 464 we check if the attribute
name
exists in the parent. The reason of doing so is the fact that at a point the parent object is not related to the test (It may be Session object for example) and this was throwing a name does not exist error as follows: