Skip to content

Commit

Permalink
[6.13.z] Fixing the missing markers as independent properties (#13604)
Browse files Browse the repository at this point in the history
Fixing the missing markers as independent properties (#13599)

(cherry picked from commit ae99d0d)

Co-authored-by: Jitendra Yejare <[email protected]>
  • Loading branch information
Satellite-QE and jyejare authored Jan 5, 2024
1 parent 362a0f4 commit c073783
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pytest_plugins/metadata_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c073783

Please sign in to comment.