fix issue552: note about marking single callables

This commit is contained in:
TomV 2014-10-12 19:07:03 +01:00
parent b2341899c5
commit 4cadc600d5
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`: