`attr.fields` works.
(self, cls)
| 114 | |
| 115 | @pytest.mark.parametrize("cls", [C2, C2Slots]) |
| 116 | def test_fields(self, cls): |
| 117 | """ |
| 118 | `attr.fields` works. |
| 119 | """ |
| 120 | assert ( |
| 121 | Attribute( |
| 122 | name="x", |
| 123 | alias="x", |
| 124 | default=foo, |
| 125 | validator=None, |
| 126 | repr=True, |
| 127 | cmp=None, |
| 128 | eq=True, |
| 129 | order=True, |
| 130 | hash=None, |
| 131 | init=True, |
| 132 | inherited=False, |
| 133 | alias_is_default=True, |
| 134 | ), |
| 135 | Attribute( |
| 136 | name="y", |
| 137 | alias="y", |
| 138 | default=attr.Factory(list), |
| 139 | validator=None, |
| 140 | repr=True, |
| 141 | cmp=None, |
| 142 | eq=True, |
| 143 | order=True, |
| 144 | hash=None, |
| 145 | init=True, |
| 146 | inherited=False, |
| 147 | alias_is_default=True, |
| 148 | ), |
| 149 | ) == attr.fields(cls) |
| 150 | |
| 151 | @pytest.mark.parametrize("cls", [C1, C1Slots]) |
| 152 | def test_asdict(self, cls): |