Allow access to custom values in skip markers #7712
Labels
topic: marks
related to marks, either the general marks or builtin
type: proposal
proposal for a new feature, often to gather opinions or design the API around the new feature
This issue discusses the feature request presented in PR #7695.
Currently conditions in skip and xfail markers can have two forms:
os
,sys
,platform
,config
.The feature request is to be able to skip based on custom user values. Proposed solutions so far are:
Use the boolean with global variables. This is not so nice because can't the lifecycle can't be controlled, and importing the necessary values add boilerplate.
(PR Allow contibuting additional global variables for skipif/xfail #7695 by @s0undt3ch) Add a new hook
pytest_markeval_namespace
which can add new values to theos
,sys
... list above. Works only for string conditions.Add a new condition type, a callable, which is evaluated lazily. Allow this callable to take fixtures, as if requested by the item.
We agreed to try approach 3 (or another proposal) for pytest 6.2, but if we don't get to it, merge approach 2.
The text was updated successfully, but these errors were encountered: