From bd2a448ca6bbec02ae3d80b9742ed88a9b31fec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Sun, 8 Mar 2026 08:17:53 +0000 Subject: [PATCH] Document custom marks in CONTRIBUTING.rst --- CONTRIBUTING.rst | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 22db94565..93ad19c81 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -374,6 +374,32 @@ In order to add such a test, mark your test with the ``integration_test`` marker This way, the test will be run only in the integration test suite. +beets also defines custom pytest markers in ``test/conftest.py``: + +- ``integration_test``: runs only when ``INTEGRATION_TEST=true`` is set. +- ``on_lyrics_update``: runs only when ``LYRICS_UPDATED=true`` is set. +- ``requires_import("module", force_ci=True)``: runs the test only when the + module is importable. With the default ``force_ci=True``, this import check is + bypassed on GitHub Actions for ``beetbox/beets`` so CI still runs the test. + Set ``force_ci=False`` to allow CI to skip when the module is missing. + +.. code-block:: python + + @pytest.mark.integration_test + def test_external_api_call(): ... + + + @pytest.mark.on_lyrics_update + def test_real_lyrics_backend(): ... + + + @pytest.mark.requires_import("langdetect") + def test_language_detection(): ... + + + @pytest.mark.requires_import("librosa", force_ci=False) + def test_autobpm_command(): ... + .. _codecov: https://app.codecov.io/github/beetbox/beets .. _discussion board: https://github.com/beetbox/beets/discussions