py.test : Can multiple markers be applied at the test function level?
<p>I have seen from <a href="http://pytest.org/latest/example/markers.html" rel="noreferrer">the pytest docs</a> that we can apply multiple markers at once on the Class or module level. I didn't find documentation for doing it at the test function level.  Has anybody done this before with success? </p>

<p>I would like to ideally do this as a list of markers as being done in the above doc for Classes, for example (quoting from the docs):</p>

<pre><code>class TestClass:
    pytestmark = [pytest.mark.webtest, pytest.mark.slowtest]
</code></pre>

<p>So, the pytest documentation talks about using <code>pytestmark</code> to specify the markers at the class and module level. However, it doesn't talk about having something similar at the test function level. I would have to specify the markers individually on top of test functions to get them marked with each one of them. This makes the test code look a little clunky with the increasing number of markers on top of test functions. </p>

<p>test_example.py: </p>

<pre><code>pytestmark = [class1, class2]

class TestFeature(TestCase):

    @pytest.mark.marker1
    @pytest.mark.marker2
    @pytest.mark.marker3
    def test_function(self):
        assert True
</code></pre>