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

--get doesn't fully invoke the startup routine #934

Closed
simonw opened this issue Aug 15, 2020 · 0 comments
Closed

--get doesn't fully invoke the startup routine #934

simonw opened this issue Aug 15, 2020 · 0 comments
Labels

Comments

@simonw
Copy link
Owner

simonw commented Aug 15, 2020

datasette/datasette/cli.py

Lines 417 to 433 in 7702ea6

ds = Datasette(files, **kwargs)
if get:
client = TestClient(ds.app())
response = client.get(get)
click.echo(response.text)
return
if return_instance:
# Private utility mechanism for writing unit tests
return ds
# Run the "startup" plugin hooks
asyncio.get_event_loop().run_until_complete(ds.invoke_startup())
# Run async sanity checks - but only if we're not under pytest
asyncio.get_event_loop().run_until_complete(check_databases(ds))

Spotted this working on simonw/latest-datasette-with-all-plugins#3 - I'd like to be able to use datasette --get / as a sanity checking test, but that doesn't work if the init hooks aren't fully executed.

@simonw simonw transferred this issue from simonw/latest-datasette-with-all-plugins Aug 15, 2020
@simonw simonw added the bug label Aug 15, 2020
@simonw simonw closed this as completed in 45414f8 Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant