summaryrefslogtreecommitdiff
path: root/tests/test_copy.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_copy.py')
-rw-r--r--tests/test_copy.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/test_copy.py b/tests/test_copy.py
index 19fabe1..b0d9965 100644
--- a/tests/test_copy.py
+++ b/tests/test_copy.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
import os
import string
-import unittest
+from testutils import unittest, decorate_all_tests
from cStringIO import StringIO
from itertools import cycle, izip
@@ -9,6 +9,15 @@ import psycopg2
import psycopg2.extensions
import tests
+def skip_if_green(f):
+ def skip_if_green_(self):
+ if tests.green:
+ return self.skipTest("copy in async mode currently not supported")
+ else:
+ return f(self)
+
+ return skip_if_green_
+
class MinimalRead(object):
"""A file wrapper exposing the minimal interface to copy from."""
@@ -29,6 +38,7 @@ class MinimalWrite(object):
def write(self, data):
return self.f.write(data)
+
class CopyTests(unittest.TestCase):
def setUp(self):
@@ -124,6 +134,9 @@ class CopyTests(unittest.TestCase):
self.assertEqual(ntests, len(string.letters))
+decorate_all_tests(CopyTests, skip_if_green)
+
+
def test_suite():
return unittest.TestLoader().loadTestsFromName(__name__)