MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / is_preferred_driver

Function is_preferred_driver

lib/sqlalchemy/testing/provision.py:214–227  ·  view source on GitHub ↗

Return True if the engine's URL is on the "default" driver, or more generally the "preferred" driver to use for tests. Backends can override this to make a different driver the "prefeferred" driver that's not the default.

(cfg, engine)

Source from the content-addressed store, hash-verified

212
213@register.init
214def is_preferred_driver(cfg, engine):
215 """Return True if the engine's URL is on the "default" driver, or
216 more generally the "preferred" driver to use for tests.
217
218 Backends can override this to make a different driver the "prefeferred"
219 driver that's not the default.
220
221 """
222 return (
223 engine.url._get_entrypoint()
224 is engine.url.set(
225 drivername=engine.url.get_backend_name()
226 )._get_entrypoint()
227 )
228
229
230@register.init

Callers

nothing calls this directly

Calls 3

get_backend_nameMethod · 0.80
_get_entrypointMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected