Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r60437:c8fd4e300ee3
Date: 2013-01-24 16:54 -0800
http://bitbucket.org/pypy/pypy/changeset/c8fd4e300ee3/

Log:    apply pep 424 workarounds from 2.7

diff --git a/lib-python/3.2/test/test_iterlen.py 
b/lib-python/3.2/test/test_iterlen.py
--- a/lib-python/3.2/test/test_iterlen.py
+++ b/lib-python/3.2/test/test_iterlen.py
@@ -94,7 +94,11 @@
 
     def test_no_len_for_infinite_repeat(self):
         # The repeat() object can also be infinite
-        self.assertRaises(TypeError, len, repeat(None))
+        if support.check_impl_detail(pypy=True):
+            # 3.4 (PEP 424) behavior
+            self.assertEqual(len(repeat(None)), NotImplemented)
+        else:
+            self.assertRaises(TypeError, len, repeat(None))
 
 class TestXrange(TestInvariantWithoutMutations):
 
@@ -224,6 +228,7 @@
         self.assertRaises(RuntimeError, b.extend, BadLen())
         self.assertRaises(RuntimeError, b.extend, BadLengthHint())
 
+    @support.impl_detail("PEP 424 disallows None results", pypy=False)
     def test_invalid_hint(self):
         # Make sure an invalid result doesn't muck-up the works
         self.assertEqual(list(NoneLengthHint()), list(range(10)))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to