summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/util.py
diff options
context:
space:
mode:
authorDiana Clarke <diana.joan.clarke@gmail.com>2012-11-19 20:19:39 -0500
committerDiana Clarke <diana.joan.clarke@gmail.com>2012-11-19 20:19:39 -0500
commitffb2107703ac4f9463625ddf46adbf52c4029a98 (patch)
tree64d0306b9f556b4a10a64e74b2f966301017127a /lib/sqlalchemy/testing/util.py
parent77d5317947e1c54a25ab6c8eaf7f23bc546bd2d9 (diff)
downloadsqlalchemy-ffb2107703ac4f9463625ddf46adbf52c4029a98.tar.gz
just a pep8 pass of lib/sqlalchemy/testing/
Diffstat (limited to 'lib/sqlalchemy/testing/util.py')
-rw-r--r--lib/sqlalchemy/testing/util.py10
1 files changed, 7 insertions, 3 deletions
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])
-
-