mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Added zip, map, filter to future_bultins (#2171)
This commit is contained in:
parent
fbe7c55905
commit
2724ab99c8
4 changed files with 49 additions and 4 deletions
|
@ -1,7 +1,8 @@
|
|||
import test.test_support, unittest
|
||||
|
||||
# we're testing the behavior of these future builtins:
|
||||
from future_builtins import hex, oct
|
||||
from future_builtins import hex, oct, map, zip, filter
|
||||
from test import test_support
|
||||
|
||||
class BuiltinTest(unittest.TestCase):
|
||||
def test_hex(self):
|
||||
|
@ -20,6 +21,17 @@ class BuiltinTest(unittest.TestCase):
|
|||
self.assertEqual(oct(-100L), '-0o144')
|
||||
self.assertRaises(TypeError, oct, ())
|
||||
|
||||
def test_itertools(self):
|
||||
from itertools import imap, izip, ifilter
|
||||
# We will assume that the itertools functions work, so provided
|
||||
# that we've got identical coppies, we will work!
|
||||
self.assertEqual(map, imap)
|
||||
self.assertEqual(zip, izip)
|
||||
self.assertEqual(filter, ifilter)
|
||||
# Testing that filter(None, stuff) raises a warning lives in
|
||||
# test_py3kwarn.py
|
||||
|
||||
|
||||
def test_main(verbose=None):
|
||||
test.test_support.run_unittest(BuiltinTest)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue