Skip to content

Commit 540ede3

Browse files
committed
docs(expression.py): describe new name & value productions
1 parent 3cce243 commit 540ede3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/_pytest/mark/expression.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
not_expr: 'not' not_expr | '(' expr ')' | ident ('(' name '=' value ( ', ' name '=' value )* ')')?
99
1010
ident: (\w|:|\+|-|\.|\[|\]|\\|/)+
11+
name: a valid ident, but not a reserved keyword
12+
value: (unescaped) string literal | (-)?[0-9]+ | 'False' | 'True' | 'None'
1113
1214
The semantics are:
1315
1416
- Empty expression evaluates to False.
1517
- ident evaluates to True or False according to a provided matcher function.
1618
- or/and/not evaluate according to the usual boolean semantics.
19+
- ident with parentheses and keyword arguments evaluates to True or False according to a provided matcher function.
1720
"""
1821

1922
from __future__ import annotations

0 commit comments

Comments
 (0)