summaryrefslogtreecommitdiff
path: root/tests/testutils.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testutils.py')
-rw-r--r--tests/testutils.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/testutils.py b/tests/testutils.py
index 69dfe85..f1c93de 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -451,7 +451,6 @@ def script_to_py3(script):
class py3_raises_typeerror(object):
-
def __enter__(self):
pass
@@ -461,5 +460,20 @@ class py3_raises_typeerror(object):
return True
+def slow(f):
+ """Decorator to mark slow tests we may want to skip
+
+ Note: in order to find slow tests you can run:
+
+ make check 2>&1 | ts -i "%.s" | sort -n
+ """
+ @wraps(f)
+ def slow_(self):
+ if os.environ.get('PSYCOPG2_TEST_FAST'):
+ return self.skipTest("slow test")
+ return f(self)
+ return slow_
+
+
def assertDsnEqual(testsuite, dsn1, dsn2):
testsuite.assertEqual(set(dsn1.split()), set(dsn2.split()))