(self)
| 1953 | self.assertTrue(t[0] is not dd) # make sure defaultdict is copied |
| 1954 | |
| 1955 | def test_dynamic_class_creation(self): |
| 1956 | cls_dict = {'__annotations__': {'x': int, 'y': int}, |
| 1957 | } |
| 1958 | |
| 1959 | # Create the class. |
| 1960 | cls = type('C', (), cls_dict) |
| 1961 | |
| 1962 | # Make it a dataclass. |
| 1963 | cls1 = dataclass(cls) |
| 1964 | |
| 1965 | self.assertEqual(cls1, cls) |
| 1966 | self.assertEqual(asdict(cls(1, 2)), {'x': 1, 'y': 2}) |
| 1967 | |
| 1968 | def test_dynamic_class_creation_using_field(self): |
| 1969 | cls_dict = {'__annotations__': {'x': int, 'y': int}, |
nothing calls this directly
no test coverage detected