Skip to content

Commit 6d8a26f

Browse files
committed
Add a test for the default __long__ special method provided by newobject
1 parent bce10e3 commit 6d8a26f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

future/tests/test_object.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,15 @@ class H():
195195
h = H()
196196
self.assertTrue(isinstance(h, object))
197197

198+
def test_long_special_method(self):
199+
class A(object):
200+
def __int__(self):
201+
return 0
202+
a = A()
203+
self.assertEqual(int(a), 0)
204+
if utils.PY2:
205+
self.assertEqual(long(a), 0)
206+
198207

199208
if __name__ == '__main__':
200209
unittest.main()

0 commit comments

Comments
 (0)