Trigger command line expr to run compile with mark checks
This commit is contained in:
parent
58521efcaa
commit
6c4c3036e5
|
@ -236,7 +236,7 @@ def deselect_by_mark(items: "List[Item]", config: Config) -> None:
|
||||||
if not matchexpr:
|
if not matchexpr:
|
||||||
return
|
return
|
||||||
|
|
||||||
expr = _parse_expression(matchexpr, "Wrong expression passed to '-m'")
|
expr = _parse_expression(matchexpr, "Wrong expression passed to '-m'", True)
|
||||||
remaining: List[Item] = []
|
remaining: List[Item] = []
|
||||||
deselected: List[Item] = []
|
deselected: List[Item] = []
|
||||||
for item in items:
|
for item in items:
|
||||||
|
@ -249,9 +249,9 @@ def deselect_by_mark(items: "List[Item]", config: Config) -> None:
|
||||||
items[:] = remaining
|
items[:] = remaining
|
||||||
|
|
||||||
|
|
||||||
def _parse_expression(expr: str, exc_message: str) -> Expression:
|
def _parse_expression(expr: str, exc_message: str, mark: bool = False) -> Expression:
|
||||||
try:
|
try:
|
||||||
return Expression.compile(expr)
|
return Expression.compile(expr, mark)
|
||||||
except ParseError as e:
|
except ParseError as e:
|
||||||
raise UsageError(f"{exc_message}: {expr}: {e}") from None
|
raise UsageError(f"{exc_message}: {expr}: {e}") from None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue