Coverage for tests/test_themes.py: 100.00%
9 statements
« prev ^ index » next coverage.py v7.10.3, created at 2025-08-14 23:22 +0200
« prev ^ index » next coverage.py v7.10.3, created at 2025-08-14 23:22 +0200
1"""Tests for the different themes we claim to support."""
3from __future__ import annotations
5from typing import TYPE_CHECKING
7import pytest
9if TYPE_CHECKING:
10 from mkdocstrings_handlers.python import PythonHandler
13@pytest.mark.parametrize(
14 "plugin",
15 [
16 {"theme": "mkdocs"},
17 {"theme": "readthedocs"},
18 {"theme": {"name": "material"}},
19 ],
20 indirect=["plugin"],
21)
22@pytest.mark.parametrize(
23 "identifier",
24 [
25 "mkdocstrings.extension",
26 "mkdocstrings.inventory",
27 "mkdocstrings.loggers",
28 "mkdocstrings.plugin",
29 "mkdocstrings.handlers.base",
30 "mkdocstrings.handlers.rendering",
31 "mkdocstrings_handlers.python",
32 ],
33)
34def test_render_themes_templates_python(identifier: str, handler: PythonHandler) -> None:
35 """Test rendering of a given theme's templates.
37 Parameters:
38 identifier: Parametrized identifier.
39 handler: Python handler (fixture).
40 """
41 options = handler.get_options({})
42 data = handler.collect(identifier, options)
43 handler.render(data, options)