Author: Yannick Jadoul <[email protected]>
Branch: py3.7-bpo-29839
Changeset: r97820:f5ea45e7bf9c
Date: 2019-10-19 01:31 +0200
http://bitbucket.org/pypy/pypy/changeset/f5ea45e7bf9c/
Log: Shortening test_builtin.py::AppTestBuiltinApp::test_len to more
specific test_len_negative_overflow
diff --git a/pypy/module/__builtin__/test/test_builtin.py
b/pypy/module/__builtin__/test/test_builtin.py
--- a/pypy/module/__builtin__/test/test_builtin.py
+++ b/pypy/module/__builtin__/test/test_builtin.py
@@ -751,26 +751,8 @@
__dict__ = property(fget=getDict)
assert vars(C_get_vars()) == {'a':2}
- def test_len(self):
+ def test_len_negative_overflow(self):
import sys
- assert len('123') == 3
- assert len(()) == 0
- assert len((1, 2, 3, 4)) == 4
- assert len([1, 2, 3, 4]) == 4
- assert len({}) == 0
- assert len({'a':1, 'b': 2}) == 2
- class BadSeq:
- def __len__(self):
- raise ValueError
- raises(ValueError, len, BadSeq())
- class InvalidLen:
- def __len__(self):
- return None
- raises(TypeError, len, InvalidLen())
- class FloatLen:
- def __len__(self):
- return 4.5
- raises(TypeError, len, FloatLen())
class NegativeLen:
def __len__(self):
return -10
@@ -783,8 +765,6 @@
def __len__(self):
return -sys.maxsize-10
raises(ValueError, len, HugeNegativeLen())
- class NoLenMethod(object): pass
- raises(TypeError, len, NoLenMethod())
class AppTestGetattr:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit