summaryrefslogtreecommitdiff
path: root/tests/test_quote.py
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-11-19 03:55:37 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2010-11-19 03:55:37 +0000
commit19ead4a5cb0dcefadb604c872e9f2b93430747f6 (patch)
tree36d2cb98f1fcf5dfa018aae577dd7060c887990d /tests/test_quote.py
parent94348bfb78cc2576d586b5f1e6fde3e10c14b178 (diff)
downloadpsycopg2-19ead4a5cb0dcefadb604c872e9f2b93430747f6.tar.gz
Test cleanup.
Tests pass or fail gracefully on older PostgreSQL versions. If unittest2 is available, skip tests instead of printing warnings.
Diffstat (limited to 'tests/test_quote.py')
-rwxr-xr-xtests/test_quote.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_quote.py b/tests/test_quote.py
index 6da10fa..95c5d7a 100755
--- a/tests/test_quote.py
+++ b/tests/test_quote.py
@@ -1,6 +1,5 @@
#!/usr/bin/env python
-import unittest
-import warnings
+from testutils import unittest
import psycopg2
import psycopg2.extensions
@@ -61,9 +60,9 @@ class QuotingTestCase(unittest.TestCase):
curs.execute("SHOW server_encoding")
server_encoding = curs.fetchone()[0]
if server_encoding != "UTF8":
- warnings.warn("Unicode test skipped since server encoding is %s"
- % server_encoding)
- return
+ return self.skipTest(
+ "Unicode test skipped since server encoding is %s"
+ % server_encoding)
data = u"""some data with \t chars
to escape into, 'quotes', \u20ac euro sign and \\ a backslash too.