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 9347735..c36f674 100644
--- a/tests/testutils.py
+++ b/tests/testutils.py
@@ -447,7 +447,6 @@ def script_to_py3(script):
class py3_raises_typeerror(object):
-
def __enter__(self):
pass
@@ -455,3 +454,18 @@ class py3_raises_typeerror(object):
if sys.version_info[0] >= 3:
assert type is TypeError
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_