Skip to content

Commit 05ece29

Browse files
authored
Fix fixture generation commands in the contributor guide (#3031)
1 parent e87e1e6 commit 05ece29

1 file changed

Lines changed: 8 additions & 13 deletions

File tree

‎docs/contributing.rst‎

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,19 @@ If you want to change Datasette's Python code you can use the ``--reload`` optio
160160
This also enables development mode for static asset cache busting, described in
161161
:ref:`customization_static_files`.
162162

163-
You can also use the ``fixtures.py`` script to recreate the testing version of ``metadata.json`` used by the unit tests. To do that::
163+
You can also use the ``fixtures.py`` script to write the configuration and metadata used by the unit tests. The configuration filename comes before the metadata filename::
164164

165-
uv run python tests/fixtures.py fixtures.db fixtures-metadata.json
165+
uv run python tests/fixtures.py fixtures.db fixtures-config.json fixtures-metadata.json --recreate
166166

167-
Or to output the plugins used by the tests, run this::
167+
The ``--recreate`` option replaces the ``fixtures.db`` created above. Omit it if you are creating a new database.
168168

169-
uv run python tests/fixtures.py fixtures.db fixtures-metadata.json fixtures-plugins
170-
Test tables written to fixtures.db
171-
- metadata written to fixtures-metadata.json
172-
Wrote plugin: fixtures-plugins/register_output_renderer.py
173-
Wrote plugin: fixtures-plugins/view_name.py
174-
Wrote plugin: fixtures-plugins/my_plugin.py
175-
Wrote plugin: fixtures-plugins/messages_output_renderer.py
176-
Wrote plugin: fixtures-plugins/my_plugin_2.py
169+
To also output the plugins used by the tests, add the plugins directory as the final argument::
177170

178-
Then run Datasette like this::
171+
uv run python tests/fixtures.py fixtures.db fixtures-config.json fixtures-metadata.json fixtures-plugins --recreate
179172

180-
uv run datasette fixtures.db -m fixtures-metadata.json --plugins-dir=fixtures-plugins/
173+
Then run Datasette with both files and the plugins directory::
174+
175+
uv run datasette fixtures.db -c fixtures-config.json -m fixtures-metadata.json --plugins-dir=fixtures-plugins/
181176

182177
.. _contributing_debugging:
183178

0 commit comments

Comments
 (0)