From c755f2852d8ef0a2142ba9e41197b2a6dd801d1d Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 22 Sep 2020 15:47:11 -0700 Subject: [PATCH] Docstring for sqlite-utils transform --- sqlite_utils/cli.py | 1 + tests/test_docs.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/sqlite_utils/cli.py b/sqlite_utils/cli.py index 058bf04..4fb8ebc 100644 --- a/sqlite_utils/cli.py +++ b/sqlite_utils/cli.py @@ -943,6 +943,7 @@ def transform( drop_foreign_key, sql, ): + "Transform a table beyond the capabilities of ALTER TABLE" db = sqlite_utils.Database(path) types = {} kwargs = {} diff --git a/tests/test_docs.py b/tests/test_docs.py index 3b3e4a5..1d659d1 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -20,3 +20,8 @@ def documented_commands(): @pytest.mark.parametrize("command", cli.cli.commands.keys()) def test_commands_are_documented(documented_commands, command): assert command in documented_commands + + +@pytest.mark.parametrize("command", cli.cli.commands.values()) +def test_commands_have_docstrings(command): + assert command.__doc__, '{} is missing a docstring'.format(command)