mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-24 09:54:31 +02:00
sqlite-utils create-table docs, plus doc unit test
Refs #27. Closes #108
This commit is contained in:
parent
36d256b047
commit
99a7906fd9
2 changed files with 36 additions and 0 deletions
22
tests/test_docs.py
Normal file
22
tests/test_docs.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from sqlite_utils import cli
|
||||
from pathlib import Path
|
||||
import pytest
|
||||
import re
|
||||
|
||||
docs_path = Path(__file__).parent.parent / "docs"
|
||||
commands_re = re.compile(r"(?:\$ | )sqlite-utils (\S+) ")
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def documented_commands():
|
||||
rst = (docs_path / "cli.rst").read_text()
|
||||
return {
|
||||
command
|
||||
for command in commands_re.findall(rst)
|
||||
if "." not in command and ":" not in command
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("command", cli.cli.commands.keys())
|
||||
def test_plugin_hooks_are_documented(documented_commands, command):
|
||||
assert command in documented_commands
|
||||
Loading…
Add table
Add a link
Reference in a new issue