mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Add extra_test
This commit is contained in:
1 parent
70812eb880
commit
c39c745275
1 file changed
+31
@@ -0,0 +1,31 @@
|
||||
from asyncio import sleep
|
||||
|
||||
def f():
|
||||
def g():
|
||||
return 1
|
||||
|
||||
assert g.__code__.co_consts[0] == None
|
||||
return 2
|
||||
|
||||
assert f.__code__.co_consts[0] == None
|
||||
|
||||
def generator():
|
||||
yield 1
|
||||
yield 2
|
||||
|
||||
assert generator().gi_code.co_consts[0] == None
|
||||
|
||||
async def async_f():
|
||||
await sleep(1)
|
||||
return 1
|
||||
|
||||
assert async_f.__code__.co_consts[0] == None
|
||||
|
||||
lambda_f = lambda: 0
|
||||
assert lambda_f.__code__.co_consts[0] == None
|
||||
|
||||
class cls:
|
||||
def f():
|
||||
return 1
|
||||
|
||||
assert cls().f.__code__.co_consts[0] == None
|
||||
Reference in new issue
Block a user