Skip to content

Commit

Permalink
Fixing the missing markers as independent properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jyejare committed Jan 4, 2024
1 parent 963700e commit 736a02a
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 736a02a

Please sign in to comment.