From 918268774ba99f60dd809bee50946a4438da605e Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Thu, 6 Jun 2019 09:41:15 -0700 Subject: [PATCH] Add `slow` marker in run/skip option example. The example implementation of a `--runslow` option results in a `PytestUnknownMarkWarning`. Include registering the custom mark in the example, based on the documentation in markers.rst. --- AUTHORS | 1 + changelog/5416.doc.rst | 1 + doc/en/example/simple.rst | 4 ++++ 3 files changed, 6 insertions(+) create mode 100644 changelog/5416.doc.rst diff --git a/AUTHORS b/AUTHORS index 0672d4abf..3d050a346 100644 --- a/AUTHORS +++ b/AUTHORS @@ -200,6 +200,7 @@ Pulkit Goyal Punyashloka Biswal Quentin Pradet Ralf Schmitt +Ralph Giles Ran Benita Raphael Castaneda Raphael Pierzina diff --git a/changelog/5416.doc.rst b/changelog/5416.doc.rst new file mode 100644 index 000000000..81e4c6404 --- /dev/null +++ b/changelog/5416.doc.rst @@ -0,0 +1 @@ +Fix PytestUnknownMarkWarning in run/skip example. diff --git a/doc/en/example/simple.rst b/doc/en/example/simple.rst index 140f4b840..5e405da56 100644 --- a/doc/en/example/simple.rst +++ b/doc/en/example/simple.rst @@ -157,6 +157,10 @@ line option to control skipping of ``pytest.mark.slow`` marked tests: ) + def pytest_configure(config): + config.addinivalue_line("markers", "slow: mark test as slow to run") + + def pytest_collection_modifyitems(config, items): if config.getoption("--runslow"): # --runslow given in cli: do not skip slow tests