#6026 - fix tests that failed without zlib

This commit is contained in:
Ezio Melotti 2009-09-12 14:43:43 +00:00
parent 21121e64b4
commit 1036a7f7e1
7 changed files with 51 additions and 6 deletions

View file

@ -21,9 +21,14 @@
# misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
import zlib, datetime
import datetime
import unittest
import sqlite3 as sqlite
try:
import zlib
except ImportError:
zlib = None
class SqliteTypeTests(unittest.TestCase):
def setUp(self):
@ -300,6 +305,7 @@ class ObjectAdaptationTests(unittest.TestCase):
val = self.cur.fetchone()[0]
self.assertEqual(type(val), float)
@unittest.skipUnless(zlib, "requires zlib")
class BinaryConverterTests(unittest.TestCase):
def convert(s):
return zlib.decompress(s)