module documentation

Undocumented

Class adict Dict keys available as attributes. Shadows.
Class ​Random​Set Undocumented
Function all​_partial​_orderings Undocumented
Function conforms​_partial​_ordering True if the given sorting conforms to the given partial ordering.
Function drop​_all​_tables Undocumented
Function drop​_all​_tables​_from​_metadata Undocumented
Function fail Undocumented
Function flag​_combinations A facade around @testing.combinations() oriented towards boolean keyword-based arguments.
Function force​_drop​_names Force the given table names to be dropped after test complete, isolating for foreign key cycles
Function function​_named Return a function with a given __name__.
Function lambda​_combinations Undocumented
Function metadata​_fixture Provide MetaData for a pytest fixture.
Function non​_refcount​_gc​_collect Undocumented
Function picklers Undocumented
Function provide​_metadata Provide bound MetaData for a single test, dropping afterwards.
Function random​_choices Undocumented
Function resolve​_lambda Given a no-arg lambda and a namespace, return a new lambda that has all the values filled in.
Function round​_decimal Undocumented
Function rowset Converts the results of sql execution into a plain set of column tuples.
Function run​_as​_contextmanager Run the given function under the given contextmanager, simulating the behavior of 'with' to support older Python versions.
Function teardown​_events Undocumented
def all_partial_orderings(tuples, elements):

Undocumented

def conforms_partial_ordering(tuples, sorted_elements):
True if the given sorting conforms to the given partial ordering.
def drop_all_tables(engine, inspector, schema=None, include_names=None):

Undocumented

def drop_all_tables_from_metadata(metadata, engine_or_connection):

Undocumented

def fail(msg):

Undocumented

def flag_combinations(*combinations):

A facade around @testing.combinations() oriented towards boolean keyword-based arguments.

Basically generates a nice looking identifier based on the keywords and also sets up the argument names.

E.g.:

@testing.flag_combinations(
    dict(lazy=False, passive=False),
    dict(lazy=True, passive=False),
    dict(lazy=False, passive=True),
    dict(lazy=False, passive=True, raiseload=True),
)

would result in:

@testing.combinations(
    ('', False, False, False),
    ('lazy', True, False, False),
    ('lazy_passive', True, True, False),
    ('lazy_passive', True, True, True),
    id_='iaaa',
    argnames='lazy,passive,raiseload'
)
def force_drop_names(*names):
Force the given table names to be dropped after test complete, isolating for foreign key cycles
def function_named(fn, name):

Return a function with a given __name__.

Will assign to __name__ and return the original function if possible on the Python implementation, otherwise a new function will be constructed.

This function should be phased out as much as possible in favor of @decorator. Tests that "generate" many named tests should be modernized.

def lambda_combinations(lambda_arg_sets, **kw):

Undocumented

def metadata_fixture(ddl='function'):
Provide MetaData for a pytest fixture.
def non_refcount_gc_collect(*args):

Undocumented

def picklers():

Undocumented

@decorator
def provide_metadata(fn, *args, **kw):

Provide bound MetaData for a single test, dropping afterwards.

Legacy; use the "metadata" pytest fixture.

def random_choices(population, k=1):

Undocumented

def resolve_lambda(__fn, **kw):

Given a no-arg lambda and a namespace, return a new lambda that has all the values filled in.

This is used so that we can have module-level fixtures that refer to instance-level variables using lambdas.

def round_decimal(value, prec):

Undocumented

def rowset(results):

Converts the results of sql execution into a plain set of column tuples.

Useful for asserting the results of an unordered query.

def run_as_contextmanager(ctx, fn, *arg, **kw):

Run the given function under the given contextmanager, simulating the behavior of 'with' to support older Python versions.

This is not necessary anymore as we have placed 2.6 as minimum Python version, however some tests are still using this structure.

def teardown_events(event_cls):

Undocumented