pytest
pytest copied to clipboard
markers: support new ident '|'
Hi pytest team!
While I'm developing a new feature to the pytest-embedded plugin, I realize that | is not allowed in pytest markers. (Inside the pytest-embedded plugin, I'm using | as a separator.)
ERROR: Wrong expression passed to '-m': esp32|esp32p4: at column 6: unexpected character "|"
I'm wondering the reason behind this. so I'm opening this PR.
Thanks! Hanxi
EDIT
actually use | is better than : (which is supported now)
I didn't find a way to define a marker with : inside, since everything past after the first : will be considered as a optional description.
so pytest -m "a:b" will try to search a marker called a:b, but if I put
[pytest]
a:b: test
only marker a will be added
if we support |, we could define with
[pytest]
a|b: test
(tested with --strict-marker)
The test cases are failing, I'll fix them once the idea got approved by you.
It's unclear to me what exactly this solves
Marker names currently are limited to identifiers
The pipe is commonly used as logic operator in python and im under the impression that using those like that can be costly later
closing due to lack of feedback, im happy to reopen once the discussion happens