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

Document the Datasette(..., pdb=True) testing pattern #1207

Closed
simonw opened this issue Jan 26, 2021 · 1 comment
Closed

Document the Datasette(..., pdb=True) testing pattern #1207

simonw opened this issue Jan 26, 2021 · 1 comment

Comments

@simonw
Copy link
Owner

simonw commented Jan 26, 2021

If you're writing tests for a Datasette plugin and you get a 500 error from inside Datasette, you can cause Datasette to open a PDB session within the application server code by doing this:

ds = Datasette([db_path], pdb=True)
response = await ds.client.get("/")

You'll need to run pytest -s to interact with the debugger, otherwise you'll get an error.

@simonw
Copy link
Owner Author

simonw commented Jan 29, 2021

simonw added a commit that referenced this issue Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant