summaryrefslogtreecommitdiff
path: root/test/testlib/compat.py
diff options
context:
space:
mode:
authorJason Kirtland <jek@discorporate.us>2008-04-03 17:08:08 +0000
committerJason Kirtland <jek@discorporate.us>2008-04-03 17:08:08 +0000
commitd78f39d0057bbc648a9af31d7bd3ead2895ee178 (patch)
tree62877dffe613060d8963438f29480693dee9e9bd /test/testlib/compat.py
parentca1ad4cbb9af8a45da550ba07c476f8cac17cd7a (diff)
downloadsqlalchemy-d78f39d0057bbc648a9af31d7bd3ead2895ee178.tar.gz
- Experimental: prefer cProfile over hotspot for 2.5+
- The latest skirmish in the battle against zoomark and sanity: 3rd party code is factored out in the function call count canary tests
Diffstat (limited to 'test/testlib/compat.py')
-rw-r--r--test/testlib/compat.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/testlib/compat.py b/test/testlib/compat.py
index 4f2006afd..ba12b78ac 100644
--- a/test/testlib/compat.py
+++ b/test/testlib/compat.py
@@ -1,6 +1,6 @@
import itertools, new, sys, warnings
-__all__ = 'set', 'frozenset', 'sorted', '_function_named'
+__all__ = 'set', 'frozenset', 'sorted', '_function_named', 'deque'
try:
set = set
@@ -68,6 +68,20 @@ except NameError:
l.sort()
return l
+try:
+ from collections import deque
+except ImportError:
+ class deque(list):
+ def appendleft(self, x):
+ self.insert(0, x)
+ def popleft(self):
+ return self.pop(0)
+ def extendleft(self, iterable):
+ items = list(iterable)
+ items.reverse()
+ for x in items:
+ self.insert(0, x)
+
def _function_named(fn, newname):
try:
fn.__name__ = newname