From 5182c73feae59a86d9b2345b059ff9013e21a2d7 Mon Sep 17 00:00:00 2001 From: Prashant Sharma <31796326+gutsytechster@users.noreply.github.com> Date: Wed, 14 Oct 2020 17:47:50 +0530 Subject: [PATCH] Add example for registering multiple custom mark (#7886) --- AUTHORS | 1 + doc/en/example/markers.rst | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 37c1e3c06..d2bb3d3ec 100644 --- a/AUTHORS +++ b/AUTHORS @@ -233,6 +233,7 @@ Pieter Mulder Piotr Banaszkiewicz Piotr Helm Prashant Anand +Prashant Sharma Pulkit Goyal Punyashloka Biswal Quentin Pradet diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst index 3d55f9ebb..1dc44be34 100644 --- a/doc/en/example/markers.rst +++ b/doc/en/example/markers.rst @@ -221,14 +221,19 @@ Registering markers for your test suite is simple: [pytest] markers = webtest: mark a test as a webtest. + slow: mark test as slow. -You can ask which markers exist for your test suite - the list includes our just defined ``webtest`` markers: +Multiple custom markers can be registered, by defining each one in its own line, as shown in above example. + +You can ask which markers exist for your test suite - the list includes our just defined ``webtest`` and ``slow`` markers: .. code-block:: pytest $ pytest --markers @pytest.mark.webtest: mark a test as a webtest. + @pytest.mark.slow: mark test as slow. + @pytest.mark.filterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/stable/warnings.html#pytest-mark-filterwarnings @pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.