(self)
| 487 | self.assertEqual(a.__parameters__, (T,)) |
| 488 | |
| 489 | def test_dir(self): |
| 490 | ga = list[int] |
| 491 | dir_of_gen_alias = set(dir(ga)) |
| 492 | self.assertTrue(dir_of_gen_alias.issuperset(dir(list))) |
| 493 | for generic_alias_property in ( |
| 494 | "__origin__", "__args__", "__parameters__", |
| 495 | "__unpacked__", |
| 496 | ): |
| 497 | with self.subTest(generic_alias_property=generic_alias_property): |
| 498 | self.assertIn(generic_alias_property, dir_of_gen_alias) |
| 499 | for blocked in ( |
| 500 | "__bases__", |
| 501 | "__copy__", |
| 502 | "__deepcopy__", |
| 503 | ): |
| 504 | with self.subTest(blocked=blocked): |
| 505 | self.assertNotIn(blocked, dir_of_gen_alias) |
| 506 | |
| 507 | for entry in dir_of_gen_alias: |
| 508 | with self.subTest(entry=entry): |
| 509 | getattr(ga, entry) # must not raise `AttributeError` |
| 510 | |
| 511 | def test_weakref(self): |
| 512 | for t in self.generic_types: |
nothing calls this directly
no test coverage detected