Skip to content

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

@simonw

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions