> sqlhub.processConnection = connectionForURI(db_connection)
> sqlhub.threadConnection = connectionForURI(db_connection)
> hub.processConnection = connectionForURI(db_connection)
> hub.threadConnection = connectionForURI(db_connection)
> database.set_db_uri(db_connection)

I assume that set_db_uri makes AutoConnectHub instances use that URI,
but just in case, try this (assuming db_connection is your URI):

hub = AutoConnectHub(db_connection)

Then set _connection (or however you want to do it) in your classes to
hub.

If your unit tests don't automatically pick up the connection then, try
setting:

sqlhub.threadConnection = hub.getConnection()

Or passing in a connection explicitly in your unit tests:

Table.select(connection=hub.getConnection())

Reply via email to