-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
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``: | ||
|
||
.. 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 |