mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
#6026 - fix tests that failed without zlib
This commit is contained in:
parent
21121e64b4
commit
1036a7f7e1
7 changed files with 51 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue