From 167a478aa1f72288f511effc8a3fc12e8fcbc17a Mon Sep 17 00:00:00 2001 From: David Diaz Barquero Date: Wed, 12 Jul 2023 15:28:57 -0600 Subject: [PATCH] Fix recording of test id mark Starting 2018 (many pytest versions ago) the correct way to record properties is by using the "record_property" method https://github.com/pytest-dev/pytest/pull/2770 --- lib/topology/pytest/plugin.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/topology/pytest/plugin.py b/lib/topology/pytest/plugin.py index e68447c..73faaad 100644 --- a/lib/topology/pytest/plugin.py +++ b/lib/topology/pytest/plugin.py @@ -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