Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 476 Bytes

7695.feature.rst

File metadata and controls

19 lines (12 loc) · 476 Bytes

A new hook was added, pytest_markeval_namespace which should return a dictionary. This dictionary will be used to augment the "global" variables available to evaluate skipif/xfail/xpass markers.

Pseudo example

conftest.py:

def pytest_markeval_namespace():
    return {"color": "red"}

test_func.py:

@pytest.mark.skipif("color == 'blue'", reason="Color is not red")
def test_func():
    assert False