summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>2020-07-08 00:45:45 (GMT)
committerGitHub <noreply@github.com>2020-07-08 00:45:45 (GMT)
commit6f13adf59e6feb736d05ebe174bd793f4437a3d8 (patch)
tree745e946835228bdb8c4f284c9c1f766ac7936058
parent10772ec1505a4583d662c051e577eb2d4fb6e755 (diff)
downloadcpython-6f13adf59e6feb736d05ebe174bd793f4437a3d8.zip
cpython-6f13adf59e6feb736d05ebe174bd793f4437a3d8.tar.gz
cpython-6f13adf59e6feb736d05ebe174bd793f4437a3d8.tar.bz2
Add a test for get_id() (GH-21370)
-rw-r--r--Lib/test/test_symtable.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_symtable.py b/Lib/test/test_symtable.py
index d193558..fa51491 100644
--- a/Lib/test/test_symtable.py
+++ b/Lib/test/test_symtable.py
@@ -63,6 +63,13 @@ class SymtableTest(unittest.TestCase):
self.assertEqual(self.spam.get_type(), "function")
self.assertEqual(self.internal.get_type(), "function")
+ def test_id(self):
+ self.assertGreater(self.top.get_id(), 0)
+ self.assertGreater(self.Mine.get_id(), 0)
+ self.assertGreater(self.a_method.get_id(), 0)
+ self.assertGreater(self.spam.get_id(), 0)
+ self.assertGreater(self.internal.get_id(), 0)
+
def test_optimized(self):
self.assertFalse(self.top.is_optimized())