(self)
| 2788 | self._test_recursive_tuple_and_dict_key(REX_seven, asdict=lambda x: x.table) |
| 2789 | |
| 2790 | def test_recursive_set(self): |
| 2791 | if self.py_version < (3, 4): |
| 2792 | self.skipTest('not supported in Python < 3.4') |
| 2793 | # Set containing an immutable object containing the original set. |
| 2794 | y = set() |
| 2795 | y.add(K(y)) |
| 2796 | for proto in range(4, pickle.HIGHEST_PROTOCOL + 1): |
| 2797 | s = self.dumps(y, proto) |
| 2798 | x = self.loads(s) |
| 2799 | self.assertIsInstance(x, set) |
| 2800 | self.assertEqual(len(x), 1) |
| 2801 | self.assertIsInstance(list(x)[0], K) |
| 2802 | self.assertIs(list(x)[0].value, x) |
| 2803 | |
| 2804 | # Immutable object containing a set containing the original object. |
| 2805 | y, = y |
| 2806 | for proto in range(4, pickle.HIGHEST_PROTOCOL + 1): |
| 2807 | s = self.dumps(y, proto) |
| 2808 | x = self.loads(s) |
| 2809 | self.assertIsInstance(x, K) |
| 2810 | self.assertIsInstance(x.value, set) |
| 2811 | self.assertEqual(len(x.value), 1) |
| 2812 | self.assertIs(list(x.value)[0], x) |
| 2813 | |
| 2814 | def test_recursive_inst(self): |
| 2815 | # Mutable object containing itself. |
nothing calls this directly
no test coverage detected