Undocumented
Class | register |
Undocumented |
Function | configure |
Create dialect-specific config settings for a follower database. |
Function | create |
Dynamically create a database for testing. |
Function | create |
Undocumented |
Function | drop |
Undocumented |
Function | drop |
Undocumented |
Function | drop |
Undocumented |
Function | drop |
Drop a database that we dynamically created for testing. |
Function | drop |
Undocumented |
Function | drop |
Undocumented |
Function | drop |
Undocumented |
Function | follower |
Create a connection URL for a dynamically-created test database. |
Function | generate |
Generate a set of URLs to test given configured URLs plus additional driver names. |
Function | generate |
Undocumented |
Function | get |
Specify table name for creating a temporary Table. |
Function | normalize |
Normalize sequence parameters for dialect that don't start with 1 by default. |
Function | post |
Perform extra steps after configuring an engine for testing. |
Function | prepare |
Undocumented |
Function | reap |
Undocumented |
Function | run |
Remove databases that were created during the test process, after the process has ended. |
Function | set |
Undocumented |
Function | setup |
Undocumented |
Function | stop |
Undocumented |
Function | temp |
Specify keyword arguments for creating a temporary Table. |
Function | update |
Set database options (db_opts) for a test database that we created. |
Function | upsert |
return the backends insert..on conflict / on dupe etc. construct. |
Constant | FOLLOWER |
Undocumented |
Variable | log |
Undocumented |
Function | _adapt |
Undocumented |
Function | _configs |
Undocumented |
Function | _generate |
Undocumented |
Dynamically create a database for testing. Used when a test run will employ multiple processes, e.g., when run via `tox` or `pytest -n4`.
Create a connection URL for a dynamically-created test database. :param url: the connection URL specified when the test run was invoked :param ident: the pytest-xdist "worker identifier" to be used as the database name
Generate a set of URLs to test given configured URLs plus additional driver names. Given:: --dburi postgresql://db1 --dburi postgresql://db2 --dburi postgresql://db2 --dbdriver=psycopg2 --dbdriver=asyncpg?async_fallback=true Noting that the default postgresql driver is psycopg2, the output would be:: postgresql+psycopg2://db1 postgresql+asyncpg://db1 postgresql+psycopg2://db2 postgresql+psycopg2://db3 That is, for the driver in a --dburi, we want to keep that and use that driver for each URL it's part of . For a driver that is only in --dbdrivers, we want to use it just once for one of the URLs. for a driver that is both coming from --dburi as well as --dbdrivers, we want to keep it in that dburi. Driver specific query options can be specified by added them to the driver name. For example, to enable the async fallback option for asyncpg:: --dburi postgresql://db1 --dbdriver=asyncpg?async_fallback=true
Specify table name for creating a temporary Table. Dialect-specific implementations of this method will return the name to use when creating a temporary table for testing, e.g., in the define_temp_tables method of the ComponentReflectionTest class in suite/test_reflection.py Default to just the base name since that's what most dialects will use. The mssql dialect's implementation will need a "#" prepended.
Normalize sequence parameters for dialect that don't start with 1 by default. The default implementation does nothing
Perform extra steps after configuring an engine for testing. (For the internal dialects, currently only used by sqlite, oracle)
Remove databases that were created during the test process, after the process has ended. This is an optional step that is invoked for certain backends that do not reliably release locks on the database as long as a process is still in use. For the internal dialects, this is currently only necessary for mssql and oracle.
Specify keyword arguments for creating a temporary Table. Dialect-specific implementations of this method will return the kwargs that are passed to the Table method when creating a temporary table for testing, e.g., in the define_temp_tables method of the ComponentReflectionTest class in suite/test_reflection.py
def update_db_opts(db_url, db_opts, options): (source) ¶
Set database options (db_opts) for a test database that we created.
return the backends insert..on conflict / on dupe etc. construct. while we should add a backend-neutral upsert construct as well, such as insert().upsert(), it's important that we continue to test the backend-specific insert() constructs since if we do implement insert().upsert(), that would be using a different codepath for the things we need to test like insertmanyvalues, etc.