Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pytest_markeval_namespace hook. #8124

Merged

Commits on Dec 12, 2020

  1. Add pytest_markeval_namespace hook.

    Add a new hook , `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``:
    
    .. code-block:: python
       def pytest_markeval_namespace():
           return {"color": "red"}
    ``test_func.py``:
    
    .. code-block:: python
       @pytest.mark.skipif("color == 'blue'", reason="Color is not red")
       def test_func():
           assert False
    s0undt3ch authored and bluetech committed Dec 12, 2020
    Copy the full SHA
    b16c091 View commit details
    Browse the repository at this point in the history