| 1 |
"""Tests for the different themes we claim to support.""" |
| 2 |
|
| 3 |
from __future__ import annotations |
| 4 |
|
| 5 |
from typing import TYPE_CHECKING |
| 6 |
|
| 7 |
import pytest |
| 8 |
|
| 9 |
if TYPE_CHECKING: |
| 10 |
from mkdocstrings_handlers.python import PythonHandler |
| 11 |
|
| 12 |
|
| 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_handlers.python._internal.config", |
| 26 |
"mkdocstrings_handlers.python._internal.handler", |
| 27 |
"mkdocstrings_handlers.python._internal.rendering", |
| 28 |
], |
| 29 |
) |
| 30 |
def test_render_themes_templates_python(identifier: str, handler: PythonHandler) -> None: |
| 31 |
"""Test rendering of a given theme's templates. |
| 32 |
|
| 33 |
Parameters: |
| 34 |
identifier: Parametrized identifier. |
| 35 |
handler: Python handler (fixture). |
| 36 |
""" |
| 37 |
options = handler.get_options({}) |
| 38 |
data = handler.collect(identifier, options) |
| 39 |
handler.render(data, options) |