Skip to content

Commit

Permalink
regexed marker name in ignore list
Browse files Browse the repository at this point in the history
Co-authored-by: Roman Plevka <[email protected]>
  • Loading branch information
jyejare and rplevka committed Dec 19, 2023
1 parent d5e9019 commit c9dbd8c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions betelgeuse/parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Parsers for test docstrings."""
import re
from collections import namedtuple
from io import StringIO
from xml.dom import minidom
Expand Down Expand Up @@ -202,11 +203,13 @@ def parse_markers(all_markers=None, config=None):

def _process_marker(marker):
# Fetching exact marker name
marker_name = marker.split('mark.')[-1]
marker_name = re.findall(
r'(?:pytest\.mark\.)?([^(\s()]+)(?=\s*\(|\s*$)', marker)
if marker_name:
marker_name = marker_name[0]

# ignoring the marker if in ignore list
if ignore_list and any(
ignore_word in marker_name for ignore_word in ignore_list):
if ignore_list and marker_name in ignore_list:
return
resolved_markers.append(marker_name)

Expand Down

0 comments on commit c9dbd8c

Please sign in to comment.