Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python tests/fixtures.py command has a bug #804

Closed
simonw opened this issue Jun 6, 2020 · 6 comments
Closed

python tests/fixtures.py command has a bug #804

simonw opened this issue Jun 6, 2020 · 6 comments
Labels
bug minor Minor bugs (not high priority)

Comments

@simonw
Copy link
Owner

simonw commented Jun 6, 2020

This command is meant to write out fixtures.db, metadata.json and a plugins directory:

$ python tests/fixtures.py /tmp/fixtures.db /tmp/metadata.json /tmp/plugins/
Test tables written to /tmp/fixtures.db
- metadata written to /tmp/metadata.json
Traceback (most recent call last):
  File "tests/fixtures.py", line 833, in <module>
    ("my_plugin.py", PLUGIN1),
NameError: name 'PLUGIN1' is not defined
@simonw simonw added the bug label Jun 6, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 6, 2020

I broke this in #775 446e5de

Here's the now-broken code (I removed the PLUGIN1 and PLUGIN2 constants):

datasette/tests/fixtures.py

Lines 828 to 835 in 9c563d6

if plugins_path:
path = pathlib.Path(plugins_path)
if not path.exists():
path.mkdir()
for filename, content in (
("my_plugin.py", PLUGIN1),
("my_plugin_2.py", PLUGIN2),
):

@simonw
Copy link
Owner Author

simonw commented Jun 6, 2020

I should replace the bodged-together argument passing with Click while I'm fixing this.

@simonw simonw added the minor Minor bugs (not high priority) label Jun 6, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 6, 2020

I don't think this is fully documented either. Current partial documentation is on https://datasette.readthedocs.io/en/stable/contributing.html

@simonw simonw modified the milestones: Datasette 1.0, Datasette 0.44 Jun 6, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 9, 2020

Switched to 0.44 milestone because I don't like shipping releases with known bugs.

@simonw simonw closed this as completed in f240970 Jun 9, 2020
@simonw
Copy link
Owner Author

simonw commented Jun 9, 2020

$ python tests/fixtures.py fixtures.db fixtures-metadata.json fixtures-plugins
Test tables written to fixtures.db
- metadata written to fixtures-metadata.json
Wrote plugin: fixtures-plugins/register_output_renderer.py
Wrote plugin: fixtures-plugins/view_name.py
Wrote plugin: fixtures-plugins/my_plugin.py
Wrote plugin: fixtures-plugins/messages_output_renderer.py
Wrote plugin: fixtures-plugins/my_plugin_2.py

@simonw
Copy link
Owner Author

simonw commented Jun 9, 2020

simonw added a commit that referenced this issue Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug minor Minor bugs (not high priority)
Projects
None yet
Development

No branches or pull requests

1 participant