summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_code.py
diff options
context:
space:
mode:
authorGabriele N. Tornetta <P403n1x87@users.noreply.github.com>2021-07-07 11:21:51 (GMT)
committerGitHub <noreply@github.com>2021-07-07 11:21:51 (GMT)
commit2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f (patch)
tree446776f951c764ef32fbe91e80c7928be0fe54b4 /Lib/test/test_code.py
parent32096df0e00e692ee6dc688e62213bff0dffd573 (diff)
downloadcpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.zip
cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.gz
cpython-2f180ce2cb6e6a7e3c517495e0f4873d6aaf5f2f.tar.bz2
bpo-44530: Add co_qualname field to PyCodeObject (GH-26941)
Diffstat (limited to 'Lib/test/test_code.py')
-rw-r--r--Lib/test/test_code.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 24d27c0..ccb8da6 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -17,7 +17,7 @@ cellvars: ('x',)
freevars: ()
nlocals: 2
flags: 3
-consts: ('None', '<code object g>', "'f.<locals>.g'")
+consts: ('None', '<code object g>')
>>> dump(f(4).__code__)
name: g
@@ -223,6 +223,7 @@ class CodeTest(unittest.TestCase):
co.co_varnames,
co.co_filename,
co.co_name,
+ co.co_qualname,
co.co_firstlineno,
co.co_lnotab,
co.co_endlinetable,
@@ -231,6 +232,12 @@ class CodeTest(unittest.TestCase):
co.co_freevars,
co.co_cellvars)
+ def test_qualname(self):
+ self.assertEqual(
+ CodeTest.test_qualname.__code__.co_qualname,
+ CodeTest.test_qualname.__qualname__
+ )
+
def test_replace(self):
def func():
x = 1
@@ -297,6 +304,7 @@ class CodeTest(unittest.TestCase):
co.co_varnames,
co.co_filename,
co.co_name,
+ co.co_qualname,
co.co_firstlineno,
co.co_lnotab,
co.co_endlinetable,