Skip to content

Commit

Permalink
Collect tests with case insensitive component marker
Browse files Browse the repository at this point in the history
  • Loading branch information
shweta83 committed May 8, 2024
1 parent a71fa30 commit 8b56245
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pytest_plugins/metadata_markers.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def pytest_collection_modifyitems(items, config):
# split the option string and handle no option, single option, multiple
# config.getoption(default) doesn't work like you think it does, hence or ''
importance = [i for i in (config.getoption('importance') or '').split(',') if i != '']
component = [c for c in (config.getoption('component') or '').split(',') if c != '']
component = [c.lower() for c in (config.getoption('component') or '').split(',') if c != '']
team = [a.lower() for a in (config.getoption('team') or '').split(',') if a != '']
verifies_issues = config.getoption('verifies_issues')
blocked_by = config.getoption('blocked_by')
Expand All @@ -191,8 +191,8 @@ def pytest_collection_modifyitems(items, config):
# Add marker starting at smallest docstring scope
# only add the mark if it hasn't already been applied at a lower scope
doc_component = component_regex.findall(docstring)
if doc_component and 'component' not in item_mark_names:
item.add_marker(pytest.mark.component(doc_component[0]))
if doc_component and 'CaseComponent' not in item_mark_names:
item.add_marker(pytest.mark.component(doc_component[0].lower()))
doc_importance = importance_regex.findall(docstring)
if doc_importance and 'importance' not in item_mark_names:
item.add_marker(pytest.mark.importance(doc_importance[0]))
Expand Down

0 comments on commit 8b56245

Please sign in to comment.