(self)
| 812 | self.assertEqual(C(42).x, 42) |
| 813 | |
| 814 | def test_not_tuple(self): |
| 815 | # Make sure we can't be compared to a tuple. |
| 816 | @dataclass |
| 817 | class Point: |
| 818 | x: int |
| 819 | y: int |
| 820 | self.assertNotEqual(Point(1, 2), (1, 2)) |
| 821 | |
| 822 | # And that we can't compare to another unrelated dataclass. |
| 823 | @dataclass |
| 824 | class C: |
| 825 | x: int |
| 826 | y: int |
| 827 | self.assertNotEqual(Point(1, 3), C(1, 3)) |
| 828 | |
| 829 | def test_not_other_dataclass(self): |
| 830 | # Test that some of the problems with namedtuple don't happen |
nothing calls this directly
no test coverage detected