From bb9ad838b171725665ed5186c9f74f51b0839948 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Fri, 5 Jan 2024 10:09:01 -0500 Subject: [PATCH] [6.12.z] Fixing the missing markers as independent properties (#13603) Fixing the missing markers as independent properties (#13599) (cherry picked from commit ae99d0d0fe2ceda3d35c6586788e1587ab3c5ff6) Co-authored-by: Jitendra Yejare --- pytest_plugins/metadata_markers.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pytest_plugins/metadata_markers.py b/pytest_plugins/metadata_markers.py index 311628a8962..57b12aa5c1f 100644 --- a/pytest_plugins/metadata_markers.py +++ b/pytest_plugins/metadata_markers.py @@ -119,12 +119,15 @@ def pytest_collection_modifyitems(items, config): markers_prop_data = [] exclude_markers = ['parametrize', 'skipif', 'usefixtures', 'skip_if_not_set'] for marker in item.iter_markers(): - prop = marker.name - if prop in exclude_markers: + proprty = marker.name + if proprty in exclude_markers: continue if marker_val := next(iter(marker.args), None): - prop = '='.join([prop, str(marker_val)]) - markers_prop_data.append(prop) + proprty = '='.join([proprty, str(marker_val)]) + markers_prop_data.append(proprty) + # Adding independent marker as a property + item.user_properties.append((marker.name, marker_val)) + # Adding all markers as a single property item.user_properties.append(("markers", ", ".join(markers_prop_data))) # Version specific user properties