From 4cadc600d59b4cb7a5c3cb3e0244392421830513 Mon Sep 17 00:00:00 2001 From: TomV Date: Sun, 12 Oct 2014 19:07:03 +0100 Subject: [PATCH] fix issue552: note about marking single callables --- doc/en/example/markers.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/en/example/markers.txt b/doc/en/example/markers.txt index bb8e08b49..5559af92f 100644 --- a/doc/en/example/markers.txt +++ b/doc/en/example/markers.txt @@ -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`: