Merge pull request #6417 from ShaharNaveh/regr-test-doc-leak

Add regression test for #4505
This commit is contained in:
Shahar Naveh authored and GitHub committed 2025-12-12 21:12:02 +09:00
1 parent 35f88608d2
commit a47b32816b
1 file changed
+22 -3
+22 -3
View File
@@ -1,6 +1,6 @@
import types
from testutils import assert_raises
from testutils import assert_raises
# Spec: https://docs.python.org/2/library/types.html
print(None)
@@ -111,8 +111,6 @@ with assert_raises(TypeError):
with assert_raises(TypeError):
del int.__qualname__
from testutils import assert_raises
import platform
if platform.python_implementation() == "RustPython":
@@ -607,3 +605,24 @@ class A(type):
assert "__dict__" not in A.__dict__
# regression tests for: https://github.com/RustPython/RustPython/issues/4505
def foo():
def inner():
pass
assert foo.__code__.co_names == ()
stmts = """
import blah
def foo():
pass
"""
code = compile(stmts, "<test>", "exec")
assert code.co_names == ("blah", "foo")