MCPcopy Create free account
hub / github.com/pytest-dev/pytest / not_expr

Function not_expr

src/_pytest/mark/expression.py:161–171  ·  view source on GitHub ↗
(s: Scanner)

Source from the content-addressed store, hash-verified

159
160
161def not_expr(s: Scanner) -> ast.expr:
162 if s.accept(TokenType.NOT):
163 return ast.UnaryOp(ast.Not(), not_expr(s))
164 if s.accept(TokenType.LPAREN):
165 ret = expr(s)
166 s.accept(TokenType.RPAREN, reject=True)
167 return ret
168 ident = s.accept(TokenType.IDENT)
169 if ident:
170 return ast.Name(IDENT_PREFIX + ident.value, ast.Load())
171 s.reject((TokenType.NOT, TokenType.LPAREN, TokenType.IDENT))
172
173
174class MatcherAdapter(Mapping[str, bool]):

Callers 1

and_exprFunction · 0.85

Calls 3

exprFunction · 0.85
acceptMethod · 0.80
rejectMethod · 0.80

Tested by

no test coverage detected