(self)
| 2397 | |
| 2398 | @support.cpython_only |
| 2399 | def test_column_offset_deduplication(self): |
| 2400 | # GH-95150: Code with different column offsets shouldn't be merged! |
| 2401 | for source in [ |
| 2402 | "lambda: a", |
| 2403 | "(a for b in c)", |
| 2404 | ]: |
| 2405 | with self.subTest(source): |
| 2406 | code = compile(f"{source}, {source}", "<test>", "eval") |
| 2407 | self.assertEqual(len(code.co_consts), 2) |
| 2408 | self.assertIsInstance(code.co_consts[0], types.CodeType) |
| 2409 | self.assertIsInstance(code.co_consts[1], types.CodeType) |
| 2410 | self.assertNotEqual(code.co_consts[0], code.co_consts[1]) |
| 2411 | self.assertNotEqual( |
| 2412 | list(code.co_consts[0].co_positions()), |
| 2413 | list(code.co_consts[1].co_positions()), |
| 2414 | ) |
| 2415 | |
| 2416 | def test_load_super_attr(self): |
| 2417 | source = "class C:\n def __init__(self):\n super().__init__()" |
nothing calls this directly
no test coverage detected