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