(self)
| 2415 | test_pickle_dump_load(self.assertIs, SomeTuple.first) |
| 2416 | |
| 2417 | def test_tuple_subclass_with_auto_1(self): |
| 2418 | from collections import namedtuple |
| 2419 | T = namedtuple('T', 'index desc') |
| 2420 | class SomeEnum(T, Enum): |
| 2421 | __qualname__ = 'SomeEnum' # needed for pickle protocol 4 |
| 2422 | first = auto(), 'for the money' |
| 2423 | second = auto(), 'for the show' |
| 2424 | third = auto(), 'for the music' |
| 2425 | self.assertIs(type(SomeEnum.first), SomeEnum) |
| 2426 | self.assertEqual(SomeEnum.third.value, (3, 'for the music')) |
| 2427 | self.assertIsInstance(SomeEnum.third.value, T) |
| 2428 | self.assertEqual(SomeEnum.first.index, 1) |
| 2429 | self.assertEqual(SomeEnum.second.desc, 'for the show') |
| 2430 | globals()['SomeEnum'] = SomeEnum |
| 2431 | globals()['T'] = T |
| 2432 | test_pickle_dump_load(self.assertIs, SomeEnum.first) |
| 2433 | |
| 2434 | def test_tuple_subclass_with_auto_2(self): |
| 2435 | from collections import namedtuple |
nothing calls this directly
no test coverage detected