From a6afc21aba50e84ae5ca4dc7c899dfd6fd1619d9 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Sat, 26 May 2018 15:11:04 -0700 Subject: [PATCH] Test that ensures all config options are documented --- tests/test_docs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/test_docs.py diff --git a/tests/test_docs.py b/tests/test_docs.py new file mode 100644 index 00000000..6f7d0b4c --- /dev/null +++ b/tests/test_docs.py @@ -0,0 +1,16 @@ +""" +Tests to ensure certain things are documented. +""" +from datasette import app +from pathlib import Path +import pytest +import re + +markdown = (Path(__file__).parent.parent / 'docs' / 'config.rst').open().read() +setting_heading_re = re.compile(r'(\w+)\n\-+\n') +setting_headings = set(setting_heading_re.findall(markdown)) + + +@pytest.mark.parametrize('config', app.CONFIG_OPTIONS) +def test_config_options_are_documented(config): + assert config.name in setting_headings