Skip to content

Commit

Permalink
markers: support new ident '|'
Browse files Browse the repository at this point in the history
  • Loading branch information
hfudev committed Apr 30, 2024
1 parent feaae2f commit 63e9ed1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/_pytest/mark/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
expr: and_expr ('or' and_expr)*
and_expr: not_expr ('and' not_expr)*
not_expr: 'not' not_expr | '(' expr ')' | ident
ident: (\w|:|\+|-|\.|\[|\]|\\|/)+
ident: (\w|:|\+|-|\.|\[|\]|\\|/|\|)+
The semantics are:
Expand Down Expand Up @@ -86,7 +86,7 @@ def lex(self, input: str) -> Iterator[Token]:
yield Token(TokenType.RPAREN, ")", pos)
pos += 1
else:
match = re.match(r"(:?\w|:|\+|-|\.|\[|\]|\\|/)+", input[pos:])
match = re.match(r"(:?\w|:|\+|-|\.|\[|\]|\\|/|\|)+", input[pos:])

Check warning on line 89 in src/_pytest/mark/expression.py

View check run for this annotation

Codecov / codecov/patch

src/_pytest/mark/expression.py#L89

Added line #L89 was not covered by tests
if match:
value = match.group(0)
if value == "or":
Expand Down

0 comments on commit 63e9ed1

Please sign in to comment.