MCPcopy
hub / github.com/python-attrs/attrs / test_sets_no_retain

Method test_sets_no_retain

tests/test_funcs.py:172–182  ·  view source on GitHub ↗

Set types are converted to lists if retain_collection_types=False.

(self, C, set_type)

Source from the content-addressed store, hash-verified

170
171 @given(set_type=st.sampled_from((set, frozenset)))
172 def test_sets_no_retain(self, C, set_type):
173 """
174 Set types are converted to lists if retain_collection_types=False.
175 """
176 d = asdict(
177 C(1, set_type((1, 2, 3))),
178 retain_collection_types=False,
179 recurse=True,
180 )
181
182 assert {"x": 1, "y": [1, 2, 3]} == d
183
184 @given(st.sampled_from(MAPPING_TYPES))
185 def test_dicts(self, C, dict_factory):

Callers

nothing calls this directly

Calls 2

asdictFunction · 0.90
CClass · 0.70

Tested by

no test coverage detected