Test that ensures all config options are documented

columns
Simon Willison 2018-05-26 15:11:04 -07:00
rodzic 08029a2f8f
commit a6afc21aba
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 17E2DEA2588B7F52
1 zmienionych plików z 16 dodań i 0 usunięć

16
tests/test_docs.py 100644
Wyświetl plik

@ -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