From ffb2107703ac4f9463625ddf46adbf52c4029a98 Mon Sep 17 00:00:00 2001 From: Diana Clarke Date: Mon, 19 Nov 2012 20:19:39 -0500 Subject: just a pep8 pass of lib/sqlalchemy/testing/ --- lib/sqlalchemy/testing/util.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/sqlalchemy/testing/util.py') diff --git a/lib/sqlalchemy/testing/util.py b/lib/sqlalchemy/testing/util.py index 41b0a30b3..2592c341e 100644 --- a/lib/sqlalchemy/testing/util.py +++ b/lib/sqlalchemy/testing/util.py @@ -26,9 +26,11 @@ elif pypy: else: # assume CPython - straight gc.collect, lazy_gc() is a pass gc_collect = gc.collect + def lazy_gc(): pass + def picklers(): picklers = set() # Py2K @@ -56,6 +58,7 @@ def round_decimal(value, prec): ).to_integral(decimal.ROUND_FLOOR) / \ pow(10, prec) + class RandomSet(set): def __iter__(self): l = list(set.__iter__(self)) @@ -80,6 +83,7 @@ class RandomSet(set): def copy(self): return RandomSet(self) + def conforms_partial_ordering(tuples, sorted_elements): """True if the given sorting conforms to the given partial ordering.""" @@ -93,6 +97,7 @@ def conforms_partial_ordering(tuples, sorted_elements): else: return True + def all_partial_orderings(tuples, elements): edges = defaultdict(set) for parent, child in tuples: @@ -131,7 +136,6 @@ def function_named(fn, name): return fn - def run_as_contextmanager(ctx, fn, *arg, **kw): """Run the given function under the given contextmanager, simulating the behavior of 'with' to support older @@ -152,6 +156,7 @@ def run_as_contextmanager(ctx, fn, *arg, **kw): else: return raise_ + def rowset(results): """Converts the results of sql execution into a plain set of column tuples. @@ -182,6 +187,7 @@ def provide_metadata(fn, *args, **kw): metadata.drop_all() self.metadata = prev_meta + class adict(dict): """Dict keys available as attributes. Shadows.""" def __getattribute__(self, key): @@ -192,5 +198,3 @@ class adict(dict): def get_all(self, *keys): return tuple([self[key] for key in keys]) - - -- cgit v1.2.1