mirror of
https://github.com/simonw/datasette.git
synced 2026-11-25 11:29:43 +01:00
Pytest auto-close plugin for Datasette instances
Installs a pytest11 entry point so that every Datasette() constructed inside a pytest_runtest_call phase is auto-closed at the end of the test. Fixture-scoped instances are untouched. Opt out via the datasette_autoclose = false ini option. This gives large test suites a safety net against FD exhaustion and leaked write threads from the now-default temp-disk internal database without requiring every existing test to be rewritten. Refs #2692 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d72dd35378
commit
34cc320eab
4 changed files with 190 additions and 0 deletions
|
|
@ -54,6 +54,9 @@ CI = "https://github.com/simonw/datasette/actions?query=workflow%3ATest"
|
|||
[project.scripts]
|
||||
datasette = "datasette.cli:cli"
|
||||
|
||||
[project.entry-points.pytest11]
|
||||
datasette = "datasette._pytest_plugin"
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pytest>=9",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue