mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-30 22:14:22 +02:00
Moved fixtures into conftest.py
This commit is contained in:
parent
02862be04c
commit
fcc38b9ff2
4 changed files with 0 additions and 5 deletions
22
tests/conftest.py
Normal file
22
tests/conftest.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from sqlite_utils import Database
|
||||
import sqlite3
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def fresh_db():
|
||||
return Database(sqlite3.connect(":memory:"))
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def existing_db():
|
||||
database = Database(sqlite3.connect(":memory:"))
|
||||
database.conn.executescript(
|
||||
"""
|
||||
CREATE TABLE foo (text TEXT);
|
||||
INSERT INTO foo (text) values ("one");
|
||||
INSERT INTO foo (text) values ("two");
|
||||
INSERT INTO foo (text) values ("three");
|
||||
"""
|
||||
)
|
||||
return database
|
||||
Loading…
Add table
Add a link
Reference in a new issue