diff --git a/pyproject.toml b/pyproject.toml index e652d3c..cbe4d99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,9 @@ test = [ "jsonfeed-util>=1.2,<2", "mkdocs-material[imaging]>=9.7,<9.8", "mkdocs-materialx[imaging]>=10.1.3,<11", + "properdocs>=1.6.7,<2", + "properdocs-theme-mkdocs>=1.6.5,<2", + "properdocs-theme-readthedocs>=1.6.5,<2", "pytest-cov>=6.9.1,<8", "validator-collection>=1.5,<1.6", ] diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..559692c 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +# redirect every mkdocs.* import to properdocs.* before any test module (or the +# plugin itself) imports MkDocs, so that only ProperDocs classes are used. +import properdocs.replacement # noqa: F401 diff --git a/tests/base.py b/tests/base.py index 4b77295..4bf2e6d 100644 --- a/tests/base.py +++ b/tests/base.py @@ -15,10 +15,10 @@ # 3rd party from click.testing import CliRunner -# MkDocs -from mkdocs.__main__ import build_command -from mkdocs.config import load_config -from mkdocs.config.base import Config +# ProperDocs +from properdocs.__main__ import build_command +from properdocs.config import load_config +from properdocs.config.base import Config # package from mkdocs_rss_plugin.plugin import GitRssPlugin @@ -78,7 +78,7 @@ def build_docs_setup( output_path: Path, strict: bool = True, ): - """Runs the `mkdocs build` command. + """Runs the `properdocs build` command. :param testproject_path: Path to test project :type testproject_path: Path @@ -138,7 +138,7 @@ def setup_clean_mkdocs_folder( # Copy correct mkdocs.yml file and our test 'docs/' shutil.copytree("tests/fixtures/docs", testproject_path / "docs") - shutil.copyfile(mkdocs_yml_filepath, testproject_path / "mkdocs.yml") + shutil.copyfile(mkdocs_yml_filepath, testproject_path / "properdocs.yml") return testproject_path @@ -174,15 +174,15 @@ def setup_clean_mkdocs_folder( import feedparser base = BaseTest() - plg_cfg = base.get_plugin_config_from_mkdocs(Path("mkdocs.yml"), "rss") + plg_cfg = base.get_plugin_config_from_mkdocs(Path("properdocs.yml"), "rss") print(type(plg_cfg)) # truc = base.setup_clean_mkdocs_folder( - # mkdocs_yml_filepath=Path("mkdocs.yml"), output_path=Path("tests/fixtures/") + # mkdocs_yml_filepath=Path("properdocs.yml"), output_path=Path("tests/fixtures/") # ) # print(truc) run_result = base.build_docs_setup( testproject_path="docs", - mkdocs_yml_filepath=Path("mkdocs.yml"), + mkdocs_yml_filepath=Path("properdocs.yml"), output_path=Path("zoubi"), ) print(type(run_result), run_result.exit_code) diff --git a/tests/test_config.py b/tests/test_config.py index 8db2ef2..c49dfea 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -19,7 +19,7 @@ from pathlib import Path # 3rd party -from mkdocs.config.base import Config +from properdocs.config.base import Config from mkdocs_rss_plugin.config import RssPluginConfig diff --git a/tests/test_integrations_material.py b/tests/test_integrations_material.py index bbf4709..8204f41 100644 --- a/tests/test_integrations_material.py +++ b/tests/test_integrations_material.py @@ -19,7 +19,7 @@ from pathlib import Path # 3rd party -from mkdocs.config import load_config +from properdocs.config import load_config # package from mkdocs_rss_plugin.integrations.theme_material_base import ( diff --git a/tests/test_integrations_material_blog.py b/tests/test_integrations_material_blog.py index a24e8ef..6fed036 100644 --- a/tests/test_integrations_material_blog.py +++ b/tests/test_integrations_material_blog.py @@ -22,7 +22,7 @@ # 3rd party import feedparser -from mkdocs.config import load_config +from properdocs.config import load_config # package from mkdocs_rss_plugin.integrations.theme_material_blog_plugin import ( diff --git a/tests/test_integrations_material_social_cards.py b/tests/test_integrations_material_social_cards.py index 5461737..97ee5a9 100644 --- a/tests/test_integrations_material_social_cards.py +++ b/tests/test_integrations_material_social_cards.py @@ -22,7 +22,7 @@ # 3rd party import feedparser -from mkdocs.config import load_config +from properdocs.config import load_config # package from mkdocs_rss_plugin.__about__ import __title_clean__ diff --git a/tests/test_rss_util.py b/tests/test_rss_util.py index b58d869..f09d165 100644 --- a/tests/test_rss_util.py +++ b/tests/test_rss_util.py @@ -116,7 +116,7 @@ def test_authors_invalid_type_logs_warning(self): page.file.abs_src_path = "docs/page.md" page.meta = {"authors": 42} - with self.assertLogs("mkdocs.plugins.[RSS-plugin]", "WARNING") as logs: + with self.assertLogs("properdocs.plugins.[RSS-plugin]", "WARNING") as logs: authors = self.plg_utils.get_authors_from_meta(in_page=page) self.assertIsNone(authors)