Skip to content

Commit ad6af24

Browse files
fix tests
1 parent cc63fa2 commit ad6af24

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_code.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,8 +1282,15 @@ class MyInt(int):
12821282
@cpython_only
12831283
def test__Py_DECLARE_STR_is_interned(self):
12841284
for global_string in iter_global_strings():
1285+
# compile given string to a codeobject
1286+
global_string = eval(f"'{global_string}'")
12851287
self.assertIsInterned(global_string)
12861288

1289+
@cpython_only
1290+
def test_non_internable_strings_not_interned(self):
1291+
self.assertIsNotInterned("not-internable")
1292+
self.assertIsNotInterned("not.internable")
1293+
12871294
class CodeWeakRefTest(unittest.TestCase):
12881295

12891296
def test_basic(self):

0 commit comments

Comments
 (0)