module documentation

Undocumented

Constant ENABLE_ASYNCIO Undocumented
Function _assume_async Run a function in an asyncio loop unconditionally.
Function _maybe_async Run a function in an asyncio loop if the current selected driver is async.
Function _maybe_async_provisioning Run a function in an asyncio loop if any current drivers might need it.
Function _maybe_async_wrapper Apply the _maybe_async function to an existing function and return as a wrapped callable, supporting generator functions as well.
Function _run_coroutine_function Undocumented
ENABLE_ASYNCIO: bool = (source)

Undocumented

Value
True
def _assume_async(fn, *args, **kwargs): (source)

Run a function in an asyncio loop unconditionally. This function is used for provisioning features like testing a database connection for server info. Note that for blocking IO database drivers, this means they block the event loop.

def _maybe_async(fn, *args, **kwargs): (source)

Run a function in an asyncio loop if the current selected driver is async. This function is used for test setup/teardown and tests themselves where the current DB driver is known.

def _maybe_async_provisioning(fn, *args, **kwargs): (source)

Run a function in an asyncio loop if any current drivers might need it. This function is used for provisioning features that take place outside of a specific database driver being selected, so if the current driver that happens to be used for the provisioning operation is an async driver, it will run in asyncio and not fail. Note that for blocking IO database drivers, this means they block the event loop.

def _maybe_async_wrapper(fn): (source)

Apply the _maybe_async function to an existing function and return as a wrapped callable, supporting generator functions as well. This is currently used for pytest fixtures that support generator use.

def _run_coroutine_function(fn, *args, **kwargs): (source)

Undocumented