Skip to content

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

Description

@simonw

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions