summaryrefslogtreecommitdiff
path: root/tests/testutils.py
diff options
context:
space:
mode:
authorChris Withers <chris@simplistix.co.uk>2014-02-18 20:55:00 +0000
committerChris Withers <chris@simplistix.co.uk>2014-02-18 20:55:00 +0000
commite60266c4c5273807f3a097b4a10c437f0ce079c5 (patch)
tree1dba32c2661d02760cb9e940097df086adad4d9a /tests/testutils.py
parentbae508ffa65dae9d99ccb9e4acd6c47109a9d3a6 (diff)
downloadpsycopg2-e60266c4c5273807f3a097b4a10c437f0ce079c5.tar.gz
New implementation of Range sorting that works for Python 2.5 to 3.3, at least.
Diffstat (limited to 'tests/testutils.py')
-rw-r--r--tests/testutils.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index 708dd22..0569ede 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -329,3 +329,13 @@ def script_to_py3(script):
f2.close()
os.remove(filename)
+class py3_raises_typeerror(object):
+
+ def __enter__(self):
+ pass
+
+ def __exit__(self, type, exc, tb):
+ if sys.version_info[0] >= 3:
+ assert type is TypeError
+ return True
+