[pypy-commit] pypy py3k: adapt 4e6dddc6d1ed & 688d9d295fc2 to py3
pjenvey
noreply at buildbot.pypy.org
Fri Oct 17 01:52:12 CEST 2014
Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r73982:6da0c1a2109a
Date: 2014-10-16 16:50 -0700
http://bitbucket.org/pypy/pypy/changeset/6da0c1a2109a/
Log: adapt 4e6dddc6d1ed & 688d9d295fc2 to py3
diff --git a/lib-python/3/test/test_select.py b/lib-python/3/test/test_select.py
--- a/lib-python/3/test/test_select.py
+++ b/lib-python/3/test/test_select.py
@@ -57,7 +57,17 @@
del a[-1]
return sys.__stdout__.fileno()
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 support.check_impl_detail(cpython=True):
+ self.assertEqual(len(result[1]), 5)
+ self.assertEqual(len(a), 5)
+ if support.check_impl_detail(pypy=True):
+ self.assertEqual(len(result[1]), 10)
+ self.assertEqual(len(a), 0)
def test_main():
support.run_unittest(SelectTestCase)
More information about the pypy-commit
mailing list