From 9b81eb1af5b1cd52c7930768b0dfab6648bdd7ce Mon Sep 17 00:00:00 2001 From: "Y.D.X" <73375426+YDX-2147483647@users.noreply.github.com> Date: Thu, 23 Mar 2023 22:56:47 +0800 Subject: [PATCH] Replace `test_simple_build` with a new `mkdocs_simple.yml` `/mkdocs.yml` requires theme and plugins in `requirements/documentation.txt`, and `test_simple_build` will fail if they're not installed. The commit removes those dependencies and turns it into `tests/fixtures/mkdocs_simple.yml`. --- README.md | 2 -- tests/fixtures/mkdocs_simple.yml | 51 ++++++++++++++++++++++++++++++++ tests/test_build.py | 2 +- 3 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/mkdocs_simple.yml diff --git a/README.md b/README.md index ca6529f8..eaf23c3f 100644 --- a/README.md +++ b/README.md @@ -80,8 +80,6 @@ pre-commit install # run tests pytest -# note that some tests are for documentation, -# so they'll fail without requirements/documentation.txt. # install dependencies for documentation python -m pip install -U -r requirements/documentation.txt diff --git a/tests/fixtures/mkdocs_simple.yml b/tests/fixtures/mkdocs_simple.yml new file mode 100644 index 00000000..770cc750 --- /dev/null +++ b/tests/fixtures/mkdocs_simple.yml @@ -0,0 +1,51 @@ +# Project information +site_name: MkDocs RSS Plugin +site_description: Documentation about the MkDocs RSS Plugin +site_author: dev@ingeoveritas.com (Julien M.) +site_url: https://guts.github.io/mkdocs-rss-plugin/ +copyright: "Guts - In Geo Veritas" + +# Repository +repo_name: "guts/mkdocs-rss-plugin" +repo_url: "https://github.com/guts/mkdocs-rss-plugin/" +edit_uri: "blob/main/docs/" + +docs_dir: "docs/" +use_directory_urls: true + +plugins: + - rss: + date_from_meta: + as_creation: "date" + as_update: false + datetime_format: "%Y-%m-%d %H:%M" + default_timezone: "Europe/Paris" + default_time: "22:00" + abstract_chars_count: 160 + abstract_delimiter: + image: https://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Feed-icon.svg/128px-Feed-icon.svg.png + match_path: ".*" + pretty_print: false + url_parameters: + utm_source: "documentation" + utm_medium: "RSS" + utm_campaign: "feed-syndication" + - search + +theme: + name: mkdocs + language: en + +# Extensions to enhance markdown +markdown_extensions: + - admonition + - attr_list + - codehilite + - meta + - toc: + permalink: "#" + +nav: + - "Home": "index.md" + - "Settings": "configuration.md" + - "Changelog": "changelog.md" diff --git a/tests/test_build.py b/tests/test_build.py index 16c35289..675c9177 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -71,7 +71,7 @@ def test_simple_build(self): with tempfile.TemporaryDirectory() as tmpdirname: cli_result = self.build_docs_setup( testproject_path="docs", - mkdocs_yml_filepath=Path("mkdocs.yml"), + mkdocs_yml_filepath=Path("tests/fixtures/mkdocs_simple.yml"), output_path=tmpdirname, strict=False, )