Skip to content

Commit 9130302

Browse files
committed
tests: Add back tests from mkdocstrings
1 parent e28cee7 commit 9130302

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

tests/test_themes.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""Tests for the different themes we claim to support."""
2+
3+
import sys
4+
5+
import pytest
6+
7+
8+
@pytest.mark.parametrize(
9+
"plugin",
10+
[
11+
{"theme": "mkdocs"},
12+
{"theme": "readthedocs"},
13+
{"theme": {"name": "material"}},
14+
],
15+
indirect=["plugin"],
16+
)
17+
@pytest.mark.parametrize(
18+
"module",
19+
[
20+
"mkdocstrings.extension",
21+
"mkdocstrings.inventory",
22+
"mkdocstrings.loggers",
23+
"mkdocstrings.plugin",
24+
"mkdocstrings.handlers.base",
25+
"mkdocstrings.handlers.python",
26+
"mkdocstrings.handlers.rendering",
27+
],
28+
)
29+
@pytest.mark.skipif(sys.version_info < (3, 7), reason="material is not installed on Python 3.6")
30+
def test_render_themes_templates(module, plugin):
31+
"""Test rendering of a given theme's templates.
32+
33+
Parameters:
34+
module: The module to load and render (parametrized).
35+
plugin: The plugin instance (parametrized fixture).
36+
"""
37+
handler = plugin.handlers.get_handler("python")
38+
handler.renderer._update_env(plugin.md, plugin.handlers._config) # noqa: WPS437
39+
data = handler.collector.collect(module, {})
40+
handler.renderer.render(data, {})

0 commit comments

Comments
 (0)