diff --git a/AUTHORS b/AUTHORS index adf189435..72391122e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -271,6 +271,7 @@ Sankt Petersbug Segev Finer Serhii Mozghovyi Seth Junot +Shubham Adep Simon Gomizelj Simon Kerr Skylar Downes diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 971ab1bef..2bb8ed5d2 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -248,6 +248,16 @@ Will create and attach a :class:`Mark <_pytest.mark.structures.Mark>` object to mark.args == (10, "slow") mark.kwargs == {"method": "thread"} +Example for using multiple custom markers: + +.. code-block:: python + + @pytest.mark.timeout(10, "slow", method="thread") + @pytest.mark.slow + def test_function(): + ... + +When :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers>` or :meth:`Node.iter_markers <_pytest.nodes.Node.iter_markers_with_node>` is used with multiple markers, the marker closest to the function will be iterated over first. The above example will result in ``@pytest.mark.slow`` followed by ``@pytest.mark.timeout(...)``. .. _`fixtures-api`: