Commit a278fb1c authored by Jason Madden's avatar Jason Madden

Update test_select.py for pypy since we now call the original method.

parent 2906dda0
...@@ -57,7 +57,17 @@ class SelectTestCase(unittest.TestCase): ...@@ -57,7 +57,17 @@ class SelectTestCase(unittest.TestCase):
del a[-1] del a[-1]
return sys.__stdout__.fileno() return sys.__stdout__.fileno()
a[:] = [F()] * 10 a[:] = [F()] * 10
self.assertEqual(select.select([], a, []), ([], a[:5], [])) result = select.select([], a, [])
# CPython: 'a' ends up with 5 items, because each fileno()
# removes an item and at the middle the iteration stops.
# PyPy: 'a' ends up empty, because the iteration is done on
# a copy of the original list: fileno() is called 10 times.
if test_support.check_impl_detail(cpython=True):
self.assertEqual(len(result[1]), 5)
self.assertEqual(len(a), 5)
if test_support.check_impl_detail(pypy=True):
self.assertEqual(len(result[1]), 10)
self.assertEqual(len(a), 0)
def test_main(): def test_main():
test_support.run_unittest(SelectTestCase) test_support.run_unittest(SelectTestCase)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment