mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
Merge pull request #6417 from ShaharNaveh/regr-test-doc-leak
Add regression test for #4505
This commit is contained in:
1 parent
35f88608d2
commit
a47b32816b
1 file changed
+22
-3
@@ -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")
|
||||
Reference in new issue
Block a user