From a64298ff5e4d965b227e412c27677337f08a6ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Busche?= Date: Wed, 5 Aug 2020 17:03:27 +0200 Subject: [PATCH] Document registering markers in pyproject.toml (#7622) Co-authored-by: Bruno Oliveira --- doc/en/mark.rst | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/en/mark.rst b/doc/en/mark.rst index 6fb665fdf..1cdd1b8e6 100644 --- a/doc/en/mark.rst +++ b/doc/en/mark.rst @@ -43,7 +43,17 @@ You can register custom marks in your ``pytest.ini`` file like this: slow: marks tests as slow (deselect with '-m "not slow"') serial -Note that everything after the ``:`` is an optional description. +or in your ``pyproject.toml`` file like this: + +.. code-block:: toml + + [tool.pytest.ini_options] + markers = [ + "slow: marks tests as slow (deselect with '-m \"not slow\"')", + "serial", + ] + +Note that everything past the ``:`` after the mark name is an optional description. Alternatively, you can register new markers programmatically in a :ref:`pytest_configure ` hook: