Skip to content

Commit

Permalink
Fix recording of test id mark
Browse files Browse the repository at this point in the history
Starting 2018 (many pytest versions ago) the correct way to record properties is by using the "record_property" method

pytest-dev/pytest#2770
  • Loading branch information
dajose authored Jul 12, 2023
1 parent cd0a155 commit 167a478
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/topology/pytest/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,12 +334,9 @@ def pytest_runtest_setup(item):
test_id_marker = item.get_closest_marker('test_id')
incompatible_marker = item.get_closest_marker('platform_incompatible')

# If marked and xml logging enabled
if test_id_marker is not None and hasattr(item.config, '_xml'):
if test_id_marker is not None:
test_id = test_id_marker.args[0]
item.config._xml.node_reporter(item.nodeid).add_property(
'test_id', test_id
)
item.user_properties.append(('test_id', test_id))

if incompatible_marker:
platform = item.config._topology_plugin.platform
Expand Down

0 comments on commit 167a478

Please sign in to comment.