mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-24 19:04:12 +02:00
Fix all remaining resource warnings, refs #693
https://gistpreview.github.io/?0bb8e869b82f6ff0db647de755182502
This commit is contained in:
parent
77359bea30
commit
dc9947a5e1
7 changed files with 110 additions and 61 deletions
|
|
@ -2,6 +2,14 @@ from sqlite_utils.db import Index, View, Database, XIndex, XIndexColumn
|
|||
import pytest
|
||||
|
||||
|
||||
def _check_supports_strict():
|
||||
"""Check if SQLite supports strict tables without leaking the database."""
|
||||
db = Database(memory=True)
|
||||
result = db.supports_strict
|
||||
db.close()
|
||||
return result
|
||||
|
||||
|
||||
def test_table_names(existing_db):
|
||||
assert ["foo"] == existing_db.table_names()
|
||||
|
||||
|
|
@ -282,7 +290,7 @@ def test_use_rowid(fresh_db):
|
|||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
not Database(memory=True).supports_strict,
|
||||
not _check_supports_strict(),
|
||||
reason="Needs SQLite version that supports strict",
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue