Commit 18fc655d authored by Aurélien Campéas's avatar Aurélien Campéas
Browse files

conftest: use the pytest_sa_pg engine fixture builder

parent 6ddf400c4ed3
from time import time
from pathlib import Path
import logging
from sqlalchemy import create_engine, MetaData
from sqlalchemy import MetaData
import pandas as pd
import pytest
from pytest_sa_pg.fixture import db
from pytest_sa_pg.fixture import engine_fixture
from tshistory import schema, tsio
......@@ -18,13 +17,11 @@ schema.L.addHandler(logging.StreamHandler())
tsio.L.addHandler(logging.StreamHandler())
@pytest.fixture(scope='session')
def engine(request):
port = 5433
db.setup_local_pg_cluster(request, DATADIR, port)
uri = 'postgresql://localhost:{}/postgres'.format(port)
e = create_engine(uri)
yield e
engine = engine_fixture(schema.meta, DATADIR, 5433,
# callback does nothing because we do the job
# in the other fixtures
lambda e, m: None
)
@pytest.fixture(params=['tsh', 'zzz'],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment