Open jannismain opened 4 years ago
Just guessing here but there might be a difference between your database's search paths and the default one used by the plugin?
People searching about this might be interested about the answer I provided on SO.
I managed to use TimescaleDB with pytest-postgresql
.
from pytest_postgresql import factories as ppf
postgresql_proc = ppf.postgresql_proc(
postgres_options="-c shared_preload_libraries='timescaledb'"
)
postgresql = ppf.postgresql('postgresql_proc')
@pytest.fixture
def database(postgresql):
cur = postgresql.cursor()
cur.execute("CREATE EXTENSION IF NOT EXISTS timescaledb;")
postgresql.commit()
cur.close()
yield postgresql
I have also posted my issue on StackOverflow.
I'm trying to use
pytest-pgsql
withtimescaledb
, but cannot get it setup correctly. Do you have any advice?The relevant error message is this one:
It looks like pytest-pgsql's Postgres instance cannot find timescaledb. However, I'm using it in a manually managed database on the same system just fine. According to the Troubleshooting site over at Timescale, I have verified that my test is running on the same postgresql version as the manually managed database.
Setup
timescaledb
is working in manually managed databaseConsole Output
But when I do not preload
timescaledb
, Postgresql can be started just fine. However, I get the warning thattimescaledb
must be preloaded: