add test cases

This commit is contained in:
blueloveTH 2025-04-01 17:29:24 +08:00
parent 71daaf7592
commit 0443cbcb16
2 changed files with 22 additions and 2 deletions

View File

@ -42,4 +42,10 @@ from math import (
pow,
sin,
cos
)
)
# test reload (dummy)
import importlib
importlib.reload(test2.a)
assert __import__('math').pi > 3

View File

@ -172,13 +172,22 @@ class A:
def __call__(self):
pass
@staticmethod
def staticmethod():
pass
@classmethod
def classmethod(cls):
pass
assert callable(A) is True # type
assert callable(A()) is True # instance with __call__
assert callable(A.__call__) is True # bound method
assert callable(A.__init__) is True # bound method
assert callable(print) is True # builtin function
assert callable(isinstance) is True # builtin function
assert callable(A.staticmethod) is True # staticmethod
assert callable(A.classmethod) is True # classmethod
assert id(0) is None
assert id(2**62) is None
@ -241,3 +250,8 @@ assert min([
assert min(1, 2) == 1
assert max(1, 2) == 2
def fn(): pass
assert repr(fn).startswith('<function fn at')
assert repr(round) == '<nativefunc object>'