(self)
| 2445 | test_pickle_dump_load(self.assertIs, SomeTuple.first) |
| 2446 | |
| 2447 | def test_tuple_subclass_with_auto_1(self): |
| 2448 | from collections import namedtuple |
| 2449 | T = namedtuple('T', 'index desc') |
| 2450 | class SomeEnum(T, Enum): |
| 2451 | __qualname__ = 'SomeEnum' # needed for pickle protocol 4 |
| 2452 | first = auto(), 'for the money' |
| 2453 | second = auto(), 'for the show' |
| 2454 | third = auto(), 'for the music' |
| 2455 | self.assertIs(type(SomeEnum.first), SomeEnum) |
| 2456 | self.assertEqual(SomeEnum.third.value, (3, 'for the music')) |
| 2457 | self.assertIsInstance(SomeEnum.third.value, T) |
| 2458 | self.assertEqual(SomeEnum.first.index, 1) |
| 2459 | self.assertEqual(SomeEnum.second.desc, 'for the show') |
| 2460 | globals()['SomeEnum'] = SomeEnum |
| 2461 | globals()['T'] = T |
| 2462 | test_pickle_dump_load(self.assertIs, SomeEnum.first) |
| 2463 | |
| 2464 | def test_tuple_subclass_with_auto_2(self): |
| 2465 | from collections import namedtuple |
nothing calls this directly
no test coverage detected