module documentation

Undocumented

Class adict Dict keys available as attributes. Shadows.
Class RandomSet Undocumented
Function all_partial_orderings Undocumented
Function conforms_partial_ordering True if the given sorting conforms to the given partial ordering.
Function count_cache_key_tuples given a cache key tuple, counts how many instances of actual tuples are found.
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
Function total_size Returns the approximate memory footprint an object and all of its contents.
def all_partial_orderings(tuples, elements): (source)

Undocumented

def conforms_partial_ordering(tuples, sorted_elements): (source)

True if the given sorting conforms to the given partial ordering.

def count_cache_key_tuples(tup): (source)

given a cache key tuple, counts how many instances of actual tuples are found. used to alert large jumps in cache key complexity.

def drop_all_tables(engine, inspector, schema=None, consider_schemas=(None), include_names=None): (source)

Undocumented

def drop_all_tables_from_metadata(metadata, engine_or_connection): (source)

Undocumented

def fail(msg): (source)

Undocumented

def flag_combinations(*combinations): (source)

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): (source)

Force the given table names to be dropped after test complete, isolating for foreign key cycles

def function_named(fn, name): (source)

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): (source)

Undocumented

def metadata_fixture(ddl='function'): (source)

Provide MetaData for a pytest fixture.

def non_refcount_gc_collect(*args): (source)

Undocumented

def picklers(): (source)

Undocumented

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

Provide bound MetaData for a single test, dropping afterwards. Legacy; use the "metadata" pytest fixture.

def random_choices(population, k=1): (source)

Undocumented

def resolve_lambda(__fn, **kw): (source)

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): (source)

Undocumented

def rowset(results): (source)

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): (source)

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): (source)

Undocumented

def total_size(o): (source)

Returns the approximate memory footprint an object and all of its contents. source: https://code.activestate.com/recipes/577504/