1919import re
2020import shutil
2121import os
22+ import pytest
23+
2224from click .testing import CliRunner
2325from mkdocs .__main__ import build_command
2426from git import Repo
@@ -54,29 +56,16 @@ def build_docs_setup(mkdocs_path, output_path):
5456 build_command , ["--config-file" , mkdocs_path , "--site-dir" , str (output_path )]
5557 )
5658
57-
58- def test_basic_working (tmp_path ):
59-
60- result = build_docs_setup ("tests/basic_setup/mkdocs.yml" , tmp_path )
61- assert result .exit_code == 0 , (
62- "'mkdocs build' command failed. Error: %s" % result .stdout
63- )
64-
65- index_file = tmp_path / "index.html"
66- assert index_file .exists (), "%s does not exist" % index_file
67-
68- contents = index_file .read_text ()
69- assert re .search ("<span class='git-page-authors" , contents )
70- assert re .
search (
"<li><a href='mailto:[email protected] '>Tim Vink</a></li>" ,
contents )
71-
72-
73- def test_basic_working_macros (tmp_path ):
59+ @pytest .mark .parametrize (
60+ "mkdocs_file" ,
61+ ["mkdocs.yml" , "mkdocs_w_macros.yml" , "mkdocs_w_macros2.yml" , "mkdocs_complete_material.yml" ],
62+ )
63+ def test_basic_working (tmp_path , mkdocs_file ):
7464 """
7565 combination with mkdocs-macros-plugin lead to error.
76-
7766 See https://github.com/timvink/mkdocs-git-authors-plugin/issues/60
7867 """
79- result = build_docs_setup ("tests/basic_setup/mkdocs_w_macros .yml" , tmp_path )
68+ result = build_docs_setup ("tests/basic_setup/mkdocs .yml" , tmp_path )
8069 assert result .exit_code == 0 , (
8170 "'mkdocs build' command failed. Error: %s" % result .stdout
8271 )
@@ -89,6 +78,7 @@ def test_basic_working_macros(tmp_path):
8978 assert re .
search (
"<li><a href='mailto:[email protected] '>Tim Vink</a></li>" ,
contents )
9079
9180
81+
9282def test_exclude_working (tmp_path ):
9383
9484 result = build_docs_setup ("tests/basic_setup/mkdocs_exclude.yml" , tmp_path )
0 commit comments