Test dumping to tuple and back for Hypothesis-generated classes.
(self, cls, tuple_class)
| 428 | |
| 429 | @given(simple_classes(), st.sampled_from(SEQUENCE_TYPES)) |
| 430 | def test_roundtrip(self, cls, tuple_class): |
| 431 | """ |
| 432 | Test dumping to tuple and back for Hypothesis-generated classes. |
| 433 | """ |
| 434 | instance = cls() |
| 435 | tuple_instance = astuple(instance, tuple_factory=tuple_class) |
| 436 | |
| 437 | assert isinstance(tuple_instance, tuple_class) |
| 438 | |
| 439 | roundtrip_instance = cls(*tuple_instance) |
| 440 | |
| 441 | assert instance == roundtrip_instance |
| 442 | |
| 443 | @given(set_type=st.sampled_from((set, frozenset))) |
| 444 | def test_sets_no_retain(self, C, set_type): |