mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-29 12:24:32 +02:00
Refactored sqlite-utils insert tests into test_cli_insert.py
This commit is contained in:
parent
9e286cc6d2
commit
d1ed2f423d
3 changed files with 338 additions and 334 deletions
|
|
@ -1,6 +1,12 @@
|
|||
from sqlite_utils import Database
|
||||
from sqlite_utils.utils import sqlite3
|
||||
import pytest
|
||||
|
||||
CREATE_TABLES = """
|
||||
create table Gosh (c1 text, c2 text, c3 text);
|
||||
create table Gosh2 (c1 text, c2 text, c3 text);
|
||||
"""
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fresh_db():
|
||||
|
|
@ -19,3 +25,11 @@ def existing_db():
|
|||
"""
|
||||
)
|
||||
return database
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def db_path(tmpdir):
|
||||
path = str(tmpdir / "test.db")
|
||||
db = sqlite3.connect(path)
|
||||
db.executescript(CREATE_TABLES)
|
||||
return path
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue