bad int test snippet

This commit is contained in:
Jeong YunWon committed 2020-01-08 11:54:30 +09:00
1 parent 5d50e19432
commit bb9d09baaf
1 file changed
+7
+7
View File
@@ -273,6 +273,13 @@ class F(float):
assert int(F(1.2)) == 3
class BadInt(int):
def __int__(self):
return 42.0
with assert_raises(TypeError):
int(BadInt())
assert isinstance((0).__round__(), int)
assert isinstance((1).__round__(), int)
assert (0).__round__() == 0