Merged in tomviner/pytest (pull request #222)

fix issue552: Add a note to the docs about marking single callables
This commit is contained in:
holger krekel 2014-10-14 10:02:21 +02:00
commit de7c97aa1e
1 changed files with 8 additions and 0 deletions

View File

@ -280,6 +280,14 @@ In this example the mark "foo" will apply to each of the three
tests, whereas the "bar" mark is only applied to the second test.
Skip and xfail marks can also be applied in this way, see :ref:`skip/xfail with parametrize`.
.. note::
If the data you are parametrizing happen to be single callables, you need to be careful
when marking these items. `pytest.mark.xfail(my_func)` won't work because it's also the
signature of a function being decorated. To resolve this ambiguity, you need to pass a
reason argument:
`pytest.mark.xfail(func_bar, reason="Issue#7")`.
.. _`adding a custom marker from a plugin`: